aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/devfreq.h
diff options
context:
space:
mode:
authorJonghwa Lee <jonghwa3.lee@samsung.com>2012-08-23 07:00:46 -0400
committerMyungJoo Ham <myungjoo.ham@samsung.com>2012-11-20 02:05:44 -0500
commite552bbaf5b987f57c43e6981a452b8a3c700b1ae (patch)
treed48111ab3d5c71ea4ed9e8ae3cb7bfb32b06bdec /include/linux/devfreq.h
parentd287de855f97c56ca7146ff627e652bd7cd64f3f (diff)
PM / devfreq: Add sysfs node for representing frequency transition information.
This patch adds sysfs node which can be used to get information of frequency transition. It represents transition table which contains total number of transition of each freqeuncy state and time spent. It is inspired CPUFREQ's status driver. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> [Added Documentation/ABI entry, updated kernel-doc, and resolved merge conflict] Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r--include/linux/devfreq.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 1461fb2355ad..bc35c4aee6a3 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -73,6 +73,8 @@ struct devfreq_dev_status {
73 * from devfreq_remove_device() call. If the user 73 * from devfreq_remove_device() call. If the user
74 * has registered devfreq->nb at a notifier-head, 74 * has registered devfreq->nb at a notifier-head,
75 * this is the time to unregister it. 75 * this is the time to unregister it.
76 * @freq_table: Optional list of frequencies to support statistics.
77 * @max_state: The size of freq_table.
76 */ 78 */
77struct devfreq_dev_profile { 79struct devfreq_dev_profile {
78 unsigned long initial_freq; 80 unsigned long initial_freq;
@@ -83,6 +85,9 @@ struct devfreq_dev_profile {
83 struct devfreq_dev_status *stat); 85 struct devfreq_dev_status *stat);
84 int (*get_cur_freq)(struct device *dev, unsigned long *freq); 86 int (*get_cur_freq)(struct device *dev, unsigned long *freq);
85 void (*exit)(struct device *dev); 87 void (*exit)(struct device *dev);
88
89 unsigned int *freq_table;
90 unsigned int max_state;
86}; 91};
87 92
88/** 93/**
@@ -127,6 +132,10 @@ struct devfreq_governor {
127 * @min_freq: Limit minimum frequency requested by user (0: none) 132 * @min_freq: Limit minimum frequency requested by user (0: none)
128 * @max_freq: Limit maximum frequency requested by user (0: none) 133 * @max_freq: Limit maximum frequency requested by user (0: none)
129 * @stop_polling: devfreq polling status of a device. 134 * @stop_polling: devfreq polling status of a device.
135 * @total_trans: Number of devfreq transitions
136 * @trans_table: Statistics of devfreq transitions
137 * @time_in_state: Statistics of devfreq states
138 * @last_stat_updated: The last time stat updated
130 * 139 *
131 * This structure stores the devfreq information for a give device. 140 * This structure stores the devfreq information for a give device.
132 * 141 *
@@ -153,6 +162,12 @@ struct devfreq {
153 unsigned long min_freq; 162 unsigned long min_freq;
154 unsigned long max_freq; 163 unsigned long max_freq;
155 bool stop_polling; 164 bool stop_polling;
165
166 /* information for device freqeuncy transition */
167 unsigned int total_trans;
168 unsigned int *trans_table;
169 unsigned long *time_in_state;
170 unsigned long last_stat_updated;
156}; 171};
157 172
158#if defined(CONFIG_PM_DEVFREQ) 173#if defined(CONFIG_PM_DEVFREQ)