summaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-03-05 12:25:11 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-03-13 10:25:50 -0400
commit982a40f5c0bb03368989a6b1ae833b474854e931 (patch)
treeac48e5179974d2c93d5e8317ec571bcf7fdf0ded /drivers/bcma
parent702131e2a393b45174be326f1dbe20b658b4f157 (diff)
bcma: allow disabling (not building) PCI driver
It isn't required for bcma bus on SoCs, so provide some empty functions and allow disabling it. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/Kconfig4
-rw-r--r--drivers/bcma/bcma_private.h20
2 files changed, 22 insertions, 2 deletions
diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index 9be17d3431bb..1500b7120fc7 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -45,9 +45,9 @@ config BCMA_HOST_SOC
45 45
46 If unsure, say N 46 If unsure, say N
47 47
48# TODO: make it depend on PCI when ready
49config BCMA_DRIVER_PCI 48config BCMA_DRIVER_PCI
50 bool 49 bool "BCMA Broadcom PCI core driver"
50 depends on BCMA && PCI
51 default y 51 default y
52 help 52 help
53 BCMA bus may have many versions of PCIe core. This driver 53 BCMA bus may have many versions of PCIe core. This driver
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 5a1d22489afc..15f2b2e242ea 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -106,15 +106,35 @@ static inline void __exit bcma_host_soc_unregister_driver(void)
106#endif /* CONFIG_BCMA_HOST_SOC && CONFIG_OF */ 106#endif /* CONFIG_BCMA_HOST_SOC && CONFIG_OF */
107 107
108/* driver_pci.c */ 108/* driver_pci.c */
109#ifdef CONFIG_BCMA_DRIVER_PCI
109u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address); 110u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
110void bcma_core_pci_early_init(struct bcma_drv_pci *pc); 111void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
111void bcma_core_pci_init(struct bcma_drv_pci *pc); 112void bcma_core_pci_init(struct bcma_drv_pci *pc);
112void bcma_core_pci_up(struct bcma_drv_pci *pc); 113void bcma_core_pci_up(struct bcma_drv_pci *pc);
113void bcma_core_pci_down(struct bcma_drv_pci *pc); 114void bcma_core_pci_down(struct bcma_drv_pci *pc);
115#else
116static inline void bcma_core_pci_early_init(struct bcma_drv_pci *pc)
117{
118 WARN_ON(pc->core->bus->hosttype == BCMA_HOSTTYPE_PCI);
119}
120static inline void bcma_core_pci_init(struct bcma_drv_pci *pc)
121{
122 /* Initialization is required for PCI hosted bus */
123 WARN_ON(pc->core->bus->hosttype == BCMA_HOSTTYPE_PCI);
124}
125#endif
114 126
115/* driver_pcie2.c */ 127/* driver_pcie2.c */
128#ifdef CONFIG_BCMA_DRIVER_PCI
116void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2); 129void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
117void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2); 130void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);
131#else
132static inline void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
133{
134 /* Initialization is required for PCI hosted bus */
135 WARN_ON(pcie2->core->bus->hosttype == BCMA_HOSTTYPE_PCI);
136}
137#endif
118 138
119extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc); 139extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
120 140