* [patch] suspend: PCI power managment reference implementation
@ 2005-05-27 12:04 Pavel Machek
0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2005-05-27 12:04 UTC (permalink / raw)
To: kernel list, Andrew Morton
Added reference implementation of suspend and resume routines.
From: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Pavel Machek <pavel@suse.cz>
---
commit d9b44d1230ad7a7474583eef8ae57060137466c4
tree c50cf60fc2e546606c2f6e7c5f3f32655dee778d
parent 54afa0887fd3618c7fa350b14cc57446db2a261a
author <pavel@amd.(none)> Fri, 27 May 2005 09:19:51 +0200
committer <pavel@amd.(none)> Fri, 27 May 2005 09:19:51 +0200
Documentation/power/pci.txt | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+)
Index: Documentation/power/pci.txt
===================================================================
--- 805a02ec2bcff3671d7b1e701bd1981ad2fa196c/Documentation/power/pci.txt (mode:100644)
+++ c50cf60fc2e546606c2f6e7c5f3f32655dee778d/Documentation/power/pci.txt (mode:100644)
@@ -291,6 +291,44 @@
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
~~~~~~~~~~~~
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-05-27 12:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-27 12:04 [patch] suspend: PCI power managment reference implementation Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®