[Letux-kernel] [RFC 23/28] drm/ingenic: write JZ_REG_LCD_IPUR only if there is an ipu_plane

H. Nikolaus Schaller hns at goldelico.com
Sat Jan 23 17:28:49 CET 2021


Not all Ingenic SoC have an IPU and the JZ_REG_LCD_IPUR.

Tested on jz4730 and jz4780.

Signed-off-by: H. Nikolaus Schaller <hns at goldelico.com>
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index 368bfef8b3403..9cf3079a1c2e4 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -229,13 +229,15 @@ static void ingenic_drm_crtc_update_timings(struct ingenic_drm *priv,
 	regmap_set_bits(priv->map, JZ_REG_LCD_CTRL,
 			JZ_LCD_CTRL_OFUP | JZ_LCD_CTRL_BURST_16);
 
+	if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU) && priv->ipu_plane) {
 	/*
 	 * IPU restart - specify how much time the LCDC will wait before
 	 * transferring a new frame from the IPU. The value is the one
 	 * suggested in the programming manual.
 	 */
-	regmap_write(priv->map, JZ_REG_LCD_IPUR, JZ_LCD_IPUR_IPUREN |
-		     (ht * vpe / 3) << JZ_LCD_IPUR_IPUR_LSB);
+		regmap_write(priv->map, JZ_REG_LCD_IPUR, JZ_LCD_IPUR_IPUREN |
+			     (ht * vpe / 3) << JZ_LCD_IPUR_IPUR_LSB);
+	}
 }
 
 static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc,
-- 
2.26.2



More information about the Letux-kernel mailing list