diff options
author | Pankaj Dubey <pankaj.dubey@samsung.com> | 2014-11-06 19:26:47 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-11-21 08:49:44 -0500 |
commit | 6b7bfd8292ab27180662bcba175e7a3822486c2d (patch) | |
tree | c6ff0ebc0d083121498b058ff973ae222683f790 | |
parent | 14fc8b93d47323561edf5d482d4a4b3ee1b90286 (diff) |
ARM: EXYNOS: Move PMU specific definitions from common.h
This patch moves PMU specific definitions into a new file
as exynos-pmu.h.
This will help in reducing dependency of common.h in pmu.c.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-exynos/common.h | 17 | ||||
-rw-r--r-- | arch/arm/mach-exynos/exynos-pmu.h | 24 | ||||
-rw-r--r-- | arch/arm/mach-exynos/pm.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/pmu.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-exynos/suspend.c | 1 |
5 files changed, 45 insertions, 18 deletions
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index d4d09bc1e48c..431be1bca2e8 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -139,23 +139,6 @@ extern void exynos_cpu_resume_ns(void); | |||
139 | 139 | ||
140 | extern struct smp_operations exynos_smp_ops; | 140 | extern struct smp_operations exynos_smp_ops; |
141 | 141 | ||
142 | /* PMU(Power Management Unit) support */ | ||
143 | |||
144 | #define PMU_TABLE_END (-1U) | ||
145 | |||
146 | enum sys_powerdown { | ||
147 | SYS_AFTR, | ||
148 | SYS_LPA, | ||
149 | SYS_SLEEP, | ||
150 | NUM_SYS_POWERDOWN, | ||
151 | }; | ||
152 | |||
153 | struct exynos_pmu_conf { | ||
154 | unsigned int offset; | ||
155 | unsigned int val[NUM_SYS_POWERDOWN]; | ||
156 | }; | ||
157 | |||
158 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | ||
159 | extern void exynos_cpu_power_down(int cpu); | 142 | extern void exynos_cpu_power_down(int cpu); |
160 | extern void exynos_cpu_power_up(int cpu); | 143 | extern void exynos_cpu_power_up(int cpu); |
161 | extern int exynos_cpu_power_state(int cpu); | 144 | extern int exynos_cpu_power_state(int cpu); |
diff --git a/arch/arm/mach-exynos/exynos-pmu.h b/arch/arm/mach-exynos/exynos-pmu.h new file mode 100644 index 000000000000..a2ab0d52b230 --- /dev/null +++ b/arch/arm/mach-exynos/exynos-pmu.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. | ||
3 | * http://www.samsung.com | ||
4 | * | ||
5 | * Header for EXYNOS PMU Driver support | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __EXYNOS_PMU_H | ||
13 | #define __EXYNOS_PMU_H | ||
14 | |||
15 | enum sys_powerdown { | ||
16 | SYS_AFTR, | ||
17 | SYS_LPA, | ||
18 | SYS_SLEEP, | ||
19 | NUM_SYS_POWERDOWN, | ||
20 | }; | ||
21 | |||
22 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | ||
23 | |||
24 | #endif /* __EXYNOS_PMU_H */ | ||
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 4f10fa6bfe10..86f3ecd88f78 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <plat/pm-common.h> | 26 | #include <plat/pm-common.h> |
27 | 27 | ||
28 | #include "common.h" | 28 | #include "common.h" |
29 | #include "exynos-pmu.h" | ||
29 | #include "regs-pmu.h" | 30 | #include "regs-pmu.h" |
30 | #include "regs-sys.h" | 31 | #include "regs-sys.h" |
31 | 32 | ||
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 24cd4c471c47..88d3f793e267 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c | |||
@@ -13,9 +13,16 @@ | |||
13 | #include <linux/of.h> | 13 | #include <linux/of.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | 15 | ||
16 | #include "common.h" | 16 | #include "exynos-pmu.h" |
17 | #include "regs-pmu.h" | 17 | #include "regs-pmu.h" |
18 | 18 | ||
19 | #define PMU_TABLE_END (-1U) | ||
20 | |||
21 | struct exynos_pmu_conf { | ||
22 | unsigned int offset; | ||
23 | unsigned int val[NUM_SYS_POWERDOWN]; | ||
24 | }; | ||
25 | |||
19 | struct exynos_pmu_data { | 26 | struct exynos_pmu_data { |
20 | const struct exynos_pmu_conf *pmu_config; | 27 | const struct exynos_pmu_conf *pmu_config; |
21 | const struct exynos_pmu_conf *pmu_config_extra; | 28 | const struct exynos_pmu_conf *pmu_config_extra; |
@@ -29,8 +36,19 @@ struct exynos_pmu_context { | |||
29 | const struct exynos_pmu_data *pmu_data; | 36 | const struct exynos_pmu_data *pmu_data; |
30 | }; | 37 | }; |
31 | 38 | ||
39 | static void __iomem *pmu_base_addr; | ||
32 | static struct exynos_pmu_context *pmu_context; | 40 | static struct exynos_pmu_context *pmu_context; |
33 | 41 | ||
42 | static inline void pmu_raw_writel(u32 val, u32 offset) | ||
43 | { | ||
44 | writel_relaxed(val, pmu_base_addr + offset); | ||
45 | } | ||
46 | |||
47 | static inline u32 pmu_raw_readl(u32 offset) | ||
48 | { | ||
49 | return readl_relaxed(pmu_base_addr + offset); | ||
50 | } | ||
51 | |||
34 | static const struct exynos_pmu_conf exynos4210_pmu_config[] = { | 52 | static const struct exynos_pmu_conf exynos4210_pmu_config[] = { |
35 | /* { .offset = offset, .val = { AFTR, LPA, SLEEP } */ | 53 | /* { .offset = offset, .val = { AFTR, LPA, SLEEP } */ |
36 | { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, | 54 | { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, |
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index f5d9773066eb..079d999b8b23 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "common.h" | 33 | #include "common.h" |
34 | #include "regs-pmu.h" | 34 | #include "regs-pmu.h" |
35 | #include "regs-sys.h" | 35 | #include "regs-sys.h" |
36 | #include "exynos-pmu.h" | ||
36 | 37 | ||
37 | #define S5P_CHECK_SLEEP 0x00000BAD | 38 | #define S5P_CHECK_SLEEP 0x00000BAD |
38 | 39 | ||