~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to drivers/bcma/host_pci.c

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-04kado7d1u2er2rl
Tags: 3.2.0-16.25
Add new lowlatency kernel flavour

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
        pci_set_drvdata(dev, NULL);
225
225
}
226
226
 
 
227
#ifdef CONFIG_PM
 
228
static int bcma_host_pci_suspend(struct pci_dev *dev, pm_message_t state)
 
229
{
 
230
        struct bcma_bus *bus = pci_get_drvdata(dev);
 
231
 
 
232
        /* Host specific */
 
233
        pci_save_state(dev);
 
234
        pci_disable_device(dev);
 
235
        pci_set_power_state(dev, pci_choose_state(dev, state));
 
236
 
 
237
        bus->mapped_core = NULL;
 
238
        return 0;
 
239
}
 
240
 
 
241
static int bcma_host_pci_resume(struct pci_dev *dev)
 
242
{
 
243
        struct bcma_bus *bus = pci_get_drvdata(dev);
 
244
        int err;
 
245
 
 
246
        /* Host specific */
 
247
        pci_set_power_state(dev, 0);
 
248
        err = pci_enable_device(dev);
 
249
        if (err)
 
250
                return err;
 
251
        pci_restore_state(dev);
 
252
 
 
253
        /* Bus specific */
 
254
        err = bcma_bus_resume(bus);
 
255
        if (err)
 
256
                return err;
 
257
 
 
258
        return 0;
 
259
}
 
260
#else /* CONFIG_PM */
 
261
# define bcma_host_pci_suspend  NULL
 
262
# define bcma_host_pci_resume   NULL
 
263
#endif /* CONFIG_PM */
 
264
 
227
265
static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
228
266
        { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
229
267
        { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
239
277
        .id_table = bcma_pci_bridge_tbl,
240
278
        .probe = bcma_host_pci_probe,
241
279
        .remove = bcma_host_pci_remove,
 
280
        .suspend = bcma_host_pci_suspend,
 
281
        .resume = bcma_host_pci_resume,
242
282
};
243
283
 
244
284
int __init bcma_host_pci_init(void)