dwc3-pci.c (1aaaa9acaea1dd2878d6c92b45e4c117ef425baf) | dwc3-pci.c (f6c274e11e3b31a5f95c23962b1ba593bd6a4759) |
---|---|
1/** 2 * dwc3-pci.c - PCI Specific glue layer 3 * 4 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com 5 * 6 * Authors: Felipe Balbi <balbi@ti.com>, 7 * Sebastian Andrzej Siewior <bigeasy@linutronix.de> 8 * --- 229 unchanged lines hidden (view full) --- 238static int dwc3_pci_runtime_suspend(struct device *dev) 239{ 240 if (device_run_wake(dev)) 241 return 0; 242 243 return -EBUSY; 244} 245 | 1/** 2 * dwc3-pci.c - PCI Specific glue layer 3 * 4 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com 5 * 6 * Authors: Felipe Balbi <balbi@ti.com>, 7 * Sebastian Andrzej Siewior <bigeasy@linutronix.de> 8 * --- 229 unchanged lines hidden (view full) --- 238static int dwc3_pci_runtime_suspend(struct device *dev) 239{ 240 if (device_run_wake(dev)) 241 return 0; 242 243 return -EBUSY; 244} 245 |
246static int dwc3_pci_runtime_resume(struct device *dev) 247{ 248 struct platform_device *dwc3 = dev_get_drvdata(dev); 249 250 return pm_runtime_get(&dwc3->dev); 251} 252 |
|
246static int dwc3_pci_pm_dummy(struct device *dev) 247{ 248 /* 249 * There's nothing to do here. No, seriously. Everything is either taken 250 * care either by PCI subsystem or dwc3/core.c, so we have nothing 251 * missing here. 252 * 253 * So you'd think we didn't need this at all, but PCI subsystem will 254 * bail out if we don't have a valid callback :-s 255 */ 256 return 0; 257} 258#endif /* CONFIG_PM */ 259 260static struct dev_pm_ops dwc3_pci_dev_pm_ops = { 261 SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_pm_dummy, dwc3_pci_pm_dummy) | 253static int dwc3_pci_pm_dummy(struct device *dev) 254{ 255 /* 256 * There's nothing to do here. No, seriously. Everything is either taken 257 * care either by PCI subsystem or dwc3/core.c, so we have nothing 258 * missing here. 259 * 260 * So you'd think we didn't need this at all, but PCI subsystem will 261 * bail out if we don't have a valid callback :-s 262 */ 263 return 0; 264} 265#endif /* CONFIG_PM */ 266 267static struct dev_pm_ops dwc3_pci_dev_pm_ops = { 268 SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_pm_dummy, dwc3_pci_pm_dummy) |
262 SET_RUNTIME_PM_OPS(dwc3_pci_runtime_suspend, dwc3_pci_pm_dummy, | 269 SET_RUNTIME_PM_OPS(dwc3_pci_runtime_suspend, dwc3_pci_runtime_resume, |
263 NULL) 264}; 265 266static struct pci_driver dwc3_pci_driver = { 267 .name = "dwc3-pci", 268 .id_table = dwc3_pci_id_table, 269 .probe = dwc3_pci_probe, 270 .remove = dwc3_pci_remove, 271 .driver = { 272 .pm = &dwc3_pci_dev_pm_ops, 273 } 274}; 275 276MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); 277MODULE_LICENSE("GPL v2"); 278MODULE_DESCRIPTION("DesignWare USB3 PCI Glue Layer"); 279 280module_pci_driver(dwc3_pci_driver); | 270 NULL) 271}; 272 273static struct pci_driver dwc3_pci_driver = { 274 .name = "dwc3-pci", 275 .id_table = dwc3_pci_id_table, 276 .probe = dwc3_pci_probe, 277 .remove = dwc3_pci_remove, 278 .driver = { 279 .pm = &dwc3_pci_dev_pm_ops, 280 } 281}; 282 283MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); 284MODULE_LICENSE("GPL v2"); 285MODULE_DESCRIPTION("DesignWare USB3 PCI Glue Layer"); 286 287module_pci_driver(dwc3_pci_driver); |