aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/pm.c
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2014-03-17 18:28:22 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-03-20 15:09:27 -0400
commit559ba237999d723ccba5b4a75cf6b280bac1ab21 (patch)
tree763d8c73834bde6b5c65e3e04241c215468d390c /arch/arm/mach-exynos/pm.c
parentdbc5ca163dc46153a8e5249da627af571ae47c10 (diff)
ARM: EXYNOS: Remove PM initcalls and useless indirection
This patch simplifies Exynos PM initialization and makes it multiplatform friendly by replacing initcalls used originally to invoke all the initialization code with explicit function calls. In addition, an useless subsys_interface is removed, as all its .add_dev callback did was setting two function pointers. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos/pm.c')
-rw-r--r--arch/arm/mach-exynos/pm.c50
1 files changed, 12 insertions, 38 deletions
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index ba18214c9aca..596ed13c4166 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -92,39 +92,6 @@ static void exynos_pm_prepare(void)
92 __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0); 92 __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0);
93} 93}
94 94
95static int exynos_pm_add(struct device *dev, struct subsys_interface *sif)
96{
97 pm_cpu_prep = exynos_pm_prepare;
98 pm_cpu_sleep = exynos_cpu_suspend;
99
100 return 0;
101}
102
103static struct subsys_interface exynos_pm_interface = {
104 .name = "exynos_pm",
105 .subsys = &exynos_subsys,
106 .add_dev = exynos_pm_add,
107};
108
109static __init int exynos_pm_drvinit(void)
110{
111 unsigned int tmp;
112
113 if (soc_is_exynos5440())
114 return 0;
115
116 s3c_pm_init();
117
118 /* All wakeup disable */
119
120 tmp = __raw_readl(S5P_WAKEUP_MASK);
121 tmp |= ((0xFF << 8) | (0x1F << 1));
122 __raw_writel(tmp, S5P_WAKEUP_MASK);
123
124 return subsys_interface_register(&exynos_pm_interface);
125}
126arch_initcall(exynos_pm_drvinit);
127
128static int exynos_pm_suspend(void) 95static int exynos_pm_suspend(void)
129{ 96{
130 unsigned long tmp; 97 unsigned long tmp;
@@ -220,12 +187,19 @@ static struct syscore_ops exynos_pm_syscore_ops = {
220 .resume = exynos_pm_resume, 187 .resume = exynos_pm_resume,
221}; 188};
222 189
223static __init int exynos_pm_syscore_init(void) 190void __init exynos_pm_init(void)
224{ 191{
225 if (soc_is_exynos5440()) 192 u32 tmp;
226 return 0; 193
194 pm_cpu_prep = exynos_pm_prepare;
195 pm_cpu_sleep = exynos_cpu_suspend;
196
197 s3c_pm_init();
198
199 /* All wakeup disable */
200 tmp = __raw_readl(S5P_WAKEUP_MASK);
201 tmp |= ((0xFF << 8) | (0x1F << 1));
202 __raw_writel(tmp, S5P_WAKEUP_MASK);
227 203
228 register_syscore_ops(&exynos_pm_syscore_ops); 204 register_syscore_ops(&exynos_pm_syscore_ops);
229 return 0;
230} 205}
231arch_initcall(exynos_pm_syscore_init);