Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f727a05a authored by Linus Walleij's avatar Linus Walleij
Browse files

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: default avatarLinus Walleij <linus.walleij@stericsson.com>
parent 9372da50
Loading
Loading
Loading
Loading
+24 −8
Original line number Original line Diff line number Diff line
@@ -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