aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/power/pci.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt
index 35b1a7dae342..6fc9d511fc39 100644
--- a/Documentation/power/pci.txt
+++ b/Documentation/power/pci.txt
@@ -291,6 +291,44 @@ a request to enable wake events from D3, two calls should be made to
291pci_enable_wake (one for both D3hot and D3cold). 291pci_enable_wake (one for both D3hot and D3cold).
292 292
293 293
294A reference implementation
295-------------------------
296.suspend()
297{
298 /* driver specific operations */
299
300 /* Disable IRQ */
301 free_irq();
302 /* If using MSI */
303 pci_disable_msi();
304
305 pci_save_state();
306 pci_enable_wake();
307 /* Disable IO/bus master/irq router */
308 pci_disable_device();
309 pci_set_power_state(pci_choose_state());
310}
311
312.resume()
313{
314 pci_set_power_state(PCI_D0);
315 pci_restore_state();
316 /* device's irq possibly is changed, driver should take care */
317 pci_enable_device();
318 pci_set_master();
319
320 /* if using MSI, device's vector possibly is changed */
321 pci_enable_msi();
322
323 request_irq();
324 /* driver specific operations; */
325}
326
327This is a typical implementation. Drivers can slightly change the order
328of the operations in the implementation, ignore some operations or add
329more deriver specific operations in it, but drivers should do something like
330this on the whole.
331
2945. Resources 3325. Resources
295~~~~~~~~~~~~ 333~~~~~~~~~~~~
296 334