Skip to contentSkip to conversation

omap3: gpio pin config bugfixes

PATCH In review David Brownell 3 participants 6 messages Feb 9, 2009 – Feb 27, 2009

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

PATCH 1/1 omap3: gpio pin config bugfixes

From: David Brownell <[email protected]>

Bugfix several GPIO mux configurations which didn't enable the input drivers, but weren't named as e.g. ..._GPIO141_OUT. These bugs were added quite recently, for OMAP3 EVM support.

To help avoid such bugs in the future, update the comment to clarify the rule: always use PIN_INPUT, unless the name uses that name suffix, to be crystal-clear on the signal's use as output-only.

(Also adds GPIO-63, for the EVM's MMC-1 writeprotect switch. Presumably that works right...)

---

 arch/arm/mach-omap2/mux.c             |   13 ++++++++-----
 arch/arm/plat-omap/include/mach/mux.h |    1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/mux.c +8 -5
@@ -453,6 +453,7 @@ MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TX
 
 
 /* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
+ * (Always specify PIN_INPUT, except for names suffixed by "_OUT".)
  * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
  */
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
@@ -460,17 +461,19 @@ MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
 MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("L8_34XX_GPIO63", 0x0ce,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
 MUX_CFG_34XX("AE6_34XX_GPIO141", 0x16e,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF5_34XX_GPIO142", 0x170,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AE5_34XX_GPIO143", 0x172,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 
 };
 
arch/arm/plat-omap/include/mach/mux.h +1 -0
@@ -792,6 +792,7 @@ enum omap34xx_index {
 	J25_34XX_GPIO170,
 	AF26_34XX_GPIO0,
 	AF22_34XX_GPIO9,
+	L8_34XX_GPIO63,
 	AF6_34XX_GPIO140_UP,
 	AE6_34XX_GPIO141,
 	AF5_34XX_GPIO142,
#1 lore raw

Hi,

Quoted 46 lines · David Brownell

From: David Brownell <[email protected]>

Bugfix several GPIO mux configurations which didn't enable the input drivers, but weren't named as e.g. ..._GPIO141_OUT. These bugs were added quite recently, for OMAP3 EVM support.

To help avoid such bugs in the future, update the comment to clarify the rule: always use PIN_INPUT, unless the name uses that name suffix, to be crystal-clear on the signal's use as output-only.

(Also adds GPIO-63, for the EVM's MMC-1 writeprotect switch. Presumably that works right...)

---

 arch/arm/mach-omap2/mux.c             |   13 ++++++++-----
 arch/arm/plat-omap/include/mach/mux.h |    1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/mux.c +5 -3
@@ -453,6 +453,7 @@ MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TX
 
 
 /* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
+ * (Always specify PIN_INPUT, except for names suffixed by "_OUT".)
 * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
 */
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
@@ -460,17 +461,19 @@ MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
 MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("L8_34XX_GPIO63", 0x0ce,
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
 MUX_CFG_34XX("AE6_34XX_GPIO141", 0x16e,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)

arch/arm/mach-omap2/mux.c MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, · line 479

Quoted 10 lines
arch/arm/mach-omap2/mux.c +3 -2
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF5_34XX_GPIO142", 0x170,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AE5_34XX_GPIO143", 0x172,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 
 };
 

So the thing is, OMAP34XX_PIN_INPUT doens't mean input-only, but input-and-output. And OMAP34XX_PIN_OUTPUT doen't mean output, but output-only. Names of macros are really confusing me. Shouldn't we change names of these macros first? For example,
OMAP34XX_PIN_INPUT -> OMAP34XX_PIN_INPUT_EN
OMAP34XX_PIN_OUTPUT -> OMAP34XX_PIN_OUTPUT_ONLY

Quoted 15 lines
arch/arm/plat-omap/include/mach/mux.h +1 -1
@@ -792,6 +792,7 @@ enum omap34xx_index {
       J25_34XX_GPIO170,
       AF26_34XX_GPIO0,
       AF22_34XX_GPIO9,
+       L8_34XX_GPIO63,
       AF6_34XX_GPIO140_UP,
       AE6_34XX_GPIO141,
       AF5_34XX_GPIO142,
--

To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Kim Kyuwon
maintainer
#2 lore raw
Quoted 57 lines · Kim Kyuwon

Hi,

Quoted 54 lines · David Brownell

From: David Brownell <[email protected]>

Bugfix several GPIO mux configurations which didn't enable the input drivers, but weren't named as e.g. ..._GPIO141_OUT. These bugs were added quite recently, for OMAP3 EVM support.

To help avoid such bugs in the future, update the comment to clarify the rule: always use PIN_INPUT, unless the name uses that name suffix, to be crystal-clear on the signal's use as output-only.

(Also adds GPIO-63, for the EVM's MMC-1 writeprotect switch. Presumably that works right...)

---

 arch/arm/mach-omap2/mux.c             |   13 ++++++++-----
 arch/arm/plat-omap/include/mach/mux.h |    1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/mux.c +8 -5
@@ -453,6 +453,7 @@ MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TX
 
 
 /* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
+ * (Always specify PIN_INPUT, except for names suffixed by "_OUT".)
 * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
 */
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
@@ -460,17 +461,19 @@ MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
 MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("L8_34XX_GPIO63", 0x0ce,
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
 MUX_CFG_34XX("AE6_34XX_GPIO141", 0x16e,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF5_34XX_GPIO142", 0x170,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AE5_34XX_GPIO143", 0x172,
-               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 
Quoted 9 lines

arch/arm/mach-omap2/mux.c MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, · line 479

Quoted 2 lines
arch/arm/mach-omap2/mux.c +0 -0
 };
 

So the thing is, OMAP34XX_PIN_INPUT doens't mean input-only, but input-and-output. And OMAP34XX_PIN_OUTPUT doen't mean output, but output-only. Names of macros are really confusing me. Shouldn't we change names of these macros first? For example,
OMAP34XX_PIN_INPUT -> OMAP34XX_PIN_INPUT_EN
OMAP34XX_PIN_OUTPUT -> OMAP34XX_PIN_OUTPUT_ONLY

I like this idea to cut down on confusion.

Tony

Quoted 24 lines
Quoted 15 lines
arch/arm/plat-omap/include/mach/mux.h +1 -1
@@ -792,6 +792,7 @@ enum omap34xx_index {
       J25_34XX_GPIO170,
       AF26_34XX_GPIO0,
       AF22_34XX_GPIO9,
+       L8_34XX_GPIO63,
       AF6_34XX_GPIO140_UP,
       AE6_34XX_GPIO141,
       AF5_34XX_GPIO142,
--

To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Kim Kyuwon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 10 lines · Tony Lindgren
Quoted 8 lines
Quoted 1 line

So the thing is, OMAP34XX_PIN_INPUT doens't mean input-only, but input-and-output. And OMAP34XX_PIN_OUTPUT doen't mean output, but output-only. Names of macros are really confusing me. Shouldn't we change names of these macros first? For example,
OMAP34XX_PIN_INPUT -> OMAP34XX_PIN_INPUT_EN
OMAP34XX_PIN_OUTPUT -> OMAP34XX_PIN_OUTPUT_ONLY

I like this idea to cut down on confusion.

Makes sense to me. Though I suggest merging this first, and then changing everything in the tree ... instead of changing everything first, and then redoing this patch. :)

maintainer
#4 lore raw
In reply to David Brownell
Quoted 6 lines · David Brownell

From: David Brownell <[email protected]>

Bugfix several GPIO mux configurations which didn't enable the input drivers, but weren't named as e.g. ..._GPIO141_OUT. These bugs were added quite recently, for OMAP3 EVM support.

Quoted 7 lines

To help avoid such bugs in the future, update the comment to clarify the rule: always use PIN_INPUT, unless the name uses that name suffix, to be crystal-clear on the signal's use as output-only.

(Also adds GPIO-63, for the EVM's MMC-1 writeprotect switch. Presumably that works right...)

Here's this refreshed to apply against l-o.

Tony

From: David Brownell <[email protected]>
To: OMAP <[email protected]>
Subject: [patch 2.6.29-rc3-omap-git] omap3: gpio pin config bugfixes
From: David Brownell <[email protected]>

Bugfix several GPIO mux configurations which didn't enable the input drivers, but weren't named as e.g. ..._GPIO141_OUT. These bugs were added quite recently, for OMAP3 EVM support.

To help avoid such bugs in the future, update the comment to clarify the rule: always use PIN_INPUT, unless the name uses that name suffix, to be crystal-clear on the signal's use as output-only.

(Also adds GPIO-63, for the EVM's MMC-1 writeprotect switch. Presumably that works right...)

---

 arch/arm/mach-omap2/mux.c             |   13 ++++++++-----
 arch/arm/plat-omap/include/mach/mux.h |    1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/mux.c +8 -5
@@ -453,6 +453,7 @@ MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TX
 
 
 /* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
+ * (Always specify PIN_INPUT, except for names suffixed by "_OUT".)
  * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
  */
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
@@ -460,17 +461,19 @@ MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
 MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("L8_34XX_GPIO63", 0x0ce,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
 MUX_CFG_34XX("AE6_34XX_GPIO141", 0x16e,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF5_34XX_GPIO142", 0x170,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AE5_34XX_GPIO143", 0x172,
-		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AG4_34XX_GPIO134", 0x160,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
 MUX_CFG_34XX("U8_34XX_GPIO54", 0x0b4,
arch/arm/plat-omap/include/mach/mux.h +1 -0
@@ -792,6 +792,7 @@ enum omap34xx_index {
 	J25_34XX_GPIO170,
 	AF26_34XX_GPIO0,
 	AF22_34XX_GPIO9,
+	L8_34XX_GPIO63,
 	AF6_34XX_GPIO140_UP,
 	AE6_34XX_GPIO141,
 	AF5_34XX_GPIO142,