diff options
| author | Tejun Heo <htejun@gmail.com> | 2006-07-03 03:07:27 -0400 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-07-05 22:16:28 -0400 |
| commit | d2298dca9a2ec8a8ff23e251d8aaab00e9d229f9 (patch) | |
| tree | 988451a6cc7596533d40c0fa3892c75e9aac3912 | |
| parent | 2a41a6108d93a62910d1c36913d83a79b550b40a (diff) | |
[PATCH] sata_sil24: add suspend/sleep support
Add suspend/sleep support.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
| -rw-r--r-- | drivers/scsi/sata_sil24.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index 1850c2e3aa21..2e0f4a4076af 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
| @@ -92,6 +92,7 @@ enum { | |||
| 92 | HOST_CTRL_STOP = (1 << 18), /* latched PCI STOP */ | 92 | HOST_CTRL_STOP = (1 << 18), /* latched PCI STOP */ |
| 93 | HOST_CTRL_DEVSEL = (1 << 19), /* latched PCI DEVSEL */ | 93 | HOST_CTRL_DEVSEL = (1 << 19), /* latched PCI DEVSEL */ |
| 94 | HOST_CTRL_REQ64 = (1 << 20), /* latched PCI REQ64 */ | 94 | HOST_CTRL_REQ64 = (1 << 20), /* latched PCI REQ64 */ |
| 95 | HOST_CTRL_GLOBAL_RST = (1 << 31), /* global reset */ | ||
| 95 | 96 | ||
| 96 | /* | 97 | /* |
| 97 | * Port registers | 98 | * Port registers |
| @@ -338,6 +339,7 @@ static int sil24_port_start(struct ata_port *ap); | |||
| 338 | static void sil24_port_stop(struct ata_port *ap); | 339 | static void sil24_port_stop(struct ata_port *ap); |
| 339 | static void sil24_host_stop(struct ata_host_set *host_set); | 340 | static void sil24_host_stop(struct ata_host_set *host_set); |
| 340 | static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 341 | static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
| 342 | static int sil24_pci_device_resume(struct pci_dev *pdev); | ||
| 341 | 343 | ||
| 342 | static const struct pci_device_id sil24_pci_tbl[] = { | 344 | static const struct pci_device_id sil24_pci_tbl[] = { |
| 343 | { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 }, | 345 | { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 }, |
| @@ -353,6 +355,8 @@ static struct pci_driver sil24_pci_driver = { | |||
| 353 | .id_table = sil24_pci_tbl, | 355 | .id_table = sil24_pci_tbl, |
| 354 | .probe = sil24_init_one, | 356 | .probe = sil24_init_one, |
| 355 | .remove = ata_pci_remove_one, /* safe? */ | 357 | .remove = ata_pci_remove_one, /* safe? */ |
| 358 | .suspend = ata_pci_device_suspend, | ||
| 359 | .resume = sil24_pci_device_resume, | ||
| 356 | }; | 360 | }; |
| 357 | 361 | ||
| 358 | static struct scsi_host_template sil24_sht = { | 362 | static struct scsi_host_template sil24_sht = { |
| @@ -372,6 +376,8 @@ static struct scsi_host_template sil24_sht = { | |||
| 372 | .slave_configure = ata_scsi_slave_config, | 376 | .slave_configure = ata_scsi_slave_config, |
| 373 | .slave_destroy = ata_scsi_slave_destroy, | 377 | .slave_destroy = ata_scsi_slave_destroy, |
| 374 | .bios_param = ata_std_bios_param, | 378 | .bios_param = ata_std_bios_param, |
| 379 | .suspend = ata_scsi_device_suspend, | ||
| 380 | .resume = ata_scsi_device_resume, | ||
| 375 | }; | 381 | }; |
| 376 | 382 | ||
| 377 | static const struct ata_port_operations sil24_ops = { | 383 | static const struct ata_port_operations sil24_ops = { |
| @@ -1179,6 +1185,25 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 1179 | return rc; | 1185 | return rc; |
| 1180 | } | 1186 | } |
| 1181 | 1187 | ||
| 1188 | static int sil24_pci_device_resume(struct pci_dev *pdev) | ||
| 1189 | { | ||
| 1190 | struct ata_host_set *host_set = dev_get_drvdata(&pdev->dev); | ||
| 1191 | struct sil24_host_priv *hpriv = host_set->private_data; | ||
| 1192 | |||
| 1193 | ata_pci_device_do_resume(pdev); | ||
| 1194 | |||
| 1195 | if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) | ||
| 1196 | writel(HOST_CTRL_GLOBAL_RST, hpriv->host_base + HOST_CTRL); | ||
| 1197 | |||
| 1198 | sil24_init_controller(pdev, host_set->n_ports, | ||
| 1199 | host_set->ports[0]->flags, | ||
| 1200 | hpriv->host_base, hpriv->port_base); | ||
| 1201 | |||
| 1202 | ata_host_set_resume(host_set); | ||
| 1203 | |||
| 1204 | return 0; | ||
| 1205 | } | ||
| 1206 | |||
| 1182 | static int __init sil24_init(void) | 1207 | static int __init sil24_init(void) |
| 1183 | { | 1208 | { |
| 1184 | return pci_module_init(&sil24_pci_driver); | 1209 | return pci_module_init(&sil24_pci_driver); |
