From f471a72bd63710b7491a7695fc4913b23b0520b0 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 11 Jul 2014 10:02:06 +0900 Subject: [PATCH] pm_qos: Add PM_QOS_BUS_FREQUENCY pm_qos to guarantee required memory bus frequency This patch add PM_QOS_BUS_FREQUENCY pm_qos to guarantee required memory bus frequency. Signed-off-by: Chanwoo Choi --- include/linux/pm_qos.h | 6 ++++++ kernel/power/qos.c | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 5a95013..caa4e98 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -15,6 +15,7 @@ enum { PM_QOS_CPU_DMA_LATENCY, PM_QOS_NETWORK_LATENCY, PM_QOS_NETWORK_THROUGHPUT, + PM_QOS_BUS_FREQUENCY, /* insert new class ID */ PM_QOS_NUM_CLASSES, @@ -34,6 +35,11 @@ enum pm_qos_flags_status { #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 +#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 +#define PM_QOS_BUS_FREQUENCY_MAX_VALUE 400000 +#define PM_QOS_BUS_FREQUENCY_MIN_VALUE 100000 +#define PM_QOS_BUS_FREQUENCY_DEFAULT_VALUE PM_QOS_BUS_FREQUENCY_MIN_VALUE + #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) #define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1) diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 25cf89b..789e69f 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -100,12 +100,25 @@ static struct pm_qos_object network_throughput_pm_qos = { .name = "network_throughput", }; +static BLOCKING_NOTIFIER_HEAD(bus_frequency_notifier); +static struct pm_qos_constraints bus_frequency_constraints = { + .list = PLIST_HEAD_INIT(bus_frequency_constraints.list), + .target_value = PM_QOS_BUS_FREQUENCY_DEFAULT_VALUE, + .default_value = PM_QOS_BUS_FREQUENCY_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &bus_frequency_notifier, +}; +static struct pm_qos_object bus_frequency_pm_qos = { + .constraints = &bus_frequency_constraints, + .name = "bus_frequency", +}; static struct pm_qos_object *pm_qos_array[] = { &null_pm_qos, &cpu_dma_pm_qos, &network_lat_pm_qos, - &network_throughput_pm_qos + &network_throughput_pm_qos, + &bus_frequency_pm_qos, }; static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, -- 2.7.4