rockchip: cpufreq: move cpufreq_reboot_notifier from ddr_freq to cpufreq
authorXiao Feng <xf@rock-chips.com>
Fri, 16 Jan 2015 02:51:53 +0000 (10:51 +0800)
committercl <cl@rock-chips.com>
Mon, 19 Jan 2015 02:57:21 +0000 (10:57 +0800)
Signed-off-by: Xiao Feng <xf@rock-chips.com>
arch/arm/mach-rockchip/ddr_freq.c
drivers/cpufreq/rockchip-cpufreq.c

index 15547678e6bbd5432f8bed7c8aa43edbb304a68d..7bda5775a8dd61a0c635f264b06f176004a1d0ca 100644 (file)
 #include "../../../drivers/clk/rockchip/clk-pd.h"
 #include "cpu_axi.h"
 
-#ifdef CONFIG_CPU_FREQ
-extern int rockchip_cpufreq_reboot_limit_freq(void);
-#else
-static inline int rockchip_cpufreq_reboot_limit_freq(void) { return 0; }
-#endif
-
 static DECLARE_COMPLETION(ddrfreq_completion);
 static DEFINE_MUTEX(ddrfreq_mutex);
 
@@ -777,18 +771,6 @@ CLK_NOTIFIER(pd_vop0, LCDC0)
 CLK_NOTIFIER(pd_vop1, LCDC1)
 #endif
 
-static int ddrfreq_reboot_notifier_event(struct notifier_block *this, unsigned long event, void *ptr)
-{
-       rockchip_set_system_status(SYS_STATUS_REBOOT);
-       rockchip_cpufreq_reboot_limit_freq();
-
-       return NOTIFY_OK;
-}
-
-static struct notifier_block ddrfreq_reboot_notifier = {
-       .notifier_call = ddrfreq_reboot_notifier_event,
-};
-
 static int ddr_freq_suspend_notifier_call(struct notifier_block *self,
                                unsigned long action, void *data)
 {
@@ -1004,7 +986,6 @@ static int ddrfreq_init(void)
 
        rockchip_register_system_status_notifier(&ddrfreq_system_status_notifier);
        fb_register_client(&ddr_freq_suspend_notifier);
-       register_reboot_notifier(&ddrfreq_reboot_notifier);
 
        pr_info("verion 1.2 20140526\n");
        pr_info("normal %luMHz video_1080p %luMHz video_4k %luMHz dualview %luMHz idle %luMHz suspend %luMHz reboot %luMHz\n",
index 3b03329174e78c4c85de7081dc233835b8c7bf6d..66ed11f40dfb4aa03c156a87be98862f5d661df1 100644 (file)
@@ -33,6 +33,8 @@
 #include <asm/unistd.h>
 #include <asm/uaccess.h>
 #include <asm/system_misc.h>
+#include <linux/rockchip/common.h>
+#include <dt-bindings/clock/rk_system_status.h>
 #include "../../../drivers/clk/rockchip/clk-pd.h"
 
 extern void dvfs_disable_temp_limit(void);
@@ -397,21 +399,7 @@ out:
 static struct notifier_block cpufreq_pm_notifier = {
        .notifier_call = cpufreq_pm_notifier_event,
 };
-#if 0
-static int cpufreq_reboot_notifier_event(struct notifier_block *this, unsigned long event, void *ptr)
-{
-       struct cpufreq_policy *policy = cpufreq_cpu_get(0);
 
-       if (policy) {
-               is_booting = false;
-               policy->cur++;
-               cpufreq_driver_target(policy, suspend_freq, DISABLE_FURTHER_CPUFREQ | CPUFREQ_RELATION_H);
-               cpufreq_cpu_put(policy);
-       }
-
-       return NOTIFY_OK;
-}
-#endif
 int rockchip_cpufreq_reboot_limit_freq(void)
 {
        struct regulator *regulator;
@@ -432,11 +420,20 @@ int rockchip_cpufreq_reboot_limit_freq(void)
 
        return 0;
 }
-#if 0
+
+static int cpufreq_reboot_notifier_event(struct notifier_block *this,
+                                        unsigned long event, void *ptr)
+{
+       rockchip_set_system_status(SYS_STATUS_REBOOT);
+       rockchip_cpufreq_reboot_limit_freq();
+
+       return NOTIFY_OK;
+}
+
 static struct notifier_block cpufreq_reboot_notifier = {
        .notifier_call = cpufreq_reboot_notifier_event,
 };
-#endif
+
 static int clk_pd_vio_notifier_call(struct notifier_block *nb, unsigned long event, void *ptr)
 {
        switch (event) {
@@ -456,7 +453,6 @@ static struct notifier_block clk_pd_vio_notifier = {
        .notifier_call = clk_pd_vio_notifier_call,
 };
 
-
 static struct cpufreq_driver cpufreq_driver = {
        .flags = CPUFREQ_CONST_LOOPS,
        .verify = cpufreq_verify,
@@ -480,6 +476,7 @@ static int __init cpufreq_driver_init(void)
                        clk_enable_dvfs(aclk_vio1_dvfs_node);
                }
        }
+       register_reboot_notifier(&cpufreq_reboot_notifier);
        register_pm_notifier(&cpufreq_pm_notifier);
        return cpufreq_register_driver(&cpufreq_driver);
 }