Skip to contentSkip to conversation

ARM: OMAP: hsmmc: Fix mux for non-OMAP pins

PATCH In review Thomas Weber 2 participants 2 messages Nov 17, 2011 – Dec 9, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH v2 1/1 ARM: OMAP: hsmmc: Fix mux for non-OMAP pins

In reply to a message not in the archive

The Devkit8000 uses a TWL4030 pin for card detection. Thats why the error:
_omap_mux_init_gpio: Could not set gpio192 occurs.

This patch checks that the pin is on OMAP before
calling omap_mux_init_gpio.

---
Changelog:
v2: Remove backslash at end of line

 arch/arm/mach-omap2/hsmmc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/hsmmc.c +4 -2
index f4a1020..c3aea79 100644
@@ -200,10 +200,12 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
 static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
 			int controller_nr)
 {
-	if (gpio_is_valid(mmc_controller->slots[0].switch_pin))
+	if (gpio_is_valid(mmc_controller->slots[0].switch_pin) &&
+		(mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
 		omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
 					OMAP_PIN_INPUT_PULLUP);
-	if (gpio_is_valid(mmc_controller->slots[0].gpio_wp))
+	if (gpio_is_valid(mmc_controller->slots[0].gpio_wp) &&
+		(mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
 		omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
 					OMAP_PIN_INPUT_PULLUP);
 	if (cpu_is_omap34xx()) {
Signature · 1 line
1.7.7.3
maintainer
#2 lore raw
Quoted 7 lines · Thomas Weber

The Devkit8000 uses a TWL4030 pin for card detection. Thats why the error:
_omap_mux_init_gpio: Could not set gpio192 occurs.

This patch checks that the pin is on OMAP before
calling omap_mux_init_gpio.

Thanks applying into omap driver branch.

Tony