aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujit Reddy Thumma <sthumma@codeaurora.org>2013-01-03 22:28:39 +0530
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2014-05-06 17:48:43 -0700
commit0b5f5a7672bad07e2607ce2dfa159f9a47cb4be6 (patch)
tree9191e7e0ae947fd990a6df8f604ef3035d6f044e
parent3137b1afef92f9425a2547fa6e4f6cd9767f094f (diff)
ata: ahci_platform: Enable runtime power management
Provide runtime power management callbacks for AHCI device. The runtime power management will be disabled by default due to regressions in hot plug functionality, but userspace can enable it by echo'ing into following sysfs entry: echo auto > /sys/devices/platform/ahci.X/power/control Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> (cherry picked from commit db4b5d055809f80b8ac8fc312aaab12613f08460) Change-Id: I3452efce0e447e5ad07a9c1ecb56b5c9b4111597 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
-rw-r--r--drivers/ata/ahci_platform.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 427207d5f6d2..95d879ab0f74 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -21,6 +21,7 @@
#include <linux/platform_device.h>
#include <linux/libata.h>
#include <linux/ahci_platform.h>
+#include <linux/pm_runtime.h>
#include "ahci.h"
enum ahci_type {
@@ -192,6 +193,14 @@ static int __devinit ahci_probe(struct platform_device *pdev)
if (rc)
goto err0;
+ rc = pm_runtime_set_active(dev);
+ if (rc) {
+ dev_warn(dev, "Unable to set runtime pm active err=%d\n", rc);
+ } else {
+ pm_runtime_enable(dev);
+ pm_runtime_forbid(dev);
+ }
+
return 0;
err0:
if (pdata && pdata->exit)
@@ -275,6 +284,8 @@ static int ahci_resume(struct device *dev)
static struct dev_pm_ops ahci_pm_ops = {
.suspend = &ahci_suspend,
.resume = &ahci_resume,
+ .runtime_suspend = &ahci_suspend,
+ .runtime_resume = &ahci_resume,
};
#endif