public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Belay <abelay@novell.com>
To: linux-kernel@vger.kernel.org
Cc: greg@kroah.com
Subject: [RFC][PATCH] basic PCI<->PCI bridge PM (suspend/resume) [9/9]
Date: Thu, 14 Jul 2005 04:55:59 -0400	[thread overview]
Message-ID: <1121331359.3398.97.camel@localhost.localdomain> (raw)

This patch adds very simplistic suspend/resume support for the PCI
bridge driver.  Soon this will be replaced with bridge specific code,
but for now we'll try using pci_save/restore_state().

Signed-off-by: Adam Belay <abelay@novell.com>

--- a/drivers/pci/bus/pci-bridge.c	2005-07-14 04:22:13.000000000 -0400
+++ b/drivers/pci/bus/pci-bridge.c	2005-07-14 04:26:17.257004064 -0400
@@ -159,11 +159,29 @@
 	pci_remove_bus(dev->subordinate);
 }
 
+static int ppb_suspend(struct pci_dev *dev, pm_message_t state)
+{
+	pci_save_state(dev);
+	pci_set_power_state(dev, pci_choose_state(dev, state));
+
+	return 0;
+}
+
+static int ppb_resume(struct pci_dev *dev)
+{
+	pci_set_power_state(dev, PCI_D0);
+	pci_restore_state(dev);
+
+	return 0;
+}
+
 static struct pci_driver ppb_driver = {
 	.name		= "pci-bridge",
 	.id_table	= ppb_id_tbl,
 	.probe		= ppb_probe,
 	.remove		= ppb_remove,
+	.suspend	= ppb_suspend,
+	.resume		= ppb_resume,
 };
 
 static int __init ppb_init(void)



                 reply	other threads:[~2005-07-14  9:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1121331359.3398.97.camel@localhost.localdomain \
    --to=abelay@novell.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox