linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI patches for 2.6.10
Date: Mon, 10 Jan 2005 09:20:58 -0800	[thread overview]
Message-ID: <11053776581385@kroah.com> (raw)
In-Reply-To: <11053776582977@kroah.com>

ChangeSet 1.1938.447.11, 2004/12/17 14:03:28-08:00, pavel@ucw.cz

[PATCH] PCI: add pci_choose_state()

Could this go to "after 2.6.10 tree", too? It is a helper that
converts system state into PCI state. We really do not want to have
this copied into every driver, because it will need to change when
system state gets type-checked / expanded to struct.


From: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/pci.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+)


diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c	2005-01-10 09:01:09 -08:00
+++ b/drivers/pci/pci.c	2005-01-10 09:01:09 -08:00
@@ -306,6 +306,30 @@
 }
 
 /**
+ * pci_choose_state - Choose the power state of a PCI device
+ * @dev: PCI device to be suspended
+ * @state: target sleep state for the whole system
+ *
+ * Returns PCI power state suitable for given device and given system
+ * message.
+ */
+
+pci_power_t pci_choose_state(struct pci_dev *dev, u32 state)
+{
+	if (!pci_find_capability(dev, PCI_CAP_ID_PM))
+		return PCI_D0;
+
+	switch (state) {
+	case 0:	return PCI_D0;
+	case 2: return PCI_D2;
+	case 3: return PCI_D3hot;
+	default: BUG();
+	}
+}
+
+EXPORT_SYMBOL(pci_choose_state);
+
+/**
  * pci_save_state - save the PCI configuration space of a device before suspending
  * @dev: - PCI device that we're dealing with
  * @buffer: - buffer to hold config space context


  reply	other threads:[~2005-01-11  4:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 17:18 [BK PATCH] PCI patches for 2.6.10-rc2 Greg KH
2005-01-10 17:19 ` Greg KH
2005-01-10 17:20 ` [PATCH] PCI patches for 2.6.10 Greg KH
2005-01-10 17:20   ` Greg KH
2005-01-10 17:20     ` Greg KH
2005-01-10 17:20       ` Greg KH
2005-01-10 17:20         ` Greg KH
2005-01-10 17:20           ` Greg KH
2005-01-10 17:20             ` Greg KH
2005-01-10 17:20               ` Greg KH
2005-01-10 17:20                 ` Greg KH
2005-01-10 17:20                   ` Greg KH
2005-01-10 17:20                     ` Greg KH
2005-01-10 17:20                       ` Greg KH
2005-01-10 17:20                         ` Greg KH
2005-01-10 17:20                           ` Greg KH
2005-01-10 17:20                             ` Greg KH
2005-01-10 17:20                               ` Greg KH [this message]
2005-01-10 17:20                                 ` Greg KH
2005-01-10 17:20                                   ` Greg KH
2005-01-10 17:20                                     ` Greg KH
2005-01-10 17:20                                       ` Greg KH
2005-01-10 17:20                                         ` Greg KH
2005-01-10 17:20                                           ` Greg KH
2005-01-10 17:20                                             ` Greg KH
2005-01-10 17:20                                               ` Greg KH
2005-01-11 22:39   ` Matt Mackall
2005-01-11 22:44     ` Greg KH
2005-01-12 13:09       ` Domen Puncer

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=11053776581385@kroah.com \
    --to=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;
as well as URLs for NNTP newsgroup(s).