Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i2c: tda998x: fix bad checksum of the HDMI AVI infoframe

The commit 8c7a075da9f7980cc95ffcd7e6621d4a87f20f40
"drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()"
also uses hdmi_avi_infoframe_pack() to create the AVI infoframe.
This function sets the checksum of the frame and this breaks
the second calculation of the checksum done in tda998x_write_if().

Fixes: 8c7a075da9f7980c ("drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()")
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Jean-Francois Moine and committed by
Russell King
4a6ca1a2 5296b7f9

+2 -2
+2 -2
drivers/gpu/drm/i2c/tda998x_drv.c
··· 582 582 tda998x_write_if(struct tda998x_priv *priv, uint8_t bit, uint16_t addr, 583 583 uint8_t *buf, size_t size) 584 584 { 585 - buf[PB(0)] = tda998x_cksum(buf, size); 586 - 587 585 reg_clear(priv, REG_DIP_IF_FLAGS, bit); 588 586 reg_write_range(priv, addr, buf, size); 589 587 reg_set(priv, REG_DIP_IF_FLAGS, bit); ··· 600 602 buf[PB(2)] = p->audio_frame[2] & 0x1c; /* SF */ 601 603 buf[PB(4)] = p->audio_frame[4]; 602 604 buf[PB(5)] = p->audio_frame[5] & 0xf8; /* DM_INH + LSV */ 605 + 606 + buf[PB(0)] = tda998x_cksum(buf, sizeof(buf)); 603 607 604 608 tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf, 605 609 sizeof(buf));