Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3254
b: refs/heads/master
c: 21d6b7e
h: refs/heads/master
v: v3
  • Loading branch information
pavel@ucw.cz authored and Linus Torvalds committed Jun 25, 2005
1 parent 98897bd commit 8250080
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac25575203c11145066ea5cb583354cb5f0a8ade
refs/heads/master: 21d6b7e18f70c847c867aafb3109405b48424388
38 changes: 38 additions & 0 deletions trunk/Documentation/power/pci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,44 @@ 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
~~~~~~~~~~~~

Expand Down

0 comments on commit 8250080

Please sign in to comment.