X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Documentation%2Fpower%2Fpci.txt;fp=Documentation%2Fpower%2Fpci.txt;h=73fc87e5dc382013207ccbf5c2989eb0e1240abf;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=35b1a7dae34253751ade84ca7f0eda948fac11dd;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt index 35b1a7dae..73fc87e5d 100644 --- a/Documentation/power/pci.txt +++ b/Documentation/power/pci.txt @@ -291,11 +291,49 @@ a request to enable wake events from D3, two calls should be made to pci_enable_wake (one for both D3hot and D3cold). +A reference implementation +------------------------- +.suspend() +{ + /* driver specific operations */ + + /* Disable IRQ */ + free_irq(); + /* If using MSI */ + pci_disable_msi(); + + pci_save_state(); + pci_enable_wake(); + /* Disable IO/bus master/irq router */ + pci_disable_device(); + pci_set_power_state(pci_choose_state()); +} + +.resume() +{ + pci_set_power_state(PCI_D0); + pci_restore_state(); + /* device's irq possibly is changed, driver should take care */ + pci_enable_device(); + pci_set_master(); + + /* if using MSI, device's vector possibly is changed */ + pci_enable_msi(); + + request_irq(); + /* driver specific operations; */ +} + +This is a typical implementation. Drivers can slightly change the order +of the operations in the implementation, ignore some operations or add +more deriver specific operations in it, but drivers should do something like +this on the whole. + 5. Resources ~~~~~~~~~~~~ PCI Local Bus Specification PCI Bus Power Management Interface Specification - http://pcisig.org + http://www.pcisig.com