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_emc1403.c
blob69a783689d21b7c2c7ac9db8c21f10b6582a318d
1 /*
2 * platform_emc1403.c: emc1403 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/init.h>
14 #include <linux/gpio.h>
15 #include <linux/i2c.h>
16 #include <asm/intel-mid.h>
18 static void __init *emc1403_platform_data(void *info)
20 static short intr2nd_pdata;
21 struct i2c_board_info *i2c_info = info;
22 int intr = get_gpio_by_name("thermal_int");
23 int intr2nd = get_gpio_by_name("thermal_alert");
25 if (intr < 0)
26 return NULL;
27 if (intr2nd < 0)
28 return NULL;
30 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
31 intr2nd_pdata = intr2nd + INTEL_MID_IRQ_OFFSET;
33 return &intr2nd_pdata;
36 static const struct devs_id emc1403_dev_id __initconst = {
37 .name = "emc1403",
38 .type = SFI_DEV_TYPE_I2C,
39 .delay = 1,
40 .get_platform_data = &emc1403_platform_data,
43 sfi_device(emc1403_dev_id);