aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos4/clock-exynos4212.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos4/clock-exynos4212.c')
-rw-r--r--arch/arm/mach-exynos4/clock-exynos4212.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/clock-exynos4212.c b/arch/arm/mach-exynos4/clock-exynos4212.c
index 5a47a3f0dfe4..77d5decb34fd 100644
--- a/arch/arm/mach-exynos4/clock-exynos4212.c
+++ b/arch/arm/mach-exynos4/clock-exynos4212.c
@@ -15,6 +15,7 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/syscore_ops.h>
18 19
19#include <plat/cpu-freq.h> 20#include <plat/cpu-freq.h>
20#include <plat/clock.h> 21#include <plat/clock.h>
@@ -23,12 +24,20 @@
23#include <plat/s5p-clock.h> 24#include <plat/s5p-clock.h>
24#include <plat/clock-clksrc.h> 25#include <plat/clock-clksrc.h>
25#include <plat/exynos4.h> 26#include <plat/exynos4.h>
27#include <plat/pm.h>
26 28
27#include <mach/hardware.h> 29#include <mach/hardware.h>
28#include <mach/map.h> 30#include <mach/map.h>
29#include <mach/regs-clock.h> 31#include <mach/regs-clock.h>
30#include <mach/exynos4-clock.h> 32#include <mach/exynos4-clock.h>
31 33
34static struct sleep_save exynos4212_clock_save[] = {
35 SAVE_ITEM(S5P_CLKSRC_IMAGE),
36 SAVE_ITEM(S5P_CLKDIV_IMAGE),
37 SAVE_ITEM(S5P_CLKGATE_IP_IMAGE_4212),
38 SAVE_ITEM(S5P_CLKGATE_IP_PERIR_4212),
39};
40
32static struct clk *clk_src_mpll_user_list[] = { 41static struct clk *clk_src_mpll_user_list[] = {
33 [0] = &clk_fin_mpll, 42 [0] = &clk_fin_mpll,
34 [1] = &clk_mout_mpll.clk, 43 [1] = &clk_mout_mpll.clk,
@@ -59,6 +68,29 @@ static struct clk init_clocks_off[] = {
59 /* nothing here yet */ 68 /* nothing here yet */
60}; 69};
61 70
71#ifdef CONFIG_PM_SLEEP
72static int exynos4212_clock_suspend(void)
73{
74 s3c_pm_do_save(exynos4212_clock_save, ARRAY_SIZE(exynos4212_clock_save));
75
76 return 0;
77}
78
79static void exynos4212_clock_resume(void)
80{
81 s3c_pm_do_restore_core(exynos4212_clock_save, ARRAY_SIZE(exynos4212_clock_save));
82}
83
84#else
85#define exynos4212_clock_suspend NULL
86#define exynos4212_clock_resume NULL
87#endif
88
89struct syscore_ops exynos4212_clock_syscore_ops = {
90 .suspend = exynos4212_clock_suspend,
91 .resume = exynos4212_clock_resume,
92};
93
62void __init exynos4212_register_clocks(void) 94void __init exynos4212_register_clocks(void)
63{ 95{
64 int ptr; 96 int ptr;
@@ -81,4 +113,6 @@ void __init exynos4212_register_clocks(void)
81 113
82 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 114 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
83 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 115 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
116
117 register_syscore_ops(&exynos4212_clock_syscore_ops);
84} 118}