Blackfin: cmd_gpio: allow port pins over 15
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
@@ -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
PATCH 1/1 Blackfin: cmd_gpio: allow port pins over 15
this is obsoleted by my recent patch:
[U-Boot] [PATCH] gpio: generalize for all generic gpio providers
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110408/307f3854/attachment.pgp
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