Skip to contentSkip to conversation

Blackfin: cmd_gpio: allow port pins over 15

PATCH New Andreas Pretzsch 2 participants 3 messages Jan 10, 2011 – Apr 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Blackfin: cmd_gpio: allow port pins over 15

The pin portion of the specified GPIO was limited to 0..15. While this is correct for Blackfins with different bank names (e.g. BF537 with PF, PG, PH with 16 pins each), it's not sufficient for Blackfins with linear naming like the BF561 (PF0..PF47). Therefore check only for a valid GPIO number.

Attn.: Passing a # too high for the port will wrap over to the next port(s), e.g. PA16 => PB0. Not a problem for correct scripts, though.

---
 arch/blackfin/cpu/cmd_gpio.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
arch/blackfin/cpu/cmd_gpio.c +5 -1
index e96413b..9fd5a19 100644
@@ -83,7 +83,11 @@ int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	/* grab the <#> portion */
 	ulong pin = simple_strtoul(str_pin + 1, NULL, 10);
-	if (pin > 15)
+	/* Attn.: passing a # too high for the port will wrap over to
+	 * the next port(s), e.g. PA16 => PB0.
+	 * Check relaxed due to linear ports (e.g. PF0..PF47 @ BF561).
+	 */
+	if (!gpio_is_valid(pin))
 		goto show_usage;
 
 	/* grab the pin before we tweak it */
Signature · 1 line
1.7.2.3
#2 lore raw

PATCH 1/1 Blackfin: cmd_gpio: allow port pins over 15

Am Freitag, den 08.04.2011, 16:24 -0400 schrieb Mike Frysinger:

Quoted 3 lines

this is obsoleted by my recent patch:
[U-Boot] [PATCH] gpio: generalize for all generic gpio providers
-mike

ACK. Thanks very much for your work.

Signature · 5 lines
carpe noctem engineering
Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch
Dipl.-Ing. (FH) Andreas Pretzsch          Tel. +49-(0)731-5521572
Hahnengasse 3                             Fax: +49-(0)731-5521573
89073 Ulm, Germany                        email: apr at cn-eng.de