Commit 687b5ae2 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski

ARM: exynos: Store Exynos5420 register state in one variable

Instead of keeping two static variables put them into one struct which
later can grow.  This will reduce number of file-scope symbols.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 5b394b2d
...@@ -59,10 +59,14 @@ struct exynos_pm_data { ...@@ -59,10 +59,14 @@ struct exynos_pm_data {
int (*cpu_suspend)(unsigned long); int (*cpu_suspend)(unsigned long);
}; };
static const struct exynos_pm_data *pm_data __ro_after_init; /* Used only on Exynos542x/5800 */
struct exynos_pm_state {
int cpu_state;
unsigned int pmu_spare3;
};
static int exynos5420_cpu_state; static const struct exynos_pm_data *pm_data __ro_after_init;
static unsigned int exynos_pmu_spare3; static struct exynos_pm_state pm_state;
/* /*
* GIC wake-up support * GIC wake-up support
...@@ -321,7 +325,7 @@ static void exynos5420_pm_prepare(void) ...@@ -321,7 +325,7 @@ static void exynos5420_pm_prepare(void)
/* Set wake-up mask registers */ /* Set wake-up mask registers */
exynos_pm_set_wakeup_mask(); exynos_pm_set_wakeup_mask();
exynos_pmu_spare3 = pmu_raw_readl(S5P_PMU_SPARE3); pm_state.pmu_spare3 = pmu_raw_readl(S5P_PMU_SPARE3);
/* /*
* The cpu state needs to be saved and restored so that the * The cpu state needs to be saved and restored so that the
* secondary CPUs will enter low power start. Though the U-Boot * secondary CPUs will enter low power start. Though the U-Boot
...@@ -329,7 +333,7 @@ static void exynos5420_pm_prepare(void) ...@@ -329,7 +333,7 @@ static void exynos5420_pm_prepare(void)
* needs to restore it back in case, the primary cpu fails to * needs to restore it back in case, the primary cpu fails to
* suspend for any reason. * suspend for any reason.
*/ */
exynos5420_cpu_state = readl_relaxed(sysram_base_addr + pm_state.cpu_state = readl_relaxed(sysram_base_addr +
EXYNOS5420_CPU_STATE); EXYNOS5420_CPU_STATE);
exynos_pm_enter_sleep_mode(); exynos_pm_enter_sleep_mode();
...@@ -448,7 +452,7 @@ static void exynos5420_pm_resume(void) ...@@ -448,7 +452,7 @@ static void exynos5420_pm_resume(void)
EXYNOS5_ARM_CORE0_SYS_PWR_REG); EXYNOS5_ARM_CORE0_SYS_PWR_REG);
/* Restore the sysram cpu state register */ /* Restore the sysram cpu state register */
writel_relaxed(exynos5420_cpu_state, writel_relaxed(pm_state.cpu_state,
sysram_base_addr + EXYNOS5420_CPU_STATE); sysram_base_addr + EXYNOS5420_CPU_STATE);
pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL, pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL,
...@@ -457,7 +461,7 @@ static void exynos5420_pm_resume(void) ...@@ -457,7 +461,7 @@ static void exynos5420_pm_resume(void)
if (exynos_pm_central_resume()) if (exynos_pm_central_resume())
goto early_wakeup; goto early_wakeup;
pmu_raw_writel(exynos_pmu_spare3, S5P_PMU_SPARE3); pmu_raw_writel(pm_state.pmu_spare3, S5P_PMU_SPARE3);
early_wakeup: early_wakeup:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment