]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
bcma: gpio: register 32 GPIOs on BCM5357
authorRafał Miłecki <zajec5@gmail.com>
Thu, 20 Mar 2014 20:09:07 +0000 (21:09 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 27 Mar 2014 18:20:04 +0000 (14:20 -0400)
Some Broadcom boards have more GPIOs available. For example Linksys
E3200 home router is based on SoC id 0x5357, package 0x0A and uses GPIO
23 to reset internal USB WiFi (gpio23=wombo_reset).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/bcma/driver_gpio.c

index 25f9887a35d08e89600e8aca86fc8c72062600f6..d7f81ad56b8af731ea10fb863460cebb717dddc0 100644 (file)
@@ -218,7 +218,14 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
 #if IS_BUILTIN(CONFIG_BCMA_HOST_SOC)
        chip->to_irq            = bcma_gpio_to_irq;
 #endif
-       chip->ngpio             = 16;
+       switch (cc->core->bus->chipinfo.id) {
+       case BCMA_CHIP_ID_BCM5357:
+               chip->ngpio     = 32;
+               break;
+       default:
+               chip->ngpio     = 16;
+       }
+
        /* There is just one SoC in one device and its GPIO addresses should be
         * deterministic to address them more easily. The other buses could get
         * a random base number. */