WIP FPC-III support
[linux/fpc-iii.git] / arch / x86 / platform / intel-mid / device_libs / platform_emc1403.c
bloba2508582a0b1146b8d878367bcdecb935f095760
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * platform_emc1403.c: emc1403 platform data initialization file
5 * (C) Copyright 2013 Intel Corporation
6 * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
7 */
9 #include <linux/init.h>
10 #include <linux/gpio.h>
11 #include <linux/i2c.h>
12 #include <asm/intel-mid.h>
14 static void __init *emc1403_platform_data(void *info)
16 static short intr2nd_pdata;
17 struct i2c_board_info *i2c_info = info;
18 int intr = get_gpio_by_name("thermal_int");
19 int intr2nd = get_gpio_by_name("thermal_alert");
21 if (intr < 0)
22 return NULL;
23 if (intr2nd < 0)
24 return NULL;
26 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
27 intr2nd_pdata = intr2nd + INTEL_MID_IRQ_OFFSET;
29 return &intr2nd_pdata;
32 static const struct devs_id emc1403_dev_id __initconst = {
33 .name = "emc1403",
34 .type = SFI_DEV_TYPE_I2C,
35 .delay = 1,
36 .get_platform_data = &emc1403_platform_data,
39 sfi_device(emc1403_dev_id);