rockchip: cpufreq: move cpufreq_reboot_notifier from ddr_freq to cpufreq

Signed-off-by: Xiao Feng <xf@rock-chips.com>
This commit is contained in:
Xiao Feng
2015-01-16 10:51:53 +08:00
committed by cl
parent a85de2be7d
commit 13d648b3d9
2 changed files with 14 additions and 36 deletions

View File

@@ -32,12 +32,6 @@
#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",

View 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);
}