aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/pmu.c
diff options
context:
space:
mode:
authorPankaj Dubey <pankaj.dubey@samsung.com>2014-11-06 19:26:47 -0500
committerKukjin Kim <kgene.kim@samsung.com>2014-11-21 08:49:44 -0500
commit6b7bfd8292ab27180662bcba175e7a3822486c2d (patch)
treec6ff0ebc0d083121498b058ff973ae222683f790 /arch/arm/mach-exynos/pmu.c
parent14fc8b93d47323561edf5d482d4a4b3ee1b90286 (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>
Diffstat (limited to 'arch/arm/mach-exynos/pmu.c')
-rw-r--r--arch/arm/mach-exynos/pmu.c20
1 files changed, 19 insertions, 1 deletions
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
21struct exynos_pmu_conf {
22 unsigned int offset;
23 unsigned int val[NUM_SYS_POWERDOWN];
24};
25
19struct exynos_pmu_data { 26struct 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
39static void __iomem *pmu_base_addr;
32static struct exynos_pmu_context *pmu_context; 40static struct exynos_pmu_context *pmu_context;
33 41
42static inline void pmu_raw_writel(u32 val, u32 offset)
43{
44 writel_relaxed(val, pmu_base_addr + offset);
45}
46
47static inline u32 pmu_raw_readl(u32 offset)
48{
49 return readl_relaxed(pmu_base_addr + offset);
50}
51
34static const struct exynos_pmu_conf exynos4210_pmu_config[] = { 52static 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 } },