Skip to content

Commit fd0892a

Browse files
yueshurkhuangtao
authored andcommitted
drm: rockchip: rk618: 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: I7c4ec557c6206ff2b941e9060e63b00e941c1e2b
1 parent f06d2b2 commit fd0892a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/gpu/drm/rockchip/rk618/rk618_hdmi.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,10 +1338,12 @@ static int rk618_hdmi_i2c_write(struct rk618_hdmi *hdmi, struct i2c_msg *msgs)
13381338
((msgs->addr != DDC_ADDR) && (msgs->addr != DDC_SEGMENT_ADDR)))
13391339
return -EINVAL;
13401340

1341-
if (msgs->addr == DDC_SEGMENT_ADDR)
1342-
hdmi->i2c->segment_addr = msgs->buf[0];
13431341
if (msgs->addr == DDC_ADDR)
13441342
hdmi->i2c->ddc_addr = msgs->buf[0];
1343+
if (msgs->addr == DDC_SEGMENT_ADDR) {
1344+
hdmi->i2c->segment_addr = msgs->buf[0];
1345+
return 0;
1346+
}
13451347

13461348
/* Set edid fifo first addr */
13471349
hdmi_writeb(hdmi, HDMI_EDID_FIFO_OFFSET, 0x00);
@@ -1364,6 +1366,9 @@ static int rk618_hdmi_i2c_xfer(struct i2c_adapter *adap,
13641366

13651367
mutex_lock(&i2c->lock);
13661368

1369+
hdmi->i2c->ddc_addr = 0;
1370+
hdmi->i2c->segment_addr = 0;
1371+
13671372
/* Clear the EDID interrupt flag and unmute the interrupt */
13681373
hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, m_INT_EDID_READY);
13691374
hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, m_INT_EDID_READY);

0 commit comments

Comments
 (0)