Commit 6ba98fd6 authored by Paul Cercueil's avatar Paul Cercueil

drm: bridge: it66121: Write AVI infoframe with regmap_bulk_write()

Since all AVI infoframe registers are contiguous in the address space,
the AVI infoframe can be written in one go with regmap_bulk_write().
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221214125821.12489-5-paul@crapouillou.net
parent 315c9fb7
......@@ -773,24 +773,9 @@ void it66121_bridge_mode_set(struct drm_bridge *bridge,
const struct drm_display_mode *mode,
const struct drm_display_mode *adjusted_mode)
{
int ret, i;
u8 buf[HDMI_INFOFRAME_SIZE(AVI)];
struct it66121_ctx *ctx = container_of(bridge, struct it66121_ctx, bridge);
const u16 aviinfo_reg[HDMI_AVI_INFOFRAME_SIZE] = {
IT66121_AVIINFO_DB1_REG,
IT66121_AVIINFO_DB2_REG,
IT66121_AVIINFO_DB3_REG,
IT66121_AVIINFO_DB4_REG,
IT66121_AVIINFO_DB5_REG,
IT66121_AVIINFO_DB6_REG,
IT66121_AVIINFO_DB7_REG,
IT66121_AVIINFO_DB8_REG,
IT66121_AVIINFO_DB9_REG,
IT66121_AVIINFO_DB10_REG,
IT66121_AVIINFO_DB11_REG,
IT66121_AVIINFO_DB12_REG,
IT66121_AVIINFO_DB13_REG
};
int ret;
mutex_lock(&ctx->lock);
......@@ -810,10 +795,12 @@ void it66121_bridge_mode_set(struct drm_bridge *bridge,
}
/* Write new AVI infoframe packet */
for (i = 0; i < HDMI_AVI_INFOFRAME_SIZE; i++) {
if (regmap_write(ctx->regmap, aviinfo_reg[i], buf[i + HDMI_INFOFRAME_HEADER_SIZE]))
goto unlock;
}
ret = regmap_bulk_write(ctx->regmap, IT66121_AVIINFO_DB1_REG,
&buf[HDMI_INFOFRAME_HEADER_SIZE],
HDMI_AVI_INFOFRAME_SIZE);
if (ret)
goto unlock;
if (regmap_write(ctx->regmap, IT66121_AVIINFO_CSUM_REG, buf[3]))
goto unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment