aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 46517b61b3a2..0ae3de76833b 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -935,6 +935,50 @@ int devfreq_resume_device(struct devfreq *devfreq)
935EXPORT_SYMBOL(devfreq_resume_device); 935EXPORT_SYMBOL(devfreq_resume_device);
936 936
937/** 937/**
938 * devfreq_suspend() - Suspend devfreq governors and devices
939 *
940 * Called during system wide Suspend/Hibernate cycles for suspending governors
941 * and devices preserving the state for resume. On some platforms the devfreq
942 * device must have precise state (frequency) after resume in order to provide
943 * fully operating setup.
944 */
945void devfreq_suspend(void)
946{
947 struct devfreq *devfreq;
948 int ret;
949
950 mutex_lock(&devfreq_list_lock);
951 list_for_each_entry(devfreq, &devfreq_list, node) {
952 ret = devfreq_suspend_device(devfreq);
953 if (ret)
954 dev_err(&devfreq->dev,
955 "failed to suspend devfreq device\n");
956 }
957 mutex_unlock(&devfreq_list_lock);
958}
959
960/**
961 * devfreq_resume() - Resume devfreq governors and devices
962 *
963 * Called during system wide Suspend/Hibernate cycle for resuming governors and
964 * devices that are suspended with devfreq_suspend().
965 */
966void devfreq_resume(void)
967{
968 struct devfreq *devfreq;
969 int ret;
970
971 mutex_lock(&devfreq_list_lock);
972 list_for_each_entry(devfreq, &devfreq_list, node) {
973 ret = devfreq_resume_device(devfreq);
974 if (ret)
975 dev_warn(&devfreq->dev,
976 "failed to resume devfreq device\n");
977 }
978 mutex_unlock(&devfreq_list_lock);
979}
980
981/**
938 * devfreq_add_governor() - Add devfreq governor 982 * devfreq_add_governor() - Add devfreq governor
939 * @governor: the devfreq governor to be added 983 * @governor: the devfreq governor to be added
940 */ 984 */