aboutsummaryrefslogtreecommitdiff
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 {
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);
@@ -124,6 +134,8 @@ struct devfreq_governor {
* touch this.
* @being_removed a flag to mark that this object is being removed in
* order to prevent trying to remove the object multiple times.
+ * @min_freq Limit minimum frequency requested by user (0: none)
+ * @max_freq Limit maximum frequency requested by user (0: none)
*
* This structure stores the devfreq information for a give device.
*
@@ -149,6 +161,9 @@ struct devfreq {
void *data; /* private data for governors */
bool being_removed;
+
+ unsigned long min_freq;
+ unsigned long max_freq;
};
#if defined(CONFIG_PM_DEVFREQ)
@@ -160,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,
@@ -200,18 +215,18 @@ struct devfreq_simple_ondemand_data {
static struct devfreq *devfreq_add_device(struct device *dev,
struct devfreq_dev_profile *profile,
struct devfreq_governor *governor,
- void *data);
+ void *data)
{
return NULL;
}
-static int devfreq_remove_device(struct devfreq *devfreq);
+static int devfreq_remove_device(struct devfreq *devfreq)
{
return 0;
}
static struct opp *devfreq_recommended_opp(struct device *dev,
- unsigned long *freq)
+ unsigned long *freq, u32 flags)
{
return -EINVAL;
}