From 7ebd7610c58cf91f1c1fd7cf83c0a33a449f8c8e Mon Sep 17 00:00:00 2001 From: "lakkyung.jung" Date: Mon, 21 May 2018 19:55:10 +0900 Subject: [PATCH] [COMMON] soc: cpupm: move location of notify call for sicd. Change-Id: Ie37c5d079cb5bb84154df30774b5580a49c988b7 Signed-off-by: lakkyung.jung --- drivers/soc/samsung/exynos-powermode.c | 41 +++++++++++++------------- include/soc/samsung/exynos-powermode.h | 3 ++ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/soc/samsung/exynos-powermode.c b/drivers/soc/samsung/exynos-powermode.c index c9ee5a4c1e7e..17843c19138b 100644 --- a/drivers/soc/samsung/exynos-powermode.c +++ b/drivers/soc/samsung/exynos-powermode.c @@ -33,6 +33,26 @@ static struct exynos_powermode_info *pm_info; /****************************************************************************** * System power mode * ******************************************************************************/ +int exynos_system_idle_enter(void) +{ + int ret; + + ret = exynos_prepare_sys_powerdown(SYS_SICD); + if (ret) + return ret; + + exynos_pm_notify(SICD_ENTER); + + return 0; +} + +void exynos_system_idle_exit(int cancel) +{ + exynos_pm_notify(SICD_EXIT); + + exynos_wakeup_sys_powerdown(SYS_SICD, cancel); +} + #define PMU_EINT_WAKEUP_MASK 0x650 static void exynos_set_wakeupmask(enum sys_powerdown mode) { @@ -54,20 +74,9 @@ int exynos_prepare_sys_powerdown(enum sys_powerdown mode) exynos_set_wakeupmask(mode); ret = cal_pm_enter(mode); - if (ret) { + if (ret) pr_err("CAL Fail to set powermode\n"); - goto out; - } - - switch (mode) { - case SYS_SICD: - exynos_pm_notify(SICD_ENTER); - break; - default: - break; - } -out: return ret; } @@ -77,14 +86,6 @@ void exynos_wakeup_sys_powerdown(enum sys_powerdown mode, bool early_wakeup) cal_pm_earlywakeup(mode); else cal_pm_exit(mode); - - switch (mode) { - case SYS_SICD: - exynos_pm_notify(SICD_EXIT); - break; - default: - break; - } } /****************************************************************************** diff --git a/include/soc/samsung/exynos-powermode.h b/include/soc/samsung/exynos-powermode.h index 0b7824f500a7..a8cc28aea07c 100644 --- a/include/soc/samsung/exynos-powermode.h +++ b/include/soc/samsung/exynos-powermode.h @@ -19,6 +19,9 @@ extern void exynos_prepare_cp_call(void); extern void exynos_wakeup_cp_call(bool early_wakeup); extern int exynos_rtc_wakeup(void); +extern int exynos_system_idle_enter(void); +extern void exynos_system_idle_exit(int cancel); + /** * external driver APIs */ -- 2.20.1