diff options
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index b03457881c4b..cd100d569f4d 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/mfd/abx500/ab8500.h> | 24 | #include <linux/mfd/abx500/ab8500.h> |
25 | #include <linux/regulator/ab8500.h> | 25 | #include <linux/regulator/ab8500.h> |
26 | #include <linux/regulator/fixed.h> | 26 | #include <linux/regulator/fixed.h> |
27 | #include <linux/regulator/driver.h> | ||
28 | #include <linux/regulator/gpio-regulator.h> | ||
27 | #include <linux/mfd/tc3589x.h> | 29 | #include <linux/mfd/tc3589x.h> |
28 | #include <linux/mfd/tps6105x.h> | 30 | #include <linux/mfd/tps6105x.h> |
29 | #include <linux/mfd/abx500/ab8500-gpio.h> | 31 | #include <linux/mfd/abx500/ab8500-gpio.h> |
@@ -89,6 +91,37 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = { | |||
89 | }, | 91 | }, |
90 | }; | 92 | }; |
91 | 93 | ||
94 | /* Dynamically populated. */ | ||
95 | static struct gpio sdi0_reg_gpios[] = { | ||
96 | { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" }, | ||
97 | }; | ||
98 | |||
99 | static struct gpio_regulator_state sdi0_reg_states[] = { | ||
100 | { .value = 2900000, .gpios = (0 << 0) }, | ||
101 | { .value = 1800000, .gpios = (1 << 0) }, | ||
102 | }; | ||
103 | |||
104 | static struct gpio_regulator_config sdi0_reg_info = { | ||
105 | .supply_name = "ext-mmc-level-shifter", | ||
106 | .gpios = sdi0_reg_gpios, | ||
107 | .nr_gpios = ARRAY_SIZE(sdi0_reg_gpios), | ||
108 | .states = sdi0_reg_states, | ||
109 | .nr_states = ARRAY_SIZE(sdi0_reg_states), | ||
110 | .type = REGULATOR_VOLTAGE, | ||
111 | .enable_high = 1, | ||
112 | .enabled_at_boot = 0, | ||
113 | .init_data = &sdi0_reg_init_data, | ||
114 | .startup_delay = 100, | ||
115 | }; | ||
116 | |||
117 | static struct platform_device sdi0_regulator = { | ||
118 | .name = "gpio-regulator", | ||
119 | .id = -1, | ||
120 | .dev = { | ||
121 | .platform_data = &sdi0_reg_info, | ||
122 | }, | ||
123 | }; | ||
124 | |||
92 | static struct abx500_gpio_platform_data ab8500_gpio_pdata = { | 125 | static struct abx500_gpio_platform_data ab8500_gpio_pdata = { |
93 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), | 126 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), |
94 | }; | 127 | }; |
@@ -481,6 +514,7 @@ static struct hash_platform_data u8500_hash1_platform_data = { | |||
481 | /* add any platform devices here - TODO */ | 514 | /* add any platform devices here - TODO */ |
482 | static struct platform_device *mop500_platform_devs[] __initdata = { | 515 | static struct platform_device *mop500_platform_devs[] __initdata = { |
483 | &mop500_gpio_keys_device, | 516 | &mop500_gpio_keys_device, |
517 | &sdi0_regulator, | ||
484 | }; | 518 | }; |
485 | 519 | ||
486 | #ifdef CONFIG_STE_DMA40 | 520 | #ifdef CONFIG_STE_DMA40 |
@@ -624,6 +658,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = { | |||
624 | &snowball_gpio_en_3v3_regulator_dev, | 658 | &snowball_gpio_en_3v3_regulator_dev, |
625 | &u8500_thsens_device, | 659 | &u8500_thsens_device, |
626 | &u8500_cpufreq_cooling_device, | 660 | &u8500_cpufreq_cooling_device, |
661 | &sdi0_regulator, | ||
627 | }; | 662 | }; |
628 | 663 | ||
629 | static void __init mop500_init_machine(void) | 664 | static void __init mop500_init_machine(void) |
@@ -635,6 +670,9 @@ static void __init mop500_init_machine(void) | |||
635 | platform_device_register(&db8500_prcmu_device); | 670 | platform_device_register(&db8500_prcmu_device); |
636 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; | 671 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; |
637 | 672 | ||
673 | sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN; | ||
674 | sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL; | ||
675 | |||
638 | mop500_pinmaps_init(); | 676 | mop500_pinmaps_init(); |
639 | parent = u8500_init_devices(&ab8500_platdata); | 677 | parent = u8500_init_devices(&ab8500_platdata); |
640 | 678 | ||
@@ -668,6 +706,10 @@ static void __init snowball_init_machine(void) | |||
668 | int i; | 706 | int i; |
669 | 707 | ||
670 | platform_device_register(&db8500_prcmu_device); | 708 | platform_device_register(&db8500_prcmu_device); |
709 | |||
710 | sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO; | ||
711 | sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO; | ||
712 | |||
671 | snowball_pinmaps_init(); | 713 | snowball_pinmaps_init(); |
672 | parent = u8500_init_devices(&ab8500_platdata); | 714 | parent = u8500_init_devices(&ab8500_platdata); |
673 | 715 | ||
@@ -701,6 +743,9 @@ static void __init hrefv60_init_machine(void) | |||
701 | */ | 743 | */ |
702 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; | 744 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; |
703 | 745 | ||
746 | sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO; | ||
747 | sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO; | ||
748 | |||
704 | hrefv60_pinmaps_init(); | 749 | hrefv60_pinmaps_init(); |
705 | parent = u8500_init_devices(&ab8500_platdata); | 750 | parent = u8500_init_devices(&ab8500_platdata); |
706 | 751 | ||