diff options
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 87d2d7b38ce9..574916b70b2e 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <linux/mfd/abx500/ab8500.h> | 25 | #include <linux/mfd/abx500/ab8500.h> |
26 | #include <linux/regulator/ab8500.h> | 26 | #include <linux/regulator/ab8500.h> |
27 | #include <linux/regulator/fixed.h> | 27 | #include <linux/regulator/fixed.h> |
28 | #include <linux/regulator/driver.h> | ||
29 | #include <linux/regulator/gpio-regulator.h> | ||
28 | #include <linux/mfd/tc3589x.h> | 30 | #include <linux/mfd/tc3589x.h> |
29 | #include <linux/mfd/tps6105x.h> | 31 | #include <linux/mfd/tps6105x.h> |
30 | #include <linux/mfd/abx500/ab8500-gpio.h> | 32 | #include <linux/mfd/abx500/ab8500-gpio.h> |
@@ -90,6 +92,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = { | |||
90 | }, | 92 | }, |
91 | }; | 93 | }; |
92 | 94 | ||
95 | /* Dynamically populated. */ | ||
96 | static struct gpio sdi0_reg_gpios[] = { | ||
97 | { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" }, | ||
98 | }; | ||
99 | |||
100 | static struct gpio_regulator_state sdi0_reg_states[] = { | ||
101 | { .value = 2900000, .gpios = (0 << 0) }, | ||
102 | { .value = 1800000, .gpios = (1 << 0) }, | ||
103 | }; | ||
104 | |||
105 | static struct gpio_regulator_config sdi0_reg_info = { | ||
106 | .supply_name = "ext-mmc-level-shifter", | ||
107 | .gpios = sdi0_reg_gpios, | ||
108 | .nr_gpios = ARRAY_SIZE(sdi0_reg_gpios), | ||
109 | .states = sdi0_reg_states, | ||
110 | .nr_states = ARRAY_SIZE(sdi0_reg_states), | ||
111 | .type = REGULATOR_VOLTAGE, | ||
112 | .enable_high = 1, | ||
113 | .enabled_at_boot = 0, | ||
114 | .init_data = &sdi0_reg_init_data, | ||
115 | .startup_delay = 100, | ||
116 | }; | ||
117 | |||
118 | static struct platform_device sdi0_regulator = { | ||
119 | .name = "gpio-regulator", | ||
120 | .id = -1, | ||
121 | .dev = { | ||
122 | .platform_data = &sdi0_reg_info, | ||
123 | }, | ||
124 | }; | ||
125 | |||
93 | static struct abx500_gpio_platform_data ab8500_gpio_pdata = { | 126 | static struct abx500_gpio_platform_data ab8500_gpio_pdata = { |
94 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), | 127 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), |
95 | }; | 128 | }; |
@@ -199,10 +232,7 @@ static struct platform_device snowball_sbnet_dev = { | |||
199 | 232 | ||
200 | struct ab8500_platform_data ab8500_platdata = { | 233 | struct ab8500_platform_data ab8500_platdata = { |
201 | .irq_base = MOP500_AB8500_IRQ_BASE, | 234 | .irq_base = MOP500_AB8500_IRQ_BASE, |
202 | .regulator_reg_init = ab8500_regulator_reg_init, | 235 | .regulator = &ab8500_regulator_plat_data, |
203 | .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init), | ||
204 | .regulator = ab8500_regulators, | ||
205 | .num_regulator = ARRAY_SIZE(ab8500_regulators), | ||
206 | .gpio = &ab8500_gpio_pdata, | 236 | .gpio = &ab8500_gpio_pdata, |
207 | .codec = &ab8500_codec_pdata, | 237 | .codec = &ab8500_codec_pdata, |
208 | }; | 238 | }; |
@@ -491,6 +521,7 @@ static struct hash_platform_data u8500_hash1_platform_data = { | |||
491 | /* add any platform devices here - TODO */ | 521 | /* add any platform devices here - TODO */ |
492 | static struct platform_device *mop500_platform_devs[] __initdata = { | 522 | static struct platform_device *mop500_platform_devs[] __initdata = { |
493 | &mop500_gpio_keys_device, | 523 | &mop500_gpio_keys_device, |
524 | &sdi0_regulator, | ||
494 | }; | 525 | }; |
495 | 526 | ||
496 | #ifdef CONFIG_STE_DMA40 | 527 | #ifdef CONFIG_STE_DMA40 |
@@ -634,6 +665,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = { | |||
634 | &snowball_gpio_en_3v3_regulator_dev, | 665 | &snowball_gpio_en_3v3_regulator_dev, |
635 | &u8500_thsens_device, | 666 | &u8500_thsens_device, |
636 | &u8500_cpufreq_cooling_device, | 667 | &u8500_cpufreq_cooling_device, |
668 | &sdi0_regulator, | ||
637 | }; | 669 | }; |
638 | 670 | ||
639 | static void __init mop500_init_machine(void) | 671 | static void __init mop500_init_machine(void) |
@@ -645,6 +677,9 @@ static void __init mop500_init_machine(void) | |||
645 | platform_device_register(&db8500_prcmu_device); | 677 | platform_device_register(&db8500_prcmu_device); |
646 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; | 678 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; |
647 | 679 | ||
680 | sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN; | ||
681 | sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL; | ||
682 | |||
648 | mop500_pinmaps_init(); | 683 | mop500_pinmaps_init(); |
649 | parent = u8500_init_devices(&ab8500_platdata); | 684 | parent = u8500_init_devices(&ab8500_platdata); |
650 | 685 | ||
@@ -678,6 +713,10 @@ static void __init snowball_init_machine(void) | |||
678 | int i; | 713 | int i; |
679 | 714 | ||
680 | platform_device_register(&db8500_prcmu_device); | 715 | platform_device_register(&db8500_prcmu_device); |
716 | |||
717 | sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO; | ||
718 | sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO; | ||
719 | |||
681 | snowball_pinmaps_init(); | 720 | snowball_pinmaps_init(); |
682 | parent = u8500_init_devices(&ab8500_platdata); | 721 | parent = u8500_init_devices(&ab8500_platdata); |
683 | 722 | ||
@@ -713,6 +752,9 @@ static void __init hrefv60_init_machine(void) | |||
713 | */ | 752 | */ |
714 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; | 753 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; |
715 | 754 | ||
755 | sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO; | ||
756 | sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO; | ||
757 | |||
716 | hrefv60_pinmaps_init(); | 758 | hrefv60_pinmaps_init(); |
717 | parent = u8500_init_devices(&ab8500_platdata); | 759 | parent = u8500_init_devices(&ab8500_platdata); |
718 | 760 | ||