aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_fsl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_fsl.c')
-rw-r--r--drivers/ata/sata_fsl.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 36b8629203be..94eaa432c40a 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1378,6 +1378,37 @@ static int sata_fsl_remove(struct of_device *ofdev)
1378 return 0; 1378 return 0;
1379} 1379}
1380 1380
1381#ifdef CONFIG_PM
1382static int sata_fsl_suspend(struct of_device *op, pm_message_t state)
1383{
1384 struct ata_host *host = dev_get_drvdata(&op->dev);
1385 return ata_host_suspend(host, state);
1386}
1387
1388static int sata_fsl_resume(struct of_device *op)
1389{
1390 struct ata_host *host = dev_get_drvdata(&op->dev);
1391 struct sata_fsl_host_priv *host_priv = host->private_data;
1392 int ret;
1393 void __iomem *hcr_base = host_priv->hcr_base;
1394 struct ata_port *ap = host->ports[0];
1395 struct sata_fsl_port_priv *pp = ap->private_data;
1396
1397 ret = sata_fsl_init_controller(host);
1398 if (ret) {
1399 dev_printk(KERN_ERR, &op->dev,
1400 "Error initialize hardware\n");
1401 return ret;
1402 }
1403
1404 /* Recovery the CHBA register in host controller cmd register set */
1405 iowrite32(pp->cmdslot_paddr & 0xffffffff, hcr_base + CHBA);
1406
1407 ata_host_resume(host);
1408 return 0;
1409}
1410#endif
1411
1381static struct of_device_id fsl_sata_match[] = { 1412static struct of_device_id fsl_sata_match[] = {
1382 { 1413 {
1383 .compatible = "fsl,pq-sata", 1414 .compatible = "fsl,pq-sata",
@@ -1392,6 +1423,10 @@ static struct of_platform_driver fsl_sata_driver = {
1392 .match_table = fsl_sata_match, 1423 .match_table = fsl_sata_match,
1393 .probe = sata_fsl_probe, 1424 .probe = sata_fsl_probe,
1394 .remove = sata_fsl_remove, 1425 .remove = sata_fsl_remove,
1426#ifdef CONFIG_PM
1427 .suspend = sata_fsl_suspend,
1428 .resume = sata_fsl_resume,
1429#endif
1395}; 1430};
1396 1431
1397static int __init sata_fsl_init(void) 1432static int __init sata_fsl_init(void)