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);
38 --- a/drivers/bcma/Kconfig
39 +++ b/drivers/bcma/Kconfig
40 @@ -29,12 +29,6 @@ config BCMA_HOST_PCI
41 select BCMA_DRIVER_PCI
44 -config BCMA_DRIVER_PCI_HOSTMODE
45 - bool "Driver for PCI core working in hostmode"
46 - depends on BCMA && MIPS && BCMA_HOST_PCI
48 - PCI core hostmode operation (external PCI bus).
51 bool "Support for BCMA in a SoC"
53 @@ -61,6 +55,12 @@ config BCMA_DRIVER_PCI
54 This driver is also prerequisite for a hostmode PCIe core
57 +config BCMA_DRIVER_PCI_HOSTMODE
58 + bool "Driver for PCI core working in hostmode"
59 + depends on BCMA && MIPS && BCMA_DRIVER_PCI
61 + PCI core hostmode operation (external PCI bus).
63 config BCMA_DRIVER_MIPS
64 bool "BCMA Broadcom MIPS core driver"
65 depends on BCMA && MIPS
66 --- a/include/linux/bcma/bcma_driver_pci.h
67 +++ b/include/linux/bcma/bcma_driver_pci.h
68 @@ -246,7 +246,18 @@ static inline void bcma_core_pci_power_s
72 +#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
73 extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
74 extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
76 +static inline int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev)
80 +static inline int bcma_core_pci_plat_dev_init(struct pci_dev *dev)
86 #endif /* LINUX_BCMA_DRIVER_PCI_H_ */