aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/devfreq.h
diff options
context:
space:
mode:
authorLukasz Luba <l.luba@partner.samsung.com>2018-12-05 06:05:53 -0500
committerMyungJoo Ham <myungjoo.ham@samsung.com>2018-12-10 21:09:47 -0500
commit83f8ca45afbf041e312909f442128b99657d90b7 (patch)
treed9f1ef6d6749aaaa6963cea58747a8024a24f61e /include/linux/devfreq.h
parent633141721b5bfce7017033a767208af591134b8f (diff)
PM / devfreq: add support for suspend/resume of a devfreq device
The patch prepares devfreq device for handling suspend/resume functionality. The new fields will store needed information during this process. Devfreq framework handles opp-suspend DT entry and there is no need of modyfications in the drivers code. It uses atomic variables to make sure no race condition affects the process. Suggested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Suggested-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r--include/linux/devfreq.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index e4963b0f45da..d98519996927 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -131,6 +131,9 @@ struct devfreq_dev_profile {
131 * @scaling_min_freq: Limit minimum frequency requested by OPP interface 131 * @scaling_min_freq: Limit minimum frequency requested by OPP interface
132 * @scaling_max_freq: Limit maximum frequency requested by OPP interface 132 * @scaling_max_freq: Limit maximum frequency requested by OPP interface
133 * @stop_polling: devfreq polling status of a device. 133 * @stop_polling: devfreq polling status of a device.
134 * @suspend_freq: frequency of a device set during suspend phase.
135 * @resume_freq: frequency of a device set in resume phase.
136 * @suspend_count: suspend requests counter for a device.
134 * @total_trans: Number of devfreq transitions 137 * @total_trans: Number of devfreq transitions
135 * @trans_table: Statistics of devfreq transitions 138 * @trans_table: Statistics of devfreq transitions
136 * @time_in_state: Statistics of devfreq states 139 * @time_in_state: Statistics of devfreq states
@@ -167,6 +170,10 @@ struct devfreq {
167 unsigned long scaling_max_freq; 170 unsigned long scaling_max_freq;
168 bool stop_polling; 171 bool stop_polling;
169 172
173 unsigned long suspend_freq;
174 unsigned long resume_freq;
175 atomic_t suspend_count;
176
170 /* information for device frequency transition */ 177 /* information for device frequency transition */
171 unsigned int total_trans; 178 unsigned int total_trans;
172 unsigned int *trans_table; 179 unsigned int *trans_table;