Skip to content

Commit bef697e

Browse files
yueshurkhuangtao
authored andcommitted
drm: rockchip: rk628: Fix reading 4block EDID for hdmi
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: I490c4b16d977dc044ce3b3ce2d6cfaebd8922f0c
1 parent fd0892a commit bef697e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/gpu/drm/rockchip/rk628/rk628_hdmi.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,10 +1265,12 @@ static int rk628_hdmi_i2c_write(struct rk628_hdmi *hdmi, struct i2c_msg *msgs)
12651265
((msgs->addr != DDC_ADDR) && (msgs->addr != DDC_SEGMENT_ADDR)))
12661266
return -EINVAL;
12671267

1268-
if (msgs->addr == DDC_SEGMENT_ADDR)
1269-
hdmi->i2c->segment_addr = msgs->buf[0];
12701268
if (msgs->addr == DDC_ADDR)
12711269
hdmi->i2c->ddc_addr = msgs->buf[0];
1270+
if (msgs->addr == DDC_SEGMENT_ADDR) {
1271+
hdmi->i2c->segment_addr = msgs->buf[0];
1272+
return 0;
1273+
}
12721274

12731275
/* Set edid fifo first addr */
12741276
hdmi_writeb(hdmi, HDMI_EDID_FIFO_OFFSET, 0x00);
@@ -1291,6 +1293,9 @@ static int rk628_hdmi_i2c_xfer(struct i2c_adapter *adap,
12911293

12921294
mutex_lock(&i2c->lock);
12931295

1296+
hdmi->i2c->ddc_addr = 0;
1297+
hdmi->i2c->segment_addr = 0;
1298+
12941299
/* Clear the EDID interrupt flag and unmute the interrupt */
12951300
hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, INT_EDID_READY);
12961301
hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, INT_EDID_READY_MASK);

0 commit comments

Comments
 (0)