diff options
author | Huisung Kang <hs1218.kang@samsung.com> | 2011-06-24 03:04:18 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-07-13 18:29:59 -0400 |
commit | fe7f1bcbff917f22e121d4b2c045fb1de80cc450 (patch) | |
tree | f702fdf7eda800f91f1c36097f694759d6ae80d1 /drivers/cpufreq/s5pv210-cpufreq.c | |
parent | 74df8e69e901e624fe0b439f914aa7be66201154 (diff) |
[CPUFREQ] S5PV210: Add reboot notifier to prevent system hang
When system reboot, the CPUFREQ level should be 800MHz to prevent
system lockup.
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/s5pv210-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/s5pv210-cpufreq.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 155242cfc714..7c4bb070b904 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/cpufreq.h> | 18 | #include <linux/cpufreq.h> |
19 | #include <linux/reboot.h> | ||
19 | #include <linux/regulator/consumer.h> | 20 | #include <linux/regulator/consumer.h> |
20 | #include <linux/suspend.h> | 21 | #include <linux/suspend.h> |
21 | 22 | ||
@@ -590,6 +591,19 @@ static int s5pv210_cpufreq_notifier_event(struct notifier_block *this, | |||
590 | return NOTIFY_DONE; | 591 | return NOTIFY_DONE; |
591 | } | 592 | } |
592 | 593 | ||
594 | static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this, | ||
595 | unsigned long event, void *ptr) | ||
596 | { | ||
597 | int ret; | ||
598 | |||
599 | ret = cpufreq_driver_target(cpufreq_cpu_get(0), SLEEP_FREQ, | ||
600 | DISABLE_FURTHER_CPUFREQ); | ||
601 | if (ret < 0) | ||
602 | return NOTIFY_BAD; | ||
603 | |||
604 | return NOTIFY_DONE; | ||
605 | } | ||
606 | |||
593 | static struct cpufreq_driver s5pv210_driver = { | 607 | static struct cpufreq_driver s5pv210_driver = { |
594 | .flags = CPUFREQ_STICKY, | 608 | .flags = CPUFREQ_STICKY, |
595 | .verify = s5pv210_verify_speed, | 609 | .verify = s5pv210_verify_speed, |
@@ -607,6 +621,10 @@ static struct notifier_block s5pv210_cpufreq_notifier = { | |||
607 | .notifier_call = s5pv210_cpufreq_notifier_event, | 621 | .notifier_call = s5pv210_cpufreq_notifier_event, |
608 | }; | 622 | }; |
609 | 623 | ||
624 | static struct notifier_block s5pv210_cpufreq_reboot_notifier = { | ||
625 | .notifier_call = s5pv210_cpufreq_reboot_notifier_event, | ||
626 | }; | ||
627 | |||
610 | static int __init s5pv210_cpufreq_init(void) | 628 | static int __init s5pv210_cpufreq_init(void) |
611 | { | 629 | { |
612 | arm_regulator = regulator_get(NULL, "vddarm"); | 630 | arm_regulator = regulator_get(NULL, "vddarm"); |
@@ -623,6 +641,7 @@ static int __init s5pv210_cpufreq_init(void) | |||
623 | } | 641 | } |
624 | 642 | ||
625 | register_pm_notifier(&s5pv210_cpufreq_notifier); | 643 | register_pm_notifier(&s5pv210_cpufreq_notifier); |
644 | register_reboot_notifier(&s5pv210_cpufreq_reboot_notifier); | ||
626 | 645 | ||
627 | return cpufreq_register_driver(&s5pv210_driver); | 646 | return cpufreq_register_driver(&s5pv210_driver); |
628 | } | 647 | } |