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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Doug Anderson (2022-03-23 21:47:17)
> 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

Aha, thanks, - didn't realise I could do that. I'll remove the
disable_irq, and move the coment above devm_request_threaded_irq, it
still makes sense there with the flag.

I believe I've got the format handling solved on the NO_CONNECTOR patch
from Rob/Sam, so I'm just waiting for some spare cycles to get back and
clean up - and repost the whole of this work as a new series,
incorporating Sam, Rob and Laurent's work with this on top.

--
Kieran


> Reviewed-by tag after the above is fixed.
> 
> -Doug




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux