aboutsummaryrefslogtreecommitdiff
path: root/drivers/devfreq/devfreq_devbw.c
diff options
context:
space:
mode:
authorSaravana Kannan <skannan@codeaurora.org>2014-08-07 19:38:02 -0700
committerSteve Kondik <shade@chemlab.org>2014-10-12 01:56:55 -0700
commit3b903fc99e651cda7f7121bec2f513a142054d49 (patch)
treebdd55096892f3efb00508713d4ccd7996d65a4b3 /drivers/devfreq/devfreq_devbw.c
parent242d353ab4fabcec782d16288a87539ef326949e (diff)
PM / devfreq: governor_bw_hwmon: Add suspend/resume supportkitkat
Some devfreq devices using this governor might need suspend/resume support. When suspended, those devices won't need any bandwidth votes and there is no point in monitoring their bandwidth either. Therefore, upon suspend, vote for zero bandwidth and stop the HW monitor. Upon resume, vote for the previous bandwidth and start the HW monitor. Change-Id: I318449995d714959f0ebfe91961bc23fa8edbd04 Signed-off-by: Saravana Kannan <skannan@codeaurora.org> PM / devfreq: devbw: Add suspend/resume APIs Absence of traffic is guaranteed when the device sitting behind a devbw device is suspended. In such cases, it is a waste of power to make non-zero bandwidth votes or to scale the devbw device. So, provide APIs to suspend/resume the devbw device as needed. Change-Id: Id58072aec7a9710eb917f248d9b9bd08d3a1ec6a Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Diffstat (limited to 'drivers/devfreq/devfreq_devbw.c')
-rw-r--r--drivers/devfreq/devfreq_devbw.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/devfreq/devfreq_devbw.c b/drivers/devfreq/devfreq_devbw.c
index 4f5d850aecc..f01b6908ebb 100644
--- a/drivers/devfreq/devfreq_devbw.c
+++ b/drivers/devfreq/devfreq_devbw.c
@@ -214,11 +214,6 @@ int devfreq_add_devbw(struct device *dev)
return 0;
}
-static int devfreq_devbw_probe(struct platform_device *pdev)
-{
- return devfreq_add_devbw(&pdev->dev);
-}
-
int devfreq_remove_devbw(struct device *dev)
{
struct dev_data *d = dev_get_drvdata(dev);
@@ -227,6 +222,23 @@ int devfreq_remove_devbw(struct device *dev)
return 0;
}
+int devfreq_suspend_devbw(struct device *dev)
+{
+ struct dev_data *d = dev_get_drvdata(dev);
+ return devfreq_suspend_device(d->df);
+}
+
+int devfreq_resume_devbw(struct device *dev)
+{
+ struct dev_data *d = dev_get_drvdata(dev);
+ return devfreq_resume_device(d->df);
+}
+
+static int devfreq_devbw_probe(struct platform_device *pdev)
+{
+ return devfreq_add_devbw(&pdev->dev);
+}
+
static int devfreq_devbw_remove(struct platform_device *pdev)
{
return devfreq_remove_devbw(&pdev->dev);