Re: [PATCH v4 3/3] drm/bridge: ti-sn65dsi86: Support hotplug detection

From: Doug Anderson
Date: Wed Mar 23 2022 - 17:47:38 EST


Hi,

On Thu, Mar 17, 2022 at 6:13 AM Kieran Bingham
<kieran.bingham+renesas@xxxxxxxxxxxxxxxx> wrote:
>
> @@ -1241,9 +1350,32 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev,
> pdata->bridge.type = pdata->next_bridge->type == DRM_MODE_CONNECTOR_DisplayPort
> ? DRM_MODE_CONNECTOR_DisplayPort : DRM_MODE_CONNECTOR_eDP;
>
> - if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort)
> + if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort) {
> pdata->bridge.ops = DRM_BRIDGE_OP_EDID;
>
> + if (!pdata->no_hpd)
> + pdata->bridge.ops |= DRM_BRIDGE_OP_DETECT;
> + }
> +
> + if (!pdata->no_hpd && pdata->irq > 0) {
> + ret = devm_request_threaded_irq(pdata->dev, pdata->irq, NULL,
> + ti_sn65dsi86_irq_handler,
> + IRQF_ONESHOT, "sn65dsi86-irq",
> + pdata);
> + if (ret)
> + return dev_err_probe(pdata->dev, ret,
> + "Failed to register DP interrupt\n");
> +
> + /* Enable IRQ based HPD */
> + pdata->bridge.ops |= DRM_BRIDGE_OP_HPD;
> +
> + /*
> + * Keep the IRQ disabled initially. It will only be enabled when
> + * requested through ti_sn_bridge_hpd_enable().
> + */
> + disable_irq(pdata->irq);

Instead, I think you should use `IRQF_NO_AUTOEN` which makes sure that
no matter what the state of the hardware is your IRQ won't fire
"early". ...and, of course, it saves a line of code. ;-)

Other than that this looks nice to me now so feel free to add my
Reviewed-by tag after the above is fixed.

-Doug