RK3368 DDR: new ddr change freq method
[firefly-linux-kernel-4.4.55.git] / kernel / power / qos.c
index 25cf89bc659e0d58b9a1b6819698076ea2362d04..0565679b574bb5d4a2e278464cafd3e9259fcb32 100644 (file)
@@ -100,12 +100,43 @@ static struct pm_qos_object network_throughput_pm_qos = {
        .name = "network_throughput",
 };
 
+#ifdef CONFIG_CPUQUIET_FRAMEWORK
+static BLOCKING_NOTIFIER_HEAD(min_online_cpus_notifier);
+static struct pm_qos_constraints min_online_cpus_constraints = {
+       .list = PLIST_HEAD_INIT(min_online_cpus_constraints.list),
+       .target_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE,
+       .default_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE,
+       .type = PM_QOS_MAX,
+       .notifiers = &min_online_cpus_notifier,
+};
+static struct pm_qos_object min_online_cpus_pm_qos = {
+       .constraints = &min_online_cpus_constraints,
+       .name = "min_online_cpus",
+};
+
+static BLOCKING_NOTIFIER_HEAD(max_online_cpus_notifier);
+static struct pm_qos_constraints max_online_cpus_constraints = {
+       .list = PLIST_HEAD_INIT(max_online_cpus_constraints.list),
+       .target_value = PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE,
+       .default_value = PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE,
+       .type = PM_QOS_MIN,
+       .notifiers = &max_online_cpus_notifier,
+};
+static struct pm_qos_object max_online_cpus_pm_qos = {
+       .constraints = &max_online_cpus_constraints,
+       .name = "max_online_cpus",
+};
+#endif
 
 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,
+#ifdef CONFIG_CPUQUIET_FRAMEWORK
+       &min_online_cpus_pm_qos,
+       &max_online_cpus_pm_qos,
+#endif
 };
 
 static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
@@ -369,12 +400,6 @@ void pm_qos_update_request(struct pm_qos_request *req,
        }
 
        cancel_delayed_work_sync(&req->work);
-
-       if (new_value != req->node.prio)
-               pm_qos_update_target(
-                       pm_qos_array[req->pm_qos_class]->constraints,
-                       &req->node, PM_QOS_UPDATE_REQ, new_value);
-
        __pm_qos_update_request(req, new_value);
 }
 EXPORT_SYMBOL_GPL(pm_qos_update_request);