On 11/13/25 9:29 PM, Chris Morgan wrote:
> From: Chris Morgan <[email protected]>
> 
> Add support for the dw-hdmi-qp driver to handle devices with missing
> HPD pins.
> 
> Since in this situation we are now polling for the EDID data via i2c
> change the error message to a debug message when we are unable to
> complete an i2c read, as a disconnected device would otherwise fill
> dmesg with i2c read errors.
> 
> Signed-off-by: Chris Morgan <[email protected]>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 32 +++++++++++++++++---
>  1 file changed, 28 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> index 39332c57f2c5..a2b1a4821714 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> @@ -145,6 +145,7 @@ struct dw_hdmi_qp {
>       struct regmap *regm;
>  
>       unsigned long tmds_char_rate;
> +     bool no_hpd;
>  };
>  
>  static void dw_hdmi_qp_write(struct dw_hdmi_qp *hdmi, unsigned int val,
> @@ -520,6 +521,11 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi,
>               i2c->is_regaddr = true;
>       }
>  
> +     /*
> +      * Mark errors as debug messages when using no_hpd so no device
> +      * attached does not fill up dmesg.
> +      */
> +

Using the *_ratelimited() variant - see below - would make this comment kind of
redundant.  Moreover, you've already explained the rationale behind the change
in the commit description.  Hence I'd rather drop it.

>       while (length--) {
>               reinit_completion(&i2c->cmp);
>  
> @@ -535,14 +541,20 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi,
>  
>               stat = wait_for_completion_timeout(&i2c->cmp, HZ / 10);
>               if (!stat) {
> -                     dev_err(hdmi->dev, "i2c read timed out\n");
> +                     if (hdmi->no_hpd)
> +                             dev_dbg(hdmi->dev, "i2c read timed out\n");

I think it's worth switching to dev_dbg_ratelimited() in this case.

> +                     else
> +                             dev_err(hdmi->dev, "i2c read timed out\n");
>                       dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0);
>                       return -EAGAIN;
>               }
>  
>               /* Check for error condition on the bus */
>               if (i2c->stat & I2CM_NACK_RCVD_IRQ) {
> -                     dev_err(hdmi->dev, "i2c read error\n");
> +                     if (hdmi->no_hpd)
> +                             dev_dbg(hdmi->dev, "i2c read error\n");

Same here.

> +                     else
> +                             dev_err(hdmi->dev, "i2c read error\n");
>                       dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0);
>                       return -EIO;
>               }

[...]

Regardless,

Reviewed-by: Cristian Ciocaltea <[email protected]>

Reply via email to