Skip to content

Commit f06d2b2

Browse files
yueshurkhuangtao
authored andcommitted
drm: rockchip: inno_hdmi: Fix reading 4block EDID
After the current driver had read the EDID of 4block once, hdmi->i2c->segment cannot reset to zero, which will cause the data when restart reading to be block2 data not the expected block0 data. At the same time, when msg->addr equal to DDC_SEGMENT_ADDR, the next setting the same EDID related register, which will lead to repeated reading of the data of block2, but unable to read the address of block3. Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com> Change-Id: I79b2430a7c077e5031cdb60b4295c95fa658c40a
1 parent db2b6c8 commit f06d2b2

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/gpu/drm/rockchip/inno_hdmi.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -982,12 +982,14 @@ static int inno_hdmi_i2c_write(struct inno_hdmi *hdmi, struct i2c_msg *msgs)
982982
((msgs->addr != DDC_ADDR) && (msgs->addr != DDC_SEGMENT_ADDR)))
983983
return -EINVAL;
984984

985-
reinit_completion(&hdmi->i2c->cmp);
986-
987-
if (msgs->addr == DDC_SEGMENT_ADDR)
988-
hdmi->i2c->segment_addr = msgs->buf[0];
989985
if (msgs->addr == DDC_ADDR)
990986
hdmi->i2c->ddc_addr = msgs->buf[0];
987+
if (msgs->addr == DDC_SEGMENT_ADDR) {
988+
hdmi->i2c->segment_addr = msgs->buf[0];
989+
return 0;
990+
}
991+
992+
reinit_completion(&hdmi->i2c->cmp);
991993

992994
/* Set edid fifo first addr */
993995
hdmi_writeb(hdmi, HDMI_EDID_FIFO_OFFSET, 0x00);
@@ -1010,6 +1012,9 @@ static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap,
10101012

10111013
mutex_lock(&i2c->lock);
10121014

1015+
hdmi->i2c->ddc_addr = 0;
1016+
hdmi->i2c->segment_addr = 0;
1017+
10131018
/* Clear the EDID interrupt flag and unmute the interrupt */
10141019
hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, m_INT_EDID_READY);
10151020
hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, m_INT_EDID_READY);

0 commit comments

Comments
 (0)