From 55d06833e65df98e04e0a17cb2c28d0811a8a21c Mon Sep 17 00:00:00 2001 From: hwangjae lee Date: Thu, 31 May 2018 20:30:51 +0900 Subject: [PATCH] [9610] fbdev: dpu: add idle ip interface for dsim. The DPU can't turn off the power block. Howeveer, to enter the SICD, the DPU must be notified when dsim hiber enter/exit mode. Change-Id: Idcf69a91f7f6b0d34ed95ef38b0dce24bdde6c60 Signed-off-by: hwangjae lee --- arch/arm64/boot/dts/exynos/exynos9610.dtsi | 2 +- drivers/video/fbdev/exynos/dpu20/dsim.h | 1 + drivers/video/fbdev/exynos/dpu20/dsim_drv.c | 24 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/exynos/exynos9610.dtsi b/arch/arm64/boot/dts/exynos/exynos9610.dtsi index 471d19547e06..0008a519998f 100644 --- a/arch/arm64/boot/dts/exynos/exynos9610.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos9610.dtsi @@ -371,7 +371,7 @@ "pd-g3d", /* [46] pd-g3d */ "pd-dispaud", /* [47] pd-dispaud */ "pd-mfc", /* [48] pd-mfc */ - "148b0000.decon_f"; /* [49] decon_f */ + "148e0000.dsim"; /* [49] dsim_0 */ fix-idle-ip = "acpm_dvfs"; fix-idle-ip-index = <96>; diff --git a/drivers/video/fbdev/exynos/dpu20/dsim.h b/drivers/video/fbdev/exynos/dpu20/dsim.h index e4e099f664ee..789c69bcacc4 100644 --- a/drivers/video/fbdev/exynos/dpu20/dsim.h +++ b/drivers/video/fbdev/exynos/dpu20/dsim.h @@ -232,6 +232,7 @@ struct dsim_device { int total_underrun_cnt; struct backlight_device *bd; + int idle_ip_index; }; struct dsim_lcd_driver { diff --git a/drivers/video/fbdev/exynos/dpu20/dsim_drv.c b/drivers/video/fbdev/exynos/dpu20/dsim_drv.c index 5178ea7824ca..18a347529991 100644 --- a/drivers/video/fbdev/exynos/dpu20/dsim_drv.c +++ b/drivers/video/fbdev/exynos/dpu20/dsim_drv.c @@ -30,6 +30,9 @@ #if defined(CONFIG_CAL_IF) #include #endif +#if defined(CONFIG_CPU_IDLE) +#include +#endif #if defined(CONFIG_SOC_EXYNOS9610) #include #endif @@ -709,6 +712,10 @@ static int _dsim_enable(struct dsim_device *dsim, enum dsim_state state) dsim_dbg("%s %s +\n", __func__, dsim_state_names[dsim->state]); +#if defined(CONFIG_CPU_IDLE) + exynos_update_ip_idle_status(dsim->idle_ip_index, 0); +#endif + pm_runtime_get_sync(dsim->dev); /* DPHY reset control from DSIM */ @@ -823,6 +830,9 @@ static int _dsim_disable(struct dsim_device *dsim, enum dsim_state state) pm_runtime_put_sync(dsim->dev); dsim_dbg("%s %s -\n", __func__, dsim_state_names[dsim->state]); +#if defined(CONFIG_CPU_IDLE) + exynos_update_ip_idle_status(dsim->idle_ip_index, 1); +#endif return 0; } @@ -911,6 +921,9 @@ static int dsim_enter_ulps(struct dsim_device *dsim) phy_power_off(dsim->phy_ex); pm_runtime_put_sync(dsim->dev); +#if defined(CONFIG_CPU_IDLE) + exynos_update_ip_idle_status(dsim->idle_ip_index, 1); +#endif DPU_EVENT_LOG(DPU_EVT_ENTER_ULPS, &dsim->sd, start); err: @@ -929,6 +942,9 @@ static int dsim_exit_ulps(struct dsim_device *dsim) ret = -EBUSY; goto err; } +#if defined(CONFIG_CPU_IDLE) + exynos_update_ip_idle_status(dsim->idle_ip_index, 0); +#endif pm_runtime_get_sync(dsim->dev); @@ -1473,6 +1489,14 @@ static int dsim_probe(struct platform_device *pdev) setup_timer(&dsim->cmd_timer, dsim_cmd_fail_detector, (unsigned long)dsim); +#if defined(CONFIG_CPU_IDLE) + dsim->idle_ip_index = exynos_get_idle_ip_index(dev_name(&pdev->dev)); + dsim_info("dsim idle_ip_index[%d]\n", dsim->idle_ip_index); + if (dsim->idle_ip_index < 0) + dsim_warn("idle ip index is not provided for dsim\n"); + exynos_update_ip_idle_status(dsim->idle_ip_index, 1); +#endif + pm_runtime_enable(dev); ret = iovmm_activate(dev); -- 2.20.1