aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 1539734bbbad..43cc43d7b591 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -219,10 +219,12 @@ static void ahci_thaw(struct ata_port *ap);
219static void ahci_error_handler(struct ata_port *ap); 219static void ahci_error_handler(struct ata_port *ap);
220static void ahci_vt8251_error_handler(struct ata_port *ap); 220static void ahci_vt8251_error_handler(struct ata_port *ap);
221static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); 221static void ahci_post_internal_cmd(struct ata_queued_cmd *qc);
222#ifdef CONFIG_PM
222static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg); 223static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg);
223static int ahci_port_resume(struct ata_port *ap); 224static int ahci_port_resume(struct ata_port *ap);
224static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); 225static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
225static int ahci_pci_device_resume(struct pci_dev *pdev); 226static int ahci_pci_device_resume(struct pci_dev *pdev);
227#endif
226 228
227static struct scsi_host_template ahci_sht = { 229static struct scsi_host_template ahci_sht = {
228 .module = THIS_MODULE, 230 .module = THIS_MODULE,
@@ -241,8 +243,10 @@ static struct scsi_host_template ahci_sht = {
241 .slave_configure = ata_scsi_slave_config, 243 .slave_configure = ata_scsi_slave_config,
242 .slave_destroy = ata_scsi_slave_destroy, 244 .slave_destroy = ata_scsi_slave_destroy,
243 .bios_param = ata_std_bios_param, 245 .bios_param = ata_std_bios_param,
246#ifdef CONFIG_PM
244 .suspend = ata_scsi_device_suspend, 247 .suspend = ata_scsi_device_suspend,
245 .resume = ata_scsi_device_resume, 248 .resume = ata_scsi_device_resume,
249#endif
246}; 250};
247 251
248static const struct ata_port_operations ahci_ops = { 252static const struct ata_port_operations ahci_ops = {
@@ -271,8 +275,10 @@ static const struct ata_port_operations ahci_ops = {
271 .error_handler = ahci_error_handler, 275 .error_handler = ahci_error_handler,
272 .post_internal_cmd = ahci_post_internal_cmd, 276 .post_internal_cmd = ahci_post_internal_cmd,
273 277
278#ifdef CONFIG_PM
274 .port_suspend = ahci_port_suspend, 279 .port_suspend = ahci_port_suspend,
275 .port_resume = ahci_port_resume, 280 .port_resume = ahci_port_resume,
281#endif
276 282
277 .port_start = ahci_port_start, 283 .port_start = ahci_port_start,
278 .port_stop = ahci_port_stop, 284 .port_stop = ahci_port_stop,
@@ -304,8 +310,10 @@ static const struct ata_port_operations ahci_vt8251_ops = {
304 .error_handler = ahci_vt8251_error_handler, 310 .error_handler = ahci_vt8251_error_handler,
305 .post_internal_cmd = ahci_post_internal_cmd, 311 .post_internal_cmd = ahci_post_internal_cmd,
306 312
313#ifdef CONFIG_PM
307 .port_suspend = ahci_port_suspend, 314 .port_suspend = ahci_port_suspend,
308 .port_resume = ahci_port_resume, 315 .port_resume = ahci_port_resume,
316#endif
309 317
310 .port_start = ahci_port_start, 318 .port_start = ahci_port_start,
311 .port_stop = ahci_port_stop, 319 .port_stop = ahci_port_stop,
@@ -436,8 +444,10 @@ static struct pci_driver ahci_pci_driver = {
436 .id_table = ahci_pci_tbl, 444 .id_table = ahci_pci_tbl,
437 .probe = ahci_init_one, 445 .probe = ahci_init_one,
438 .remove = ata_pci_remove_one, 446 .remove = ata_pci_remove_one,
447#ifdef CONFIG_PM
439 .suspend = ahci_pci_device_suspend, 448 .suspend = ahci_pci_device_suspend,
440 .resume = ahci_pci_device_resume, 449 .resume = ahci_pci_device_resume,
450#endif
441}; 451};
442 452
443 453
@@ -577,6 +587,7 @@ static void ahci_power_up(void __iomem *port_mmio, u32 cap)
577 writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD); 587 writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD);
578} 588}
579 589
590#ifdef CONFIG_PM
580static void ahci_power_down(void __iomem *port_mmio, u32 cap) 591static void ahci_power_down(void __iomem *port_mmio, u32 cap)
581{ 592{
582 u32 cmd, scontrol; 593 u32 cmd, scontrol;
@@ -594,6 +605,7 @@ static void ahci_power_down(void __iomem *port_mmio, u32 cap)
594 cmd &= ~PORT_CMD_SPIN_UP; 605 cmd &= ~PORT_CMD_SPIN_UP;
595 writel(cmd, port_mmio + PORT_CMD); 606 writel(cmd, port_mmio + PORT_CMD);
596} 607}
608#endif
597 609
598static void ahci_init_port(void __iomem *port_mmio, u32 cap, 610static void ahci_init_port(void __iomem *port_mmio, u32 cap,
599 dma_addr_t cmd_slot_dma, dma_addr_t rx_fis_dma) 611 dma_addr_t cmd_slot_dma, dma_addr_t rx_fis_dma)
@@ -1335,6 +1347,7 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
1335 } 1347 }
1336} 1348}
1337 1349
1350#ifdef CONFIG_PM
1338static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) 1351static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
1339{ 1352{
1340 struct ahci_host_priv *hpriv = ap->host->private_data; 1353 struct ahci_host_priv *hpriv = ap->host->private_data;
@@ -1413,6 +1426,7 @@ static int ahci_pci_device_resume(struct pci_dev *pdev)
1413 1426
1414 return 0; 1427 return 0;
1415} 1428}
1429#endif
1416 1430
1417static int ahci_port_start(struct ata_port *ap) 1431static int ahci_port_start(struct ata_port *ap)
1418{ 1432{