Skip to content

Commit cfe51ec

Browse files
haukelinvjw
authored andcommitted
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>
1 parent f4a83e5 commit cfe51ec

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

‎drivers/bcma/driver_pci.c‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,29 @@ void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
275275
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
276276
}
277277
EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer);
278+
279+
void 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+
}
290+
EXPORT_SYMBOL_GPL(bcma_core_pci_up);
291+
292+
void 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+
}
303+
EXPORT_SYMBOL_GPL(bcma_core_pci_down);

‎include/linux/bcma/bcma_driver_pci.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ struct pci_dev;
185185
#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
186186

187187
struct bcma_drv_pci;
188+
struct bcma_bus;
188189

189190
#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
190191
struct bcma_drv_pci_host {
@@ -220,6 +221,8 @@ extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
220221
extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
221222
struct bcma_device *core, bool enable);
222223
extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend);
224+
extern void bcma_core_pci_up(struct bcma_bus *bus);
225+
extern void bcma_core_pci_down(struct bcma_bus *bus);
223226

224227
extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
225228
extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);

0 commit comments

Comments
 (0)