kernel: backport BCM5357 fix for GPIOs
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.14 / 025-bcma_backport.patch
1 --- a/drivers/bcma/driver_gpio.c
2 +++ b/drivers/bcma/driver_gpio.c
3 @@ -218,7 +218,14 @@ int bcma_gpio_init(struct bcma_drv_cc *c
4 #if IS_BUILTIN(CONFIG_BCMA_HOST_SOC)
5 chip->to_irq = bcma_gpio_to_irq;
6 #endif
7 - chip->ngpio = 16;
8 + switch (cc->core->bus->chipinfo.id) {
9 + case BCMA_CHIP_ID_BCM5357:
10 + chip->ngpio = 32;
11 + break;
12 + default:
13 + chip->ngpio = 16;
14 + }
15 +
16 /* There is just one SoC in one device and its GPIO addresses should be
17 * deterministic to address them more easily. The other buses could get
18 * a random base number. */