9 #include <linux/slab.h>
11 #include <linux/pci.h>
12 #include <linux/module.h>
28 switch (core->
id.id) {
35 if (core->
bus->mapped_core != core)
36 bcma_host_pci_switch_core(core);
42 offset += bcma_host_pci_provide_access_to_core(core);
48 offset += bcma_host_pci_provide_access_to_core(core);
54 offset += bcma_host_pci_provide_access_to_core(core);
61 offset += bcma_host_pci_provide_access_to_core(core);
68 offset += bcma_host_pci_provide_access_to_core(core);
75 offset += bcma_host_pci_provide_access_to_core(core);
79 #ifdef CONFIG_BCMA_BLOCKIO
84 if (core->
bus->mapped_core != core)
85 bcma_host_pci_switch_core(core);
103 static void bcma_host_pci_block_write(
struct bcma_device *core,
104 const void *buffer,
size_t count,
105 u16 offset,
u8 reg_width)
108 if (core->
bus->mapped_core != core)
109 bcma_host_pci_switch_core(core);
130 if (core->
bus->mapped_core != core)
131 bcma_host_pci_switch_core(core);
135 static void bcma_host_pci_awrite32(
struct bcma_device *core,
u16 offset,
138 if (core->
bus->mapped_core != core)
139 bcma_host_pci_switch_core(core);
144 .read8 = bcma_host_pci_read8,
145 .read16 = bcma_host_pci_read16,
146 .read32 = bcma_host_pci_read32,
147 .write8 = bcma_host_pci_write8,
148 .write16 = bcma_host_pci_write16,
149 .write32 = bcma_host_pci_write32,
150 #ifdef CONFIG_BCMA_BLOCKIO
151 .block_read = bcma_host_pci_block_read,
152 .block_write = bcma_host_pci_block_write,
154 .aread32 = bcma_host_pci_aread32,
155 .awrite32 = bcma_host_pci_awrite32,
176 name = dev_name(&dev->
dev);
181 goto err_pci_disable;
186 pci_read_config_dword(dev, 0x40, &val);
187 if ((val & 0x0000ff00) != 0)
188 pci_write_config_dword(dev, 0x40, val & 0xffff00ff);
191 if (!pci_is_pcie(dev))
192 bcma_err(bus,
"PCI card detected, report problems.\n");
196 bus->
mmio = pci_iomap(dev, 0, ~0
UL);
198 goto err_pci_release_regions;
203 bus->
ops = &bcma_host_pci_ops;
211 goto err_pci_unmap_mmio;
213 pci_set_drvdata(dev, bus);
220 err_pci_release_regions:
231 struct bcma_bus *bus = pci_get_drvdata(dev);
238 pci_set_drvdata(dev,
NULL);
242 static int bcma_host_pci_suspend(
struct device *dev)
245 struct bcma_bus *bus = pci_get_drvdata(pdev);
249 return bcma_bus_suspend(bus);
252 static int bcma_host_pci_resume(
struct device *dev)
255 struct bcma_bus *bus = pci_get_drvdata(pdev);
257 return bcma_bus_resume(bus);
261 bcma_host_pci_resume);
262 #define BCMA_PM_OPS (&bcma_pm_ops)
266 #define BCMA_PM_OPS NULL
283 static struct pci_driver bcma_pci_bridge_driver = {
284 .name =
"bcma-pci-bridge",
285 .id_table = bcma_pci_bridge_tbl,
286 .probe = bcma_host_pci_probe,
293 return pci_register_driver(&bcma_pci_bridge_driver);