[9610] drivers: soc: cal-if: Add bcm pd sync
authorJaejoon Yoo <joonyj7.yoo@samsung.com>
Tue, 3 Jul 2018 09:57:47 +0000 (18:57 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Mon, 23 Jul 2018 08:04:40 +0000 (17:04 +0900)
Change-Id: I08541e13a469a133b4a7313d7f4cee77a85f2c00

drivers/soc/samsung/cal-if/cal-if.c

index 1ed72a00842e44ab75bb1ac380d5de026b4d7b8e..1cd6389195c78770a76ecc997e5fff64aa602ba9 100644 (file)
@@ -18,6 +18,9 @@
 #include "pmucal_gnss.h"
 #include "pmucal_shub.h"
 #include "pmucal_rae.h"
+#ifdef CONFIG_EXYNOS_BCM_DBG
+#include <soc/samsung/exynos-bcm_dbg.h>
+#endif
 #ifdef CONFIG_FLEXPMU
 #include "pmucal_powermode.h"
 
@@ -171,16 +174,28 @@ unsigned int cal_dfs_get_resume_freq(unsigned int id)
 int cal_pd_control(unsigned int id, int on)
 {
        unsigned int index;
+       int ret;
 
        if ((id & 0xFFFF0000) != BLKPWR_MAGIC)
                return -1;
 
        index = id & 0x0000FFFF;
 
-       if (on)
-               return pmucal_local_enable(index);
-       else
-               return pmucal_local_disable(index);
+       if (on) {
+               ret = pmucal_local_enable(index);
+#if defined(CONFIG_EXYNOS_BCM_DBG)
+               if (cal_pd_status(id))
+                       exynos_bcm_dbg_pd_sync(id, true);
+#endif
+       } else {
+#if defined(CONFIG_EXYNOS_BCM_DBG)
+               if (cal_pd_status(id))
+                       exynos_bcm_dbg_pd_sync(id, false);
+#endif
+               ret = pmucal_local_disable(index);
+       }
+
+       return ret;
 }
 
 int cal_pd_status(unsigned int id)