aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 474e9cd0e9e4..d8ace1f90dd2 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -17,6 +17,16 @@
17 * Registration of PCI drivers and handling of hot-pluggable devices. 17 * Registration of PCI drivers and handling of hot-pluggable devices.
18 */ 18 */
19 19
20/* multithreaded probe logic */
21static int pci_multithread_probe =
22#ifdef CONFIG_PCI_MULTITHREAD_PROBE
23 1;
24#else
25 0;
26#endif
27__module_param_call("", pci_multithread_probe, param_set_bool, param_get_bool, &pci_multithread_probe, 0644);
28
29
20/* 30/*
21 * Dynamic device IDs are disabled for !CONFIG_HOTPLUG 31 * Dynamic device IDs are disabled for !CONFIG_HOTPLUG
22 */ 32 */
@@ -279,6 +289,18 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
279 return i; 289 return i;
280} 290}
281 291
292static int pci_device_suspend_late(struct device * dev, pm_message_t state)
293{
294 struct pci_dev * pci_dev = to_pci_dev(dev);
295 struct pci_driver * drv = pci_dev->driver;
296 int i = 0;
297
298 if (drv && drv->suspend_late) {
299 i = drv->suspend_late(pci_dev, state);
300 suspend_report_result(drv->suspend_late, i);
301 }
302 return i;
303}
282 304
283/* 305/*
284 * Default resume method for devices that have no driver provided resume, 306 * Default resume method for devices that have no driver provided resume,
@@ -313,6 +335,17 @@ static int pci_device_resume(struct device * dev)
313 return error; 335 return error;
314} 336}
315 337
338static int pci_device_resume_early(struct device * dev)
339{
340 int error = 0;
341 struct pci_dev * pci_dev = to_pci_dev(dev);
342 struct pci_driver * drv = pci_dev->driver;
343
344 if (drv && drv->resume_early)
345 error = drv->resume_early(pci_dev);
346 return error;
347}
348
316static void pci_device_shutdown(struct device *dev) 349static void pci_device_shutdown(struct device *dev)
317{ 350{
318 struct pci_dev *pci_dev = to_pci_dev(dev); 351 struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -385,6 +418,7 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner)
385 drv->driver.bus = &pci_bus_type; 418 drv->driver.bus = &pci_bus_type;
386 drv->driver.owner = owner; 419 drv->driver.owner = owner;
387 drv->driver.kobj.ktype = &pci_driver_kobj_type; 420 drv->driver.kobj.ktype = &pci_driver_kobj_type;
421 drv->driver.multithread_probe = pci_multithread_probe;
388 422
389 spin_lock_init(&drv->dynids.lock); 423 spin_lock_init(&drv->dynids.lock);
390 INIT_LIST_HEAD(&drv->dynids.list); 424 INIT_LIST_HEAD(&drv->dynids.list);
@@ -509,8 +543,10 @@ struct bus_type pci_bus_type = {
509 .probe = pci_device_probe, 543 .probe = pci_device_probe,
510 .remove = pci_device_remove, 544 .remove = pci_device_remove,
511 .suspend = pci_device_suspend, 545 .suspend = pci_device_suspend,
512 .shutdown = pci_device_shutdown, 546 .suspend_late = pci_device_suspend_late,
547 .resume_early = pci_device_resume_early,
513 .resume = pci_device_resume, 548 .resume = pci_device_resume,
549 .shutdown = pci_device_shutdown,
514 .dev_attrs = pci_dev_attrs, 550 .dev_attrs = pci_dev_attrs,
515}; 551};
516 552