aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/devfreq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r--include/linux/devfreq.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 98ce8124b1cc..281c72a3b9d5 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -44,6 +44,14 @@ struct devfreq_dev_status {
44 void *private_data; 44 void *private_data;
45}; 45};
46 46
47/*
48 * The resulting frequency should be at most this. (this bound is the
49 * least upper bound; thus, the resulting freq should be lower or same)
50 * If the flag is not set, the resulting frequency should be at most the
51 * bound (greatest lower bound)
52 */
53#define DEVFREQ_FLAG_LEAST_UPPER_BOUND 0x1
54
47/** 55/**
48 * struct devfreq_dev_profile - Devfreq's user device profile 56 * struct devfreq_dev_profile - Devfreq's user device profile
49 * @initial_freq The operating frequency when devfreq_add_device() is 57 * @initial_freq The operating frequency when devfreq_add_device() is
@@ -54,6 +62,8 @@ struct devfreq_dev_status {
54 * higher than any operable frequency, set maximum. 62 * higher than any operable frequency, set maximum.
55 * Before returning, target function should set 63 * Before returning, target function should set
56 * freq at the current frequency. 64 * freq at the current frequency.
65 * The "flags" parameter's possible values are
66 * explained above with "DEVFREQ_FLAG_*" macros.
57 * @get_dev_status The device should provide the current performance 67 * @get_dev_status The device should provide the current performance
58 * status to devfreq, which is used by governors. 68 * status to devfreq, which is used by governors.
59 * @exit An optional callback that is called when devfreq 69 * @exit An optional callback that is called when devfreq
@@ -66,7 +76,7 @@ struct devfreq_dev_profile {
66 unsigned long initial_freq; 76 unsigned long initial_freq;
67 unsigned int polling_ms; 77 unsigned int polling_ms;
68 78
69 int (*target)(struct device *dev, unsigned long *freq); 79 int (*target)(struct device *dev, unsigned long *freq, u32 flags);
70 int (*get_dev_status)(struct device *dev, 80 int (*get_dev_status)(struct device *dev,
71 struct devfreq_dev_status *stat); 81 struct devfreq_dev_status *stat);
72 void (*exit)(struct device *dev); 82 void (*exit)(struct device *dev);
@@ -124,6 +134,8 @@ struct devfreq_governor {
124 * touch this. 134 * touch this.
125 * @being_removed a flag to mark that this object is being removed in 135 * @being_removed a flag to mark that this object is being removed in
126 * order to prevent trying to remove the object multiple times. 136 * order to prevent trying to remove the object multiple times.
137 * @min_freq Limit minimum frequency requested by user (0: none)
138 * @max_freq Limit maximum frequency requested by user (0: none)
127 * 139 *
128 * This structure stores the devfreq information for a give device. 140 * This structure stores the devfreq information for a give device.
129 * 141 *
@@ -149,6 +161,9 @@ struct devfreq {
149 void *data; /* private data for governors */ 161 void *data; /* private data for governors */
150 162
151 bool being_removed; 163 bool being_removed;
164
165 unsigned long min_freq;
166 unsigned long max_freq;
152}; 167};
153 168
154#if defined(CONFIG_PM_DEVFREQ) 169#if defined(CONFIG_PM_DEVFREQ)
@@ -160,7 +175,7 @@ extern int devfreq_remove_device(struct devfreq *devfreq);
160 175
161/* Helper functions for devfreq user device driver with OPP. */ 176/* Helper functions for devfreq user device driver with OPP. */
162extern struct opp *devfreq_recommended_opp(struct device *dev, 177extern struct opp *devfreq_recommended_opp(struct device *dev,
163 unsigned long *freq); 178 unsigned long *freq, u32 flags);
164extern int devfreq_register_opp_notifier(struct device *dev, 179extern int devfreq_register_opp_notifier(struct device *dev,
165 struct devfreq *devfreq); 180 struct devfreq *devfreq);
166extern int devfreq_unregister_opp_notifier(struct device *dev, 181extern int devfreq_unregister_opp_notifier(struct device *dev,
@@ -200,18 +215,18 @@ struct devfreq_simple_ondemand_data {
200static struct devfreq *devfreq_add_device(struct device *dev, 215static struct devfreq *devfreq_add_device(struct device *dev,
201 struct devfreq_dev_profile *profile, 216 struct devfreq_dev_profile *profile,
202 struct devfreq_governor *governor, 217 struct devfreq_governor *governor,
203 void *data); 218 void *data)
204{ 219{
205 return NULL; 220 return NULL;
206} 221}
207 222
208static int devfreq_remove_device(struct devfreq *devfreq); 223static int devfreq_remove_device(struct devfreq *devfreq)
209{ 224{
210 return 0; 225 return 0;
211} 226}
212 227
213static struct opp *devfreq_recommended_opp(struct device *dev, 228static struct opp *devfreq_recommended_opp(struct device *dev,
214 unsigned long *freq) 229 unsigned long *freq, u32 flags)
215{ 230{
216 return -EINVAL; 231 return -EINVAL;
217} 232}