diff options
author | Jekyll Lai <jekyll_lai@wistron.com> | 2011-11-16 13:01:20 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-12-05 06:42:13 -0500 |
commit | 28744b3e9c85ea281d6371d4914c2498bceec10c (patch) | |
tree | a4494e25265fbf1851fe0ff63ec207a3c32de6e3 /arch | |
parent | 48bc5562103412590e4487b666b49e7b6c84ba44 (diff) |
mrst: Added some platform data for the SFI translations
Add SFI glue for the following devices:
tca6416: a gpio expander compatible with max7315
mpu3050: gyro sensor
Both of these actual drivers are already upstream
Signed-off-by: Jekyll Lai <jekyll_lai@wistron.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/platform/mrst/mrst.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index fedc3d7ffa7..940a0807a5c 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
@@ -487,6 +487,46 @@ static void __init *max7315_platform_data(void *info) | |||
487 | return max7315; | 487 | return max7315; |
488 | } | 488 | } |
489 | 489 | ||
490 | static void *tca6416_platform_data(void *info) | ||
491 | { | ||
492 | static struct pca953x_platform_data tca6416; | ||
493 | struct i2c_board_info *i2c_info = info; | ||
494 | int gpio_base, intr; | ||
495 | char base_pin_name[SFI_NAME_LEN + 1]; | ||
496 | char intr_pin_name[SFI_NAME_LEN + 1]; | ||
497 | |||
498 | strcpy(i2c_info->type, "tca6416"); | ||
499 | strcpy(base_pin_name, "tca6416_base"); | ||
500 | strcpy(intr_pin_name, "tca6416_int"); | ||
501 | |||
502 | gpio_base = get_gpio_by_name(base_pin_name); | ||
503 | intr = get_gpio_by_name(intr_pin_name); | ||
504 | |||
505 | if (gpio_base == -1) | ||
506 | return NULL; | ||
507 | tca6416.gpio_base = gpio_base; | ||
508 | if (intr != -1) { | ||
509 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
510 | tca6416.irq_base = gpio_base + MRST_IRQ_OFFSET; | ||
511 | } else { | ||
512 | i2c_info->irq = -1; | ||
513 | tca6416.irq_base = -1; | ||
514 | } | ||
515 | return &tca6416; | ||
516 | } | ||
517 | |||
518 | static void *mpu3050_platform_data(void *info) | ||
519 | { | ||
520 | struct i2c_board_info *i2c_info = info; | ||
521 | int intr = get_gpio_by_name("mpu3050_int"); | ||
522 | |||
523 | if (intr == -1) | ||
524 | return NULL; | ||
525 | |||
526 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
527 | return NULL; | ||
528 | } | ||
529 | |||
490 | static void __init *emc1403_platform_data(void *info) | 530 | static void __init *emc1403_platform_data(void *info) |
491 | { | 531 | { |
492 | static short intr2nd_pdata; | 532 | static short intr2nd_pdata; |
@@ -652,9 +692,11 @@ static const struct devs_id __initconst device_ids[] = { | |||
652 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, | 692 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, |
653 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 693 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
654 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 694 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
695 | {"tca6416", SFI_DEV_TYPE_I2C, 1, &tca6416_platform_data}, | ||
655 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, | 696 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, |
656 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, | 697 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, |
657 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, | 698 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, |
699 | {"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data}, | ||
658 | 700 | ||
659 | /* MSIC subdevices */ | 701 | /* MSIC subdevices */ |
660 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, | 702 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, |