From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: "John Lee (Jung-Ik)" <jilee@google.com>
Cc: Grant Grundler <grundler@google.com>,
Gwendal Gringo <gwendal@google.com>,
Jeff Garzik <jgarzik@redhat.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] pata_atp867x: add Power Management support
Date: Sun, 20 Sep 2009 23:05:10 +0200 [thread overview]
Message-ID: <200909202305.10118.bzolnier@gmail.com> (raw)
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pata_atp867x: add Power Management support
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
needs testing with the real hardware
drivers/ata/pata_atp867x.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
Index: b/drivers/ata/pata_atp867x.c
===================================================================
--- a/drivers/ata/pata_atp867x.c
+++ b/drivers/ata/pata_atp867x.c
@@ -507,6 +507,23 @@ err_out:
return rc;
}
+#ifdef CONFIG_PM
+static int atp867x_reinit_one(struct pci_dev *pdev)
+{
+ struct ata_host *host = dev_get_drvdata(&pdev->dev);
+ int rc;
+
+ rc = ata_pci_device_do_resume(pdev);
+ if (rc)
+ return rc;
+
+ atp867x_fixup(host);
+
+ ata_host_resume(host);
+ return 0;
+}
+#endif
+
static struct pci_device_id atp867x_pci_tbl[] = {
{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP867A), 0 },
{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP867B), 0 },
@@ -518,6 +535,10 @@ static struct pci_driver atp867x_driver
.id_table = atp867x_pci_tbl,
.probe = atp867x_init_one,
.remove = ata_pci_remove_one,
+#ifdef CONFIG_PM
+ .suspend = ata_pci_device_suspend,
+ .resume = atp867x_reinit_one,
+#endif
};
static int __init atp867x_init(void)
reply other threads:[~2009-09-20 21: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=200909202305.10118.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=grundler@google.com \
--cc=gwendal@google.com \
--cc=jgarzik@redhat.com \
--cc=jilee@google.com \
--cc=linux-ide@vger.kernel.org \
--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).