From: Jaejoon Yoo Date: Tue, 3 Jul 2018 09:57:47 +0000 (+0900) Subject: [9610] drivers: soc: cal-if: Add bcm pd sync X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1831c3217ecc3c576eb01138cbac190382d809ff;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [9610] drivers: soc: cal-if: Add bcm pd sync Change-Id: I08541e13a469a133b4a7313d7f4cee77a85f2c00 --- diff --git a/drivers/soc/samsung/cal-if/cal-if.c b/drivers/soc/samsung/cal-if/cal-if.c index 1ed72a00842e..1cd6389195c7 100644 --- a/drivers/soc/samsung/cal-if/cal-if.c +++ b/drivers/soc/samsung/cal-if/cal-if.c @@ -18,6 +18,9 @@ #include "pmucal_gnss.h" #include "pmucal_shub.h" #include "pmucal_rae.h" +#ifdef CONFIG_EXYNOS_BCM_DBG +#include +#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)