[COMMON] soc: cpupm: move location of notify call for sicd.
authorlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 21 May 2018 10:55:10 +0000 (19:55 +0900)
committerChungwoo Park <cww.park@samsung.com>
Wed, 23 May 2018 10:52:38 +0000 (19:52 +0900)
Change-Id: Ie37c5d079cb5bb84154df30774b5580a49c988b7
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
drivers/soc/samsung/exynos-powermode.c
include/soc/samsung/exynos-powermode.h

index c9ee5a4c1e7eae02a11c1e3a1ed5992672daf5da..17843c19138b4f39712504f62e12f157cac7c88a 100644 (file)
@@ -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;
-       }
 }
 
 /******************************************************************************
index 0b7824f500a760e1204375e8b704ab1a9b89aede..a8cc28aea07c3cb987b322c8f6a998429f64c156 100644 (file)
@@ -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
  */