028-bcma-from-4.2.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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;
  5. #endif
  6. switch (bus->chipinfo.id) {
  7. + case BCMA_CHIP_ID_BCM4707:
  8. case BCMA_CHIP_ID_BCM5357:
  9. case BCMA_CHIP_ID_BCM53572:
  10. chip->ngpio = 32;
  11. @@ -235,16 +236,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c
  12. }
  13. /*
  14. - * On MIPS we register GPIO devices (LEDs, buttons) using absolute GPIO
  15. - * pin numbers. We don't have Device Tree there and we can't really use
  16. - * relative (per chip) numbers.
  17. - * So let's use predictable base for BCM47XX and "random" for all other.
  18. + * Register SoC GPIO devices with absolute GPIO pin base.
  19. + * On MIPS, we don't have Device Tree and we can't use relative (per chip)
  20. + * GPIO numbers.
  21. + * On some ARM devices, user space may want to access some system GPIO
  22. + * pins directly, which is easier to do with a predictable GPIO base.
  23. */
  24. -#if IS_BUILTIN(CONFIG_BCM47XX)
  25. - chip->base = bus->num * BCMA_GPIO_MAX_PINS;
  26. -#else
  27. - chip->base = -1;
  28. -#endif
  29. + if (IS_BUILTIN(CONFIG_BCM47XX) ||
  30. + cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
  31. + chip->base = bus->num * BCMA_GPIO_MAX_PINS;
  32. + else
  33. + chip->base = -1;
  34. err = bcma_gpio_irq_domain_init(cc);
  35. if (err)
  36. --- a/drivers/bcma/Kconfig
  37. +++ b/drivers/bcma/Kconfig
  38. @@ -29,12 +29,6 @@ config BCMA_HOST_PCI
  39. select BCMA_DRIVER_PCI
  40. default y
  41. -config BCMA_DRIVER_PCI_HOSTMODE
  42. - bool "Driver for PCI core working in hostmode"
  43. - depends on BCMA && MIPS && BCMA_HOST_PCI
  44. - help
  45. - PCI core hostmode operation (external PCI bus).
  46. -
  47. config BCMA_HOST_SOC
  48. bool "Support for BCMA in a SoC"
  49. depends on BCMA
  50. @@ -61,6 +55,12 @@ config BCMA_DRIVER_PCI
  51. This driver is also prerequisite for a hostmode PCIe core
  52. support.
  53. +config BCMA_DRIVER_PCI_HOSTMODE
  54. + bool "Driver for PCI core working in hostmode"
  55. + depends on BCMA && MIPS && BCMA_DRIVER_PCI
  56. + help
  57. + PCI core hostmode operation (external PCI bus).
  58. +
  59. config BCMA_DRIVER_MIPS
  60. bool "BCMA Broadcom MIPS core driver"
  61. depends on BCMA && MIPS
  62. --- a/include/linux/bcma/bcma_driver_pci.h
  63. +++ b/include/linux/bcma/bcma_driver_pci.h
  64. @@ -246,7 +246,18 @@ static inline void bcma_core_pci_power_s
  65. }
  66. #endif
  67. +#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
  68. extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
  69. extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
  70. +#else
  71. +static inline int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev)
  72. +{
  73. + return -ENOTSUPP;
  74. +}
  75. +static inline int bcma_core_pci_plat_dev_init(struct pci_dev *dev)
  76. +{
  77. + return -ENOTSUPP;
  78. +}
  79. +#endif
  80. #endif /* LINUX_BCMA_DRIVER_PCI_H_ */