From 042b41bb3c5bb147a098a091397e75c2bcb1af57 Mon Sep 17 00:00:00 2001 From: Guochun Huang Date: Mon, 23 Sep 2024 17:54:31 +0800 Subject: [PATCH] drm/rockchip: dsi2: disable BTA during auto calculation training MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when DSI operates in auto calculation mode,it sends a dsc read get_scanline request to the peripheral devices to automatically calculate phy_max_rd_time_auto during the auto calculation training. However,if the peripheral devices,such as a bridge chip or some panel, lack the capability to respond to read-back requests,they cannot respond to the DSI host’s BTA,leading to the signal control not being properly returned to the DSI host,Therefore,the BTA function should be disabled in such case. Signed-off-by: Guochun Huang Change-Id: Iddac487ade3de49e73594e92ad2f7b537ddf2335 --- drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c index d7a67bc80a20..eab63327b6de 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c @@ -920,12 +920,16 @@ static void dw_mipi_dsi2_enable(struct dw_mipi_dsi2 *dsi2) dw_mipi_dsi2_ipi_set(dsi2); if (dsi2->auto_calc_mode) { + regmap_update_bits(dsi2->regmap, DSI2_DSI_GENERAL_CFG, BTA_EN, 0); + regmap_write(dsi2->regmap, DSI2_MODE_CTRL, AUTOCALC_MODE); ret = regmap_read_poll_timeout(dsi2->regmap, DSI2_MODE_STATUS, mode, mode == IDLE_MODE, 1000, MODE_STATUS_TIMEOUT_US); if (ret < 0) dev_err(dsi2->dev, "auto calculation training failed\n"); + + regmap_update_bits(dsi2->regmap, DSI2_DSI_GENERAL_CFG, BTA_EN, BTA_EN); } if (dsi2->mode_flags & MIPI_DSI_MODE_VIDEO)