42ce9feaee99a90a547a0344a66c266f3d34fd9f
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-3.10 / 143-MIPS-BCM47XX-Check-all-32-GPIOs-when-looking-for-a-p.patch
1 From 4fe2169acecb6e62821dfe14bc5c5852870b516f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Thu, 13 Feb 2014 17:48:12 +0100
4 Subject: MIPS: BCM47XX: Check all (32) GPIOs when looking for a pin
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Broadcom boards support 32 GPIOs and NVRAM may have entires for higher
10 ones too. Example:
11 gpio23=wombo_reset
12
13 Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
14 Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
15 Cc: linux-mips@linux-mips.org
16 Cc: Rafał Miłecki <zajec5@gmail.com>
17 Patchwork: https://patchwork.linux-mips.org/patch/6547/
18 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
19
20 --- a/arch/mips/bcm47xx/nvram.c
21 +++ b/arch/mips/bcm47xx/nvram.c
22 @@ -197,7 +197,7 @@ int bcm47xx_nvram_gpio_pin(const char *n
23 char nvram_var[10];
24 char buf[30];
25
26 - for (i = 0; i < 16; i++) {
27 + for (i = 0; i < 32; i++) {
28 err = snprintf(nvram_var, sizeof(nvram_var), "gpio%i", i);
29 if (err <= 0)
30 continue;