From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, lkml@rtr.ca, axboe@suse.de,
forrest.zhao@intel.com, alan@lxorguk.ukuu.org.uk,
linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 15/15] sata_sil24: add suspend/sleep support
Date: Sat, 24 Jun 2006 20:30:20 +0900 [thread overview]
Message-ID: <1151148620574-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11511486183271-git-send-email-htejun@gmail.com>
Add suspend/sleep support.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/scsi/sata_sil24.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
19356e72ec5b323cda9af3b8183400f096f78ba4
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 7726e6e..49f992f 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -92,6 +92,7 @@ enum {
HOST_CTRL_STOP = (1 << 18), /* latched PCI STOP */
HOST_CTRL_DEVSEL = (1 << 19), /* latched PCI DEVSEL */
HOST_CTRL_REQ64 = (1 << 20), /* latched PCI REQ64 */
+ HOST_CTRL_GLOBAL_RST = (1 << 31), /* global reset */
/*
* Port registers
@@ -338,6 +339,7 @@ static int sil24_port_start(struct ata_p
static void sil24_port_stop(struct ata_port *ap);
static void sil24_host_stop(struct ata_host_set *host_set);
static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
+static int sil24_pci_device_resume(struct pci_dev *pdev);
static const struct pci_device_id sil24_pci_tbl[] = {
{ 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 },
@@ -353,6 +355,8 @@ static struct pci_driver sil24_pci_drive
.id_table = sil24_pci_tbl,
.probe = sil24_init_one,
.remove = ata_pci_remove_one, /* safe? */
+ .suspend = ata_pci_device_suspend,
+ .resume = sil24_pci_device_resume,
};
static struct scsi_host_template sil24_sht = {
@@ -372,6 +376,8 @@ static struct scsi_host_template sil24_s
.slave_configure = ata_scsi_slave_config,
.slave_destroy = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
+ .suspend = ata_scsi_device_suspend,
+ .resume = ata_scsi_device_resume,
};
static const struct ata_port_operations sil24_ops = {
@@ -1179,6 +1185,25 @@ static int sil24_init_one(struct pci_dev
return rc;
}
+static int sil24_pci_device_resume(struct pci_dev *pdev)
+{
+ struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev);
+ struct sil24_host_priv *hpriv = host_set->private_data;
+
+ ata_pci_device_do_resume(pdev);
+
+ if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND)
+ writel(HOST_CTRL_GLOBAL_RST, hpriv->host_base + HOST_CTRL);
+
+ sil24_init_controller(pdev, host_set->n_ports,
+ host_set->ports[0]->flags,
+ hpriv->host_base, hpriv->port_base);
+
+ ata_host_set_resume(host_set);
+
+ return 0;
+}
+
static int __init sil24_init(void)
{
return pci_module_init(&sil24_pci_driver);
--
1.3.2
next prev parent reply other threads:[~2006-06-24 11:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-24 11:30 [PATCHSET] [PATCHSET] new Power Management for libata, take 2 Tejun Heo
2006-06-24 11:30 ` [PATCH 02/15] libata: implement and use ata_deh_dev_action() Tejun Heo
2006-06-24 11:30 ` [PATCH 01/15] libata: move ata_eh_clear_action() upward Tejun Heo
2006-06-27 1:00 ` Jeff Garzik
2006-06-24 11:30 ` [PATCH 04/15] libata: move ata_do_simple_cmd() below ata_exec_internal() Tejun Heo
2006-06-24 11:30 ` [PATCH 08/15] libata: implement PM EH actions Tejun Heo
2006-06-24 11:30 ` [PATCH 03/15] libata: clear EH action on device detach Tejun Heo
2006-06-24 11:30 ` [PATCH 07/15] libata: implement ata_port_max_devices() Tejun Heo
2006-06-24 11:30 ` [PATCH 09/15] libata: reimplement per-dev PM Tejun Heo
2006-06-24 11:30 ` [PATCH 06/15] libata: make two functions global Tejun Heo
2006-06-24 11:30 ` [PATCH 05/15] libata: update ata_do_simple_cmd() Tejun Heo
2006-06-24 11:30 ` [PATCH 13/15] sata_sil: add suspend/sleep support Tejun Heo
2006-06-24 11:30 ` Tejun Heo [this message]
2006-06-24 11:30 ` [PATCH 11/15] libata: reimplement controller-wide PM Tejun Heo
2006-06-26 6:36 ` zhao, forrest
2006-06-26 6:53 ` Tejun Heo
2006-06-24 11:30 ` [PATCH 14/15] sata_sil24: separate out sil24_init_controller() Tejun Heo
2006-06-24 11:30 ` [PATCH 10/15] libata: move ata_flush_cache() from libata-core.c to libata-eh.c Tejun Heo
2006-06-24 11:30 ` [PATCH 12/15] sata_sil: separate out sil_init_controller() Tejun Heo
2006-06-24 11:36 ` [git-patch] new Power Management for libata, take 2 Tejun Heo
2006-06-26 6:42 ` [PATCHSET] [PATCHSET] " zhao, forrest
2006-06-26 6:58 ` Tejun Heo
2006-06-26 6:49 ` zhao, forrest
2006-06-26 7:11 ` Tejun Heo
2006-06-26 7:09 ` zhao, forrest
2006-06-26 8:17 ` Tejun Heo
2006-06-26 7:20 ` Jeff Garzik
2006-06-26 8:15 ` Tejun Heo
2006-06-26 8:09 ` zhao, forrest
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=1151148620574-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=axboe@suse.de \
--cc=forrest.zhao@intel.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=lkml@rtr.ca \
/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).