aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-04-27 06:55:37 -0400
committerLinus Walleij <linus.walleij@linaro.org>2011-06-21 04:57:41 -0400
commitf727a05a2c90cfe44749004718bc5a4ef3569b34 (patch)
tree7144db6b7d1f37d1a641fc0649d028d5b72d8434 /arch/arm/mach-ux500
parent9372da5073705fe991f0254baf47f82d491c83ff (diff)
mach-ux500: fix HREFv60 regression
This fixes a regression on the HREFv60 ux500 hardware: the wrong level shifter was addressed in the MMCI vdd handler, trying to reconfigure an unclaimed GPIO pin. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 7c6cb4fa47a9..f8b195063b62 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -32,13 +32,32 @@
32#define MCI_DATA31DIREN (1 << 5) 32#define MCI_DATA31DIREN (1 << 5)
33#define MCI_FBCLKEN (1 << 7) 33#define MCI_FBCLKEN (1 << 7)
34 34
35/* GPIO pins used by the sdi0 level shifter */
36static int sdi0_en = -1;
37static int sdi0_vsel = -1;
38
35static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd, 39static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
36 unsigned char power_mode) 40 unsigned char power_mode)
37{ 41{
38 if (power_mode == MMC_POWER_UP) 42 switch (power_mode) {
39 gpio_set_value_cansleep(GPIO_SDMMC_EN, 1); 43 case MMC_POWER_UP:
40 else if (power_mode == MMC_POWER_OFF) 44 case MMC_POWER_ON:
41 gpio_set_value_cansleep(GPIO_SDMMC_EN, 0); 45 /*
46 * Level shifter voltage should depend on vdd to when deciding
47 * on either 1.8V or 2.9V. Once the decision has been made the
48 * level shifter must be disabled and re-enabled with a changed
49 * select signal in order to switch the voltage. Since there is
50 * no framework support yet for indicating 1.8V in vdd, use the
51 * default 2.9V.
52 */
53 gpio_direction_output(sdi0_vsel, 0);
54 gpio_direction_output(sdi0_en, 1);
55 break;
56 case MMC_POWER_OFF:
57 gpio_direction_output(sdi0_vsel, 0);
58 gpio_direction_output(sdi0_en, 0);
59 break;
60 }
42 61
43 return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN | 62 return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
44 MCI_DATA2DIREN | MCI_DATA31DIREN; 63 MCI_DATA2DIREN | MCI_DATA31DIREN;
@@ -77,10 +96,6 @@ static struct mmci_platform_data mop500_sdi0_data = {
77#endif 96#endif
78}; 97};
79 98
80/* GPIO pins used by the sdi0 level shifter */
81static int sdi0_en = -1;
82static int sdi0_vsel = -1;
83
84static void sdi0_configure(void) 99static void sdi0_configure(void)
85{ 100{
86 int ret; 101 int ret;
@@ -210,6 +225,7 @@ void __init mop500_sdi_init(void)
210 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; 225 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
211 sdi0_configure(); 226 sdi0_configure();
212 } 227 }
228
213 /* 229 /*
214 * On boards with the TC35892 GPIO expander, sdi0 will finally 230 * On boards with the TC35892 GPIO expander, sdi0 will finally
215 * be added when the TC35892 initializes and calls 231 * be added when the TC35892 initializes and calls