diff options
Diffstat (limited to 'arch/x86/platform/mrst')
| -rw-r--r-- | arch/x86/platform/mrst/mrst.c | 68 |
1 files changed, 57 insertions, 11 deletions
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index b1489a06a49d..ad4ec1cb097e 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
| @@ -76,6 +76,20 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX]; | |||
| 76 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); | 76 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); |
| 77 | int sfi_mrtc_num; | 77 | int sfi_mrtc_num; |
| 78 | 78 | ||
| 79 | static void mrst_power_off(void) | ||
| 80 | { | ||
| 81 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | ||
| 82 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1); | ||
| 83 | } | ||
| 84 | |||
| 85 | static void mrst_reboot(void) | ||
| 86 | { | ||
| 87 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | ||
| 88 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0); | ||
| 89 | else | ||
| 90 | intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); | ||
| 91 | } | ||
| 92 | |||
| 79 | /* parse all the mtimer info to a static mtimer array */ | 93 | /* parse all the mtimer info to a static mtimer array */ |
| 80 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) | 94 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) |
| 81 | { | 95 | { |
| @@ -265,17 +279,6 @@ static int mrst_i8042_detect(void) | |||
| 265 | return 0; | 279 | return 0; |
| 266 | } | 280 | } |
| 267 | 281 | ||
| 268 | /* Reboot and power off are handled by the SCU on a MID device */ | ||
| 269 | static void mrst_power_off(void) | ||
| 270 | { | ||
| 271 | intel_scu_ipc_simple_command(0xf1, 1); | ||
| 272 | } | ||
| 273 | |||
| 274 | static void mrst_reboot(void) | ||
| 275 | { | ||
| 276 | intel_scu_ipc_simple_command(0xf1, 0); | ||
| 277 | } | ||
| 278 | |||
| 279 | /* | 282 | /* |
| 280 | * Moorestown does not have external NMI source nor port 0x61 to report | 283 | * Moorestown does not have external NMI source nor port 0x61 to report |
| 281 | * NMI status. The possible NMI sources are from pmu as a result of NMI | 284 | * NMI status. The possible NMI sources are from pmu as a result of NMI |
| @@ -484,6 +487,46 @@ static void __init *max7315_platform_data(void *info) | |||
| 484 | return max7315; | 487 | return max7315; |
| 485 | } | 488 | } |
| 486 | 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 | |||
| 487 | static void __init *emc1403_platform_data(void *info) | 530 | static void __init *emc1403_platform_data(void *info) |
| 488 | { | 531 | { |
| 489 | static short intr2nd_pdata; | 532 | static short intr2nd_pdata; |
| @@ -646,12 +689,15 @@ static void *msic_ocd_platform_data(void *info) | |||
| 646 | static const struct devs_id __initconst device_ids[] = { | 689 | static const struct devs_id __initconst device_ids[] = { |
| 647 | {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, | 690 | {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, |
| 648 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, | 691 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, |
| 692 | {"pmic_gpio", SFI_DEV_TYPE_IPC, 1, &pmic_gpio_platform_data}, | ||
| 649 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, | 693 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, |
| 650 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 694 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
| 651 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 695 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
| 696 | {"tca6416", SFI_DEV_TYPE_I2C, 1, &tca6416_platform_data}, | ||
| 652 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, | 697 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, |
| 653 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, | 698 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, |
| 654 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, | 699 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, |
| 700 | {"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data}, | ||
| 655 | 701 | ||
| 656 | /* MSIC subdevices */ | 702 | /* MSIC subdevices */ |
| 657 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, | 703 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, |
