drm: bridge: it66121: Don't use DDC error IRQs

The DDC error IRQs will fire on the IT6610 every time the FIFO is empty,
which is not very helpful. To resolve this, we can simply disable them,
and handle DDC errors in it66121_wait_ddc_ready().
Signed-off-by: NPaul Cercueil <paul@crapouillou.net>
Reviewed-by: NRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221214125821.12489-7-paul@crapouillou.net
上级 66bb0a7c
...@@ -515,16 +515,6 @@ static int it66121_get_edid_block(void *context, u8 *buf, ...@@ -515,16 +515,6 @@ static int it66121_get_edid_block(void *context, u8 *buf,
offset = (block % 2) * len; offset = (block % 2) * len;
block = block / 2; block = block / 2;
ret = regmap_read(ctx->regmap, IT66121_INT_STATUS1_REG, &val);
if (ret)
return ret;
if (val & IT66121_INT_STATUS1_DDC_BUSHANG) {
ret = it66121_abort_ddc_ops(ctx);
if (ret)
return ret;
}
ret = it66121_clear_ddc_fifo(ctx); ret = it66121_clear_ddc_fifo(ctx);
if (ret) if (ret)
return ret; return ret;
...@@ -545,16 +535,6 @@ static int it66121_get_edid_block(void *context, u8 *buf, ...@@ -545,16 +535,6 @@ static int it66121_get_edid_block(void *context, u8 *buf,
if (ret) if (ret)
return ret; return ret;
ret = regmap_read(ctx->regmap, IT66121_INT_STATUS1_REG, &val);
if (ret)
return ret;
if (val & IT66121_INT_STATUS1_DDC_BUSHANG) {
ret = it66121_abort_ddc_ops(ctx);
if (ret)
return ret;
}
ret = it66121_preamble_ddc(ctx); ret = it66121_preamble_ddc(ctx);
if (ret) if (ret)
return ret; return ret;
...@@ -585,8 +565,10 @@ static int it66121_get_edid_block(void *context, u8 *buf, ...@@ -585,8 +565,10 @@ static int it66121_get_edid_block(void *context, u8 *buf,
remain -= cnt; remain -= cnt;
ret = it66121_wait_ddc_ready(ctx); ret = it66121_wait_ddc_ready(ctx);
if (ret) if (ret) {
it66121_abort_ddc_ops(ctx);
return ret; return ret;
}
ret = regmap_noinc_read(ctx->regmap, IT66121_DDC_RD_FIFO_REG, ret = regmap_noinc_read(ctx->regmap, IT66121_DDC_RD_FIFO_REG,
buf, cnt); buf, cnt);
...@@ -671,11 +653,7 @@ static int it66121_bridge_attach(struct drm_bridge *bridge, ...@@ -671,11 +653,7 @@ static int it66121_bridge_attach(struct drm_bridge *bridge,
/* Per programming manual, sleep here for bridge to settle */ /* Per programming manual, sleep here for bridge to settle */
msleep(50); msleep(50);
/* Start interrupts */ return 0;
return regmap_write_bits(ctx->regmap, IT66121_INT_MASK1_REG,
IT66121_INT_MASK1_DDC_NOACK |
IT66121_INT_MASK1_DDC_FIFOERR |
IT66121_INT_MASK1_DDC_BUSHANG, 0);
} }
static int it66121_set_mute(struct it66121_ctx *ctx, bool mute) static int it66121_set_mute(struct it66121_ctx *ctx, bool mute)
...@@ -926,21 +904,14 @@ static irqreturn_t it66121_irq_threaded_handler(int irq, void *dev_id) ...@@ -926,21 +904,14 @@ static irqreturn_t it66121_irq_threaded_handler(int irq, void *dev_id)
ret = regmap_read(ctx->regmap, IT66121_INT_STATUS1_REG, &val); ret = regmap_read(ctx->regmap, IT66121_INT_STATUS1_REG, &val);
if (ret) { if (ret) {
dev_err(dev, "Cannot read STATUS1_REG %d\n", ret); dev_err(dev, "Cannot read STATUS1_REG %d\n", ret);
} else { } else if (val & IT66121_INT_STATUS1_HPD_STATUS) {
if (val & IT66121_INT_STATUS1_DDC_FIFOERR) regmap_write_bits(ctx->regmap, IT66121_INT_CLR1_REG,
it66121_clear_ddc_fifo(ctx); IT66121_INT_CLR1_HPD, IT66121_INT_CLR1_HPD);
if (val & (IT66121_INT_STATUS1_DDC_BUSHANG |
IT66121_INT_STATUS1_DDC_NOACK))
it66121_abort_ddc_ops(ctx);
if (val & IT66121_INT_STATUS1_HPD_STATUS) {
regmap_write_bits(ctx->regmap, IT66121_INT_CLR1_REG,
IT66121_INT_CLR1_HPD, IT66121_INT_CLR1_HPD);
status = it66121_is_hpd_detect(ctx) ? connector_status_connected status = it66121_is_hpd_detect(ctx) ? connector_status_connected
: connector_status_disconnected; : connector_status_disconnected;
event = true; event = true;
}
} }
regmap_write_bits(ctx->regmap, IT66121_SYS_STATUS_REG, regmap_write_bits(ctx->regmap, IT66121_SYS_STATUS_REG,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册