Skip to contentSkip to conversation

gpio_wp pin not set correctly

PATCH Superseded Thomas Weber 3 participants 3 messages Sep 5, 2011 – Sep 6, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

Hello,

I bisected commit 5e4698fc4406b8603913a2eff44b7c44c5924ea4 for the following boot error message.

[    0.361694] _omap_mux_init_gpio: Could not set gpio192

When I revert the commit with actual linux-omap, the message is away.

Can you please check this?

I use a Devkit8000, but the beagleboard should have the same problem.

Thomas

#1 lore raw

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

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.

---
 arch/arm/mach-omap2/hsmmc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/hsmmc.c +4 -2
index a9b45c7..783d0f1 100644
@@ -214,10 +214,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.6.1
#2 lore raw

Re: [PATCH] OMAP: hsmmc: Fix mux for non-OMAP pins

Hello Thomas,

Quoted 18 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.

---
 arch/arm/mach-omap2/hsmmc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/hsmmc.c +0 -0
index a9b45c7..783d0f1 100644

arch/arm/mach-omap2/hsmmc.c static int nop_mmc_set_power(struct device *dev, int slot, int power_on, · line 217

Quoted 5 lines
arch/arm/mach-omap2/hsmmc.c +1 -1
@@ -214,10 +214,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) && \

That backslash at the line end is not needed and looks ugly.

arch/arm/mach-omap2/hsmmc.c static int nop_mmc_set_power(struct device *dev, int slot, int power_on, · line 225

Quoted 9 lines
arch/arm/mach-omap2/hsmmc.c +3 -1
+		(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()) {

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |