drm/bridge: synopsys: dw-hdmi-qp: Clear ddc write/read bits when ddc transfer failed

If don't clear write/read bits when ddc
transmission fails, ddc transmission may
always fail no matter how many times retry.

Change-Id: I8f1a64432a1fb2afffc9404dcfb911f01f8188ad
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
Algea Cao
2024-08-28 15:00:14 +08:00
committed by Tao Huang
parent 597735698e
commit 8bd12d0266

View File

@@ -1082,6 +1082,7 @@ static int dw_hdmi_i2c_read(struct dw_hdmi_qp *hdmi,
if (!stat) {
dev_err(hdmi->dev, "i2c read time out!\n");
hdmi_writel(hdmi, 0x01, I2CM_CONTROL0);
hdmi_modb(hdmi, 0, I2CM_WR_MASK, I2CM_INTERFACE_CONTROL0);
retry -= 10;
continue;
}
@@ -1090,6 +1091,7 @@ static int dw_hdmi_i2c_read(struct dw_hdmi_qp *hdmi,
if (i2c->stat & I2CM_NACK_RCVD_IRQ) {
dev_err(hdmi->dev, "i2c read err!\n");
hdmi_writel(hdmi, 0x01, I2CM_CONTROL0);
hdmi_modb(hdmi, 0, I2CM_WR_MASK, I2CM_INTERFACE_CONTROL0);
retry--;
usleep_range(10000, 11000);
continue;
@@ -1164,6 +1166,7 @@ static int dw_hdmi_i2c_write(struct dw_hdmi_qp *hdmi,
if (!stat) {
dev_err(hdmi->dev, "i2c write time out!\n");
hdmi_writel(hdmi, 0x01, I2CM_CONTROL0);
hdmi_modb(hdmi, 0, I2CM_WR_MASK, I2CM_INTERFACE_CONTROL0);
retry -= 10;
continue;
}
@@ -1172,6 +1175,7 @@ static int dw_hdmi_i2c_write(struct dw_hdmi_qp *hdmi,
if (i2c->stat & I2CM_NACK_RCVD_IRQ) {
dev_err(hdmi->dev, "i2c write nack!\n");
hdmi_writel(hdmi, 0x01, I2CM_CONTROL0);
hdmi_modb(hdmi, 0, I2CM_WR_MASK, I2CM_INTERFACE_CONTROL0);
retry--;
usleep_range(10000, 11000);
continue;