aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_rcar.c
diff options
context:
space:
mode:
authorMikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>2015-01-16 18:00:36 -0500
committerTejun Heo <tj@kernel.org>2015-01-19 09:04:37 -0500
commit5bc27ef72719acb1cf745f16ce5583b57ea660aa (patch)
treee79a551c7845b8ad8aa7728fdac62e68cf7d5299 /drivers/ata/sata_rcar.c
parent2de5a9c004e92aaf49b800e60820f7a030d42eb9 (diff)
sata_rcar: extend PM methods
In order to make it possible to restore from hibernation not only in Linux but also in e.g. U-Boot, we have to extend sata_rcar_{suspend|resume}() to {freeze| thaw}() PM methods and implement the restore() PM method. Signed-off-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> [Sergei: killed unused variable, changed the order of initializers, modified copyrights, renamed, modified changelog.] Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/sata_rcar.c')
-rw-r--r--drivers/ata/sata_rcar.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index cb0d2e644af5..d49a5193b7de 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -2,8 +2,8 @@
2 * Renesas R-Car SATA driver 2 * Renesas R-Car SATA driver
3 * 3 *
4 * Author: Vladimir Barinov <source@cogentembedded.com> 4 * Author: Vladimir Barinov <source@cogentembedded.com>
5 * Copyright (C) 2013 Cogent Embedded, Inc. 5 * Copyright (C) 2013-2015 Cogent Embedded, Inc.
6 * Copyright (C) 2013 Renesas Solutions Corp. 6 * Copyright (C) 2013-2015 Renesas Solutions Corp.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -992,9 +992,30 @@ static int sata_rcar_resume(struct device *dev)
992 return 0; 992 return 0;
993} 993}
994 994
995static int sata_rcar_restore(struct device *dev)
996{
997 struct ata_host *host = dev_get_drvdata(dev);
998 struct sata_rcar_priv *priv = host->private_data;
999
1000 clk_prepare_enable(priv->clk);
1001
1002 sata_rcar_setup_port(host);
1003
1004 /* initialize host controller */
1005 sata_rcar_init_controller(host);
1006
1007 ata_host_resume(host);
1008
1009 return 0;
1010}
1011
995static const struct dev_pm_ops sata_rcar_pm_ops = { 1012static const struct dev_pm_ops sata_rcar_pm_ops = {
996 .suspend = sata_rcar_suspend, 1013 .suspend = sata_rcar_suspend,
997 .resume = sata_rcar_resume, 1014 .resume = sata_rcar_resume,
1015 .freeze = sata_rcar_suspend,
1016 .thaw = sata_rcar_resume,
1017 .poweroff = sata_rcar_suspend,
1018 .restore = sata_rcar_restore,
998}; 1019};
999#endif 1020#endif
1000 1021