aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-08-23 18:32:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-26 14:09:02 -0400
commitcfe51ec1ae427ec0be5a7670eae815ce5eb30e1c (patch)
tree331c8cc84052329197af32cf71ad90e2dd82086e
parentf4a83e578e0011ddcfdbe1c62d0916dadb4802aa (diff)
bcma: add method to power up and down the PCIe core by wifi driver
The wifi driver should tell the PCIe core that it is now in operation so that some workarounds can be applied and the power state is changed. This should replace the call to bcma_core_pci_extend_L1timer by the brcmsmac driver. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/bcma/driver_pci.c26
-rw-r--r--include/linux/bcma/bcma_driver_pci.h3
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index cf7a476a519f..6ea817fae59f 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -275,3 +275,29 @@ void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
275 bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG); 275 bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
276} 276}
277EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer); 277EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer);
278
279void bcma_core_pci_up(struct bcma_bus *bus)
280{
281 struct bcma_drv_pci *pc;
282
283 if (bus->hosttype != BCMA_HOSTTYPE_PCI)
284 return;
285
286 pc = &bus->drv_pci[0];
287
288 bcma_core_pci_extend_L1timer(pc, true);
289}
290EXPORT_SYMBOL_GPL(bcma_core_pci_up);
291
292void bcma_core_pci_down(struct bcma_bus *bus)
293{
294 struct bcma_drv_pci *pc;
295
296 if (bus->hosttype != BCMA_HOSTTYPE_PCI)
297 return;
298
299 pc = &bus->drv_pci[0];
300
301 bcma_core_pci_extend_L1timer(pc, false);
302}
303EXPORT_SYMBOL_GPL(bcma_core_pci_down);
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 424760f01b9d..27f9ceb68b42 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -185,6 +185,7 @@ struct pci_dev;
185#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001 185#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
186 186
187struct bcma_drv_pci; 187struct bcma_drv_pci;
188struct bcma_bus;
188 189
189#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE 190#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
190struct bcma_drv_pci_host { 191struct bcma_drv_pci_host {
@@ -220,6 +221,8 @@ extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
220extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 221extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
221 struct bcma_device *core, bool enable); 222 struct bcma_device *core, bool enable);
222extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend); 223extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend);
224extern void bcma_core_pci_up(struct bcma_bus *bus);
225extern void bcma_core_pci_down(struct bcma_bus *bus);
223 226
224extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev); 227extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
225extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev); 228extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);