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_mpu3050.c
blobcfe9a47a1e8778409d2819e6ed20823ad5b299b6
1 /*
2 * platform_mpu3050.c: mpu3050 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/i2c.h>
15 #include <asm/intel-mid.h>
17 static void *mpu3050_platform_data(void *info)
19 struct i2c_board_info *i2c_info = info;
20 int intr = get_gpio_by_name("mpu3050_int");
22 if (intr < 0)
23 return NULL;
25 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
26 return NULL;
29 static const struct devs_id mpu3050_dev_id __initconst = {
30 .name = "mpu3050",
31 .type = SFI_DEV_TYPE_I2C,
32 .delay = 1,
33 .get_platform_data = &mpu3050_platform_data,
36 sfi_device(mpu3050_dev_id);