RE: [PATCH 3/4] phy: rcar-gen3-usb2: add SoC-specific parameter for dedicated pins

From: Yoshihiro Shimoda
Date: Thu Aug 31 2017 - 04:16:05 EST


Hi Geert-san,

Thank you for the comments!

> From: Geert Uytterhoeven
> Sent: Thursday, August 31, 2017 4:51 PM
>
> Hi Shimoda-san,
>
> On Thu, Aug 31, 2017 at 9:31 AM, Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote:
> > This patch adds SoC-specific parameter to avoid reading/writing
> > specific registers wronly if this driver runs on a SoC which doesn't
> > have dedicated pins (e.g. R-Car D3).
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
> > ---
> > drivers/phy/renesas/phy-rcar-gen3-usb2.c | 25 ++++++++++++++++++++-----
> > 1 file changed, 20 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
> > index 4ea9902..28ebc98 100644
> > --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
> > +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
>
> > @@ -400,9 +403,18 @@ static irqreturn_t rcar_gen3_phy_usb2_irq(int irq, void *_ch)
> > }
> >
> > static const struct of_device_id rcar_gen3_phy_usb2_match_table[] = {
> > - { .compatible = "renesas,usb2-phy-r8a7795" },
> > - { .compatible = "renesas,usb2-phy-r8a7796" },
> > - { .compatible = "renesas,rcar-gen3-usb2-phy" },
> > + {
> > + .compatible = "renesas,usb2-phy-r8a7795",
> > + .data = (void *)RCAR_GEN3_PHY_HAS_DEDICATED_PINS,
> > + },
> > + {
> > + .compatible = "renesas,usb2-phy-r8a7796",
> > + .data = (void *)RCAR_GEN3_PHY_HAS_DEDICATED_PINS,
> > + },
> > + {
> > + .compatible = "renesas,rcar-gen3-usb2-phy",
> > + .data = (void *)RCAR_GEN3_PHY_HAS_DEDICATED_PINS,
> > + },
> > { }
> > };
>
> Given the generic R-Car Gen3 entry sets RCAR_GEN3_PHY_HAS_DEDICATED_PINS, you
> cannot specify the fallback compatible value of "renesas,rcar-gen3-usb2-phy"
> in the R-Car D3 .dtsi.

I understood it.

> So I'm wondering, does the USB2 PHY still work (with limitations) on R-Car H3
> and M3-W if you drop RCAR_GEN3_PHY_HAS_DEDICATED_PINS?

Yes, the USB PHY still work with limitation (otg capability channel works as
peripheral mode only. Other channels are no limitation).

> If yes, you can drop the flag from the generic entry, and R-Car D3 can specify
> the generic fallback compatible value in its .dtsi, like H3 and M3-W.

I got it. I will fix this patch set.

Best regards,
Yoshihiro Shimoda

> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds