Skip to contentSkip to conversation

ARM: davinci: fix the GPIO lookup for omapl138-hawk

PATCH In review Bartosz Golaszewski 3 participants 4 messages Mar 1, 2018 – Mar 16, 2018

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

PATCH v2 1/1 ARM: davinci: fix the GPIO lookup for omapl138-hawk

From: Bartosz Golaszewski <[email protected]>

The GPIO chip is called davinci_gpio.0 in legacy mode. Fix it, so that mmc can correctly lookup the wp and cp gpios.

Fixes c69f43fb4f26 ("ARM: davinci: hawk: use gpio descriptor for mmc pins")

---
v1 -> v2:
- added the Fixes: tag

 arch/arm/mach-davinci/board-omapl138-hawk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/board-omapl138-hawk.c +2 -2
index a3e78074be70..62eb7d668890 100644
@@ -127,8 +127,8 @@ static struct gpiod_lookup_table mmc_gpios_table = {
 	.dev_id = "da830-mmc.0",
 	.table = {
 		/* CD: gpio3_12: gpio60: chip 1 contains gpio range 32-63*/
-		GPIO_LOOKUP("davinci_gpio.1", 28, "cd", GPIO_ACTIVE_LOW),
-		GPIO_LOOKUP("davinci_gpio.1", 29, "wp", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("davinci_gpio.0", 28, "cd", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("davinci_gpio.0", 29, "wp", GPIO_ACTIVE_LOW),
 	},
 };
 
Signature · 1 line
2.16.1
#1 lore raw
Quoted 7 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The GPIO chip is called davinci_gpio.0 in legacy mode. Fix it, so that mmc can correctly lookup the wp and cp gpios.

Fixes c69f43fb4f26 ("ARM: davinci: hawk: use gpio descriptor for mmc pins")

Applied for v4.16 with a note on the fact that the gpio-davinci driver sets the chip label to davinci_gpio.0.

Thanks,
Sekhar

---8<---
ARM: davinci: fix the GPIO lookup for omapl138-hawk

The GPIO chip is called davinci_gpio.0 in legacy mode. Fix it, so that mmc can correctly lookup the wp and cp gpios.

Note that it is the gpio-davinci driver that sets the gpiochip label to davinci_gpio.0.

Fixes c69f43fb4f26 ("ARM: davinci: hawk: use gpio descriptor for mmc pins")
[nsekhar at ti.com: add a note on where the chip label is set]
#2 lore raw
In reply to Bartosz Golaszewski
Quoted 22 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The GPIO chip is called davinci_gpio.0 in legacy mode. Fix it, so that mmc can correctly lookup the wp and cp gpios.

Fixes c69f43fb4f26 ("ARM: davinci: hawk: use gpio descriptor for mmc pins")

---
v1 -> v2:
- added the Fixes: tag

  arch/arm/mach-davinci/board-omapl138-hawk.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/board-omapl138-hawk.c +0 -0
index a3e78074be70..62eb7d668890 100644

arch/arm/mach-davinci/board-omapl138-hawk.c static struct gpiod_lookup_table mmc_gpios_table = { · line 134

Quoted 10 lines
arch/arm/mach-davinci/board-omapl138-hawk.c +2 -2
@@ -127,8 +127,8 @@ static struct gpiod_lookup_table mmc_gpios_table = {
  	.dev_id = "da830-mmc.0",
  	.table = {
  		/* CD: gpio3_12: gpio60: chip 1 contains gpio range 32-63*/
-		GPIO_LOOKUP("davinci_gpio.1", 28, "cd", GPIO_ACTIVE_LOW),
-		GPIO_LOOKUP("davinci_gpio.1", 29, "wp", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("davinci_gpio.0", 28, "cd", GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP("davinci_gpio.0", 29, "wp", GPIO_ACTIVE_LOW),
  	},
  };
 

Does board-da830-evm.c need the same fix? It also uses "davinci_gpio.1".

#3 lore raw
Quoted 28 lines · David Lechner
Quoted 27 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The GPIO chip is called davinci_gpio.0 in legacy mode. Fix it, so that mmc can correctly lookup the wp and cp gpios.

Fixes c69f43fb4f26 ("ARM: davinci: hawk: use gpio descriptor for mmc

pins")

---
v1 -> v2:
- added the Fixes: tag

? arch/arm/mach-davinci/board-omapl138-hawk.c | 4 ++-- ? 1 file changed, 2 insertions(+), 2 deletions(-)

arch/arm/mach-davinci/board-omapl138-hawk.c +0 -0
index a3e78074be70..62eb7d668890 100644
@@ -127,8 +127,8 @@ static struct gpiod_lookup_table mmc_gpios_table = {
 ????? .dev_id = "da830-mmc.0",
 ????? .table = {

????????? /* CD: gpio3_12: gpio60: chip 1 contains gpio range 32-63*/ -??????? GPIO_LOOKUP("davinci_gpio.1", 28, "cd", GPIO_ACTIVE_LOW),

Quoted 8 lines
Quoted 6 lines

-??????? GPIO_LOOKUP("davinci_gpio.1", 29, "wp", GPIO_ACTIVE_LOW), +??????? GPIO_LOOKUP("davinci_gpio.0", 28, "cd", GPIO_ACTIVE_LOW), +??????? GPIO_LOOKUP("davinci_gpio.0", 29, "wp", GPIO_ACTIVE_LOW), ????? },
? };
?

Does board-da830-evm.c need the same fix? It also uses "davinci_gpio.1".

Yes. looks like fixes are needed here and other places. I will send patches since I have ability to test them.

Thanks,
Sekhar