diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2012-03-16 21:54:53 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-03-17 21:51:34 +0100 |
commit | ab5f299f51259fd2466cf35c89d79bd960e0fc32 (patch) | |
tree | 2c8b409511e48e04833b57457acdb98207201b0b /include/linux/devfreq.h | |
parent | e4c9d8efe6bdc844071d68960dfa2003c5cf6449 (diff) |
PM / devfreq: add relation of recommended frequency.
The semantics of "target frequency" given to devfreq driver from
devfreq framework has always been interpretted as "at least" or GLB
(greatest lower bound). However, the framework might want the
device driver to limit its max frequency (LUB: least upper bound),
especially if it is given by thermal framework (it's too hot).
Thus, the target fuction should have another parameter to express
whether the framework wants GLB or LUB. And, the additional parameter,
"u32 flags", does it.
With the update, devfreq_recommended_opp() is also updated.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r-- | include/linux/devfreq.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 5862475d05f..281c72a3b9d 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -44,6 +44,14 @@ struct devfreq_dev_status { void *private_data; }; +/* + * The resulting frequency should be at most this. (this bound is the + * least upper bound; thus, the resulting freq should be lower or same) + * If the flag is not set, the resulting frequency should be at most the + * bound (greatest lower bound) + */ +#define DEVFREQ_FLAG_LEAST_UPPER_BOUND 0x1 + /** * struct devfreq_dev_profile - Devfreq's user device profile * @initial_freq The operating frequency when devfreq_add_device() is @@ -54,6 +62,8 @@ struct devfreq_dev_status { * higher than any operable frequency, set maximum. * Before returning, target function should set * freq at the current frequency. + * The "flags" parameter's possible values are + * explained above with "DEVFREQ_FLAG_*" macros. * @get_dev_status The device should provide the current performance * status to devfreq, which is used by governors. * @exit An optional callback that is called when devfreq @@ -66,7 +76,7 @@ struct devfreq_dev_profile { unsigned long initial_freq; unsigned int polling_ms; - int (*target)(struct device *dev, unsigned long *freq); + int (*target)(struct device *dev, unsigned long *freq, u32 flags); int (*get_dev_status)(struct device *dev, struct devfreq_dev_status *stat); void (*exit)(struct device *dev); @@ -165,7 +175,7 @@ extern int devfreq_remove_device(struct devfreq *devfreq); /* Helper functions for devfreq user device driver with OPP. */ extern struct opp *devfreq_recommended_opp(struct device *dev, - unsigned long *freq); + unsigned long *freq, u32 flags); extern int devfreq_register_opp_notifier(struct device *dev, struct devfreq *devfreq); extern int devfreq_unregister_opp_notifier(struct device *dev, @@ -216,7 +226,7 @@ static int devfreq_remove_device(struct devfreq *devfreq) } static struct opp *devfreq_recommended_opp(struct device *dev, - unsigned long *freq) + unsigned long *freq, u32 flags) { return -EINVAL; } |