PM QoS: Add EMC freq min/max as PM QoS params
Jinyoung Park [Tue, 20 Aug 2013 07:39:25 +0000 (16:39 +0900)]
Added EMC frequency min/max as PM QoS parameters.

Bug 1346293

Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/263783
(cherry picked from commit bdb8424de563a01dd37e53486c2297b4aa183cc7)

Change-Id: Ib9eb6977edd56420d8518231d06749b2fbf5c34c
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/301036
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>

include/linux/pm_qos.h
kernel/power/qos.c

index dd93655..14185c4 100644 (file)
@@ -19,6 +19,8 @@ enum {
        PM_QOS_MAX_ONLINE_CPUS,
        PM_QOS_CPU_FREQ_MIN,
        PM_QOS_CPU_FREQ_MAX,
+       PM_QOS_EMC_FREQ_MIN,
+       PM_QOS_EMC_FREQ_MAX,
 
        /* insert new class ID */
 
@@ -34,6 +36,8 @@ enum {
 #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
+#define PM_QOS_EMC_FREQ_MIN_DEFAULT_VALUE      0
+#define PM_QOS_EMC_FREQ_MAX_DEFAULT_VALUE      (LONG_MAX / 1000L)
 #define PM_QOS_DEV_LAT_DEFAULT_VALUE           0
 
 struct pm_qos_request {
index 6c2c522..71aa61b 100644 (file)
@@ -158,6 +158,34 @@ static struct pm_qos_object cpu_freq_max_pm_qos = {
 };
 
 
+static BLOCKING_NOTIFIER_HEAD(emc_freq_min_notifier);
+static struct pm_qos_constraints emc_freq_min_constraints = {
+       .list = PLIST_HEAD_INIT(emc_freq_min_constraints.list),
+       .target_value = PM_QOS_EMC_FREQ_MIN_DEFAULT_VALUE,
+       .default_value = PM_QOS_EMC_FREQ_MIN_DEFAULT_VALUE,
+       .type = PM_QOS_MAX,
+       .notifiers = &emc_freq_min_notifier,
+};
+static struct pm_qos_object emc_freq_min_pm_qos = {
+       .constraints = &emc_freq_min_constraints,
+       .name = "emc_freq_min",
+};
+
+
+static BLOCKING_NOTIFIER_HEAD(emc_freq_max_notifier);
+static struct pm_qos_constraints emc_freq_max_constraints = {
+       .list = PLIST_HEAD_INIT(emc_freq_max_constraints.list),
+       .target_value = PM_QOS_EMC_FREQ_MAX_DEFAULT_VALUE,
+       .default_value = PM_QOS_EMC_FREQ_MAX_DEFAULT_VALUE,
+       .type = PM_QOS_MIN,
+       .notifiers = &emc_freq_max_notifier,
+};
+static struct pm_qos_object emc_freq_max_pm_qos = {
+       .constraints = &emc_freq_max_constraints,
+       .name = "emc_freq_max",
+};
+
+
 static struct pm_qos_object *pm_qos_array[] = {
        &null_pm_qos,
        &cpu_dma_pm_qos,
@@ -166,7 +194,9 @@ static struct pm_qos_object *pm_qos_array[] = {
        &min_online_cpus_pm_qos,
        &max_online_cpus_pm_qos,
        &cpu_freq_min_pm_qos,
-       &cpu_freq_max_pm_qos
+       &cpu_freq_max_pm_qos,
+       &emc_freq_min_pm_qos,
+       &emc_freq_max_pm_qos
 };
 
 static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,