1 --- a/drivers/bcma/driver_gpio.c
2 +++ b/drivers/bcma/driver_gpio.c
3 @@ -226,6 +226,7 @@ int bcma_gpio_init(struct bcma_drv_cc *c
4 chip->of_node = cc->core->dev.of_node;
6 switch (bus->chipinfo.id) {
7 + case BCMA_CHIP_ID_BCM4707:
8 case BCMA_CHIP_ID_BCM5357:
9 case BCMA_CHIP_ID_BCM53572:
11 @@ -235,16 +236,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c
15 - * On MIPS we register GPIO devices (LEDs, buttons) using absolute GPIO
16 - * pin numbers. We don't have Device Tree there and we can't really use
17 - * relative (per chip) numbers.
18 - * So let's use predictable base for BCM47XX and "random" for all other.
19 + * Register SoC GPIO devices with absolute GPIO pin base.
20 + * On MIPS, we don't have Device Tree and we can't use relative (per chip)
22 + * On some ARM devices, user space may want to access some system GPIO
23 + * pins directly, which is easier to do with a predictable GPIO base.
25 -#if IS_BUILTIN(CONFIG_BCM47XX)
26 - chip->base = bus->num * BCMA_GPIO_MAX_PINS;
30 + if (IS_BUILTIN(CONFIG_BCM47XX) ||
31 + cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
32 + chip->base = bus->num * BCMA_GPIO_MAX_PINS;
36 err = bcma_gpio_irq_domain_init(cc);