diff options
-rw-r--r-- | include/linux/pm_qos_params.h | 4 | ||||
-rw-r--r-- | kernel/pm_qos_params.c | 26 |
2 files changed, 29 insertions, 1 deletions
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h index eee55bc0b667..5750527666e3 100644 --- a/include/linux/pm_qos_params.h +++ b/include/linux/pm_qos_params.h @@ -14,6 +14,8 @@ enum { PM_QOS_NETWORK_LATENCY, PM_QOS_NETWORK_THROUGHPUT, PM_QOS_MAX_ONLINE_CPUS, + PM_QOS_CPU_FREQ_MIN, + PM_QOS_CPU_FREQ_MAX, /* insert new class ID */ @@ -26,6 +28,8 @@ enum { #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE LONG_MAX +#define PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE 0 +#define PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE LONG_MAX struct pm_qos_request_list { struct plist_node list; diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index 06e74202a8b9..f798df9b2b0d 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c @@ -114,12 +114,36 @@ static struct pm_qos_object max_online_cpus_pm_qos = { }; +static BLOCKING_NOTIFIER_HEAD(cpu_freq_min_notifier); +static struct pm_qos_object cpu_freq_min_pm_qos = { + .requests = PLIST_HEAD_INIT(cpu_freq_min_pm_qos.requests, pm_qos_lock), + .notifiers = &cpu_freq_min_notifier, + .name = "cpu_freq_min", + .target_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE, + .default_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE, + .type = PM_QOS_MAX, +}; + + +static BLOCKING_NOTIFIER_HEAD(cpu_freq_max_notifier); +static struct pm_qos_object cpu_freq_max_pm_qos = { + .requests = PLIST_HEAD_INIT(cpu_freq_max_pm_qos.requests, pm_qos_lock), + .notifiers = &cpu_freq_max_notifier, + .name = "cpu_freq_max", + .target_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE, + .default_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE, + .type = PM_QOS_MIN, +}; + + static struct pm_qos_object *pm_qos_array[] = { &null_pm_qos, &cpu_dma_pm_qos, &network_lat_pm_qos, &network_throughput_pm_qos, - &max_online_cpus_pm_qos + &max_online_cpus_pm_qos, + &cpu_freq_min_pm_qos, + &cpu_freq_max_pm_qos }; static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, |