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>
This commit is contained in:
Linus Walleij 2011-04-27 12:55:37 +02:00
parent 9372da5073
commit f727a05a2c

View File

@ -32,13 +32,32 @@
#define MCI_DATA31DIREN (1 << 5) #define MCI_DATA31DIREN (1 << 5)
#define MCI_FBCLKEN (1 << 7) #define MCI_FBCLKEN (1 << 7)
/* GPIO pins used by the sdi0 level shifter */
static int sdi0_en = -1;
static int sdi0_vsel = -1;
static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd, static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
unsigned char power_mode) unsigned char power_mode)
{ {
if (power_mode == MMC_POWER_UP) switch (power_mode) {
gpio_set_value_cansleep(GPIO_SDMMC_EN, 1); case MMC_POWER_UP:
else if (power_mode == MMC_POWER_OFF) case MMC_POWER_ON:
gpio_set_value_cansleep(GPIO_SDMMC_EN, 0); /*
* Level shifter voltage should depend on vdd to when deciding
* on either 1.8V or 2.9V. Once the decision has been made the
* level shifter must be disabled and re-enabled with a changed
* select signal in order to switch the voltage. Since there is
* no framework support yet for indicating 1.8V in vdd, use the
* default 2.9V.
*/
gpio_direction_output(sdi0_vsel, 0);
gpio_direction_output(sdi0_en, 1);
break;
case MMC_POWER_OFF:
gpio_direction_output(sdi0_vsel, 0);
gpio_direction_output(sdi0_en, 0);
break;
}
return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN | return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
MCI_DATA2DIREN | MCI_DATA31DIREN; MCI_DATA2DIREN | MCI_DATA31DIREN;
@ -77,10 +96,6 @@ static struct mmci_platform_data mop500_sdi0_data = {
#endif #endif
}; };
/* GPIO pins used by the sdi0 level shifter */
static int sdi0_en = -1;
static int sdi0_vsel = -1;
static void sdi0_configure(void) static void sdi0_configure(void)
{ {
int ret; int ret;
@ -210,6 +225,7 @@ void __init mop500_sdi_init(void)
sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
sdi0_configure(); sdi0_configure();
} }
/* /*
* On boards with the TC35892 GPIO expander, sdi0 will finally * On boards with the TC35892 GPIO expander, sdi0 will finally
* be added when the TC35892 initializes and calls * be added when the TC35892 initializes and calls