aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
authorRajagopal Venkat <rajagopal.venkat@linaro.org>2012-10-25 19:50:18 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-14 18:35:04 -0500
commit206c30cfeb7c05dfb9fdfd81b1deb933627e43c1 (patch)
tree0cc26302a81b78cf7d790e0483d2734753cf3d04 /drivers/devfreq/devfreq.c
parent7e6fdd4bad033fa2d73716377b184fa975b0d985 (diff)
PM / devfreq: Add suspend and resume apis
Add devfreq suspend/resume apis for devfreq users. This patch supports suspend and resume of devfreq load monitoring, required for devices which can idle. Signed-off-by: Rajagopal Venkat <rajagopal.venkat@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 1aaf1aeb1f1d..999600da21c7 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -427,6 +427,34 @@ int devfreq_remove_device(struct devfreq *devfreq)
427} 427}
428EXPORT_SYMBOL(devfreq_remove_device); 428EXPORT_SYMBOL(devfreq_remove_device);
429 429
430/**
431 * devfreq_suspend_device() - Suspend devfreq of a device.
432 * @devfreq: the devfreq instance to be suspended
433 */
434int devfreq_suspend_device(struct devfreq *devfreq)
435{
436 if (!devfreq)
437 return -EINVAL;
438
439 return devfreq->governor->event_handler(devfreq,
440 DEVFREQ_GOV_SUSPEND, NULL);
441}
442EXPORT_SYMBOL(devfreq_suspend_device);
443
444/**
445 * devfreq_resume_device() - Resume devfreq of a device.
446 * @devfreq: the devfreq instance to be resumed
447 */
448int devfreq_resume_device(struct devfreq *devfreq)
449{
450 if (!devfreq)
451 return -EINVAL;
452
453 return devfreq->governor->event_handler(devfreq,
454 DEVFREQ_GOV_RESUME, NULL);
455}
456EXPORT_SYMBOL(devfreq_resume_device);
457
430static ssize_t show_governor(struct device *dev, 458static ssize_t show_governor(struct device *dev,
431 struct device_attribute *attr, char *buf) 459 struct device_attribute *attr, char *buf)
432{ 460{