]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/mediatek: mtk_hdmi_ddc_v2: Fix multi-byte writes
authorLouis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Fri, 5 Dec 2025 14:22:27 +0000 (15:22 +0100)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Tue, 30 Dec 2025 15:59:36 +0000 (15:59 +0000)
commit1384cc00bc5f444ddfb66e027fb20c33844b21e1
treecb01ffa726c81f98df4eb97746d469e3e5cb0655
parent2788c969d89afb1e6ff66b8530584a634d1327dd
drm/mediatek: mtk_hdmi_ddc_v2: Fix multi-byte writes

Currently, the mtk_hdmi_ddc_v2 driver sends a i2c message by calling
the mtk_ddc_wr_one function for each byte of the payload to setup
SI2C_CTRL and DDC_CTRL registers, and perform a sequential write
transfer of one byte at a time to the target device. This leads to
incorrect transfers as the target address (at least) is also sent each
time.

So, rename mtk_ddc_wr_one function to mtk_ddcm_write_hdmi to match the
read function name (mtk_ddcm_read_hdmi) and modify its behaviour to
send all payload data in a single sequential write transfer by filling
the transfer fifo first then starting the transfer with a size equal to
the payload size and not one anymore.

Fixes: 8d0f79886273 ("drm/mediatek: Introduce HDMI/DDC v2 for MT8195/MT8188")
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20251205-mtk-hdmi-ddc-v2-fixes-v1-2-260dd0d320f4@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c