Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / arch / x86 / platform / intel-mid / device_libs / platform_max3111.c
blobafd1df94e0e5bcea59b27ad3449ec737b4ccb6da
1 /*
2 * platform_max3111.c: max3111 platform data initilization file
4 * (C) Copyright 2013 Intel Corporation
5 * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; version 2
10 * of the License.
13 #include <linux/gpio.h>
14 #include <linux/spi/spi.h>
15 #include <asm/intel-mid.h>
17 static void __init *max3111_platform_data(void *info)
19 struct spi_board_info *spi_info = info;
20 int intr = get_gpio_by_name("max3111_int");
22 spi_info->mode = SPI_MODE_0;
23 if (intr == -1)
24 return NULL;
25 spi_info->irq = intr + INTEL_MID_IRQ_OFFSET;
26 return NULL;
29 static const struct devs_id max3111_dev_id __initconst = {
30 .name = "spi_max3111",
31 .type = SFI_DEV_TYPE_SPI,
32 .get_platform_data = &max3111_platform_data,
35 sfi_device(max3111_dev_id);