Re: [PATCH v1] usb: xhci: plat: Add USB 3.0 phy support

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

 



On Fri, 2023-04-07 at 14:07 +0800, Stanley Chang wrote:
> For Realtek SoC, the usb xhci uses different driver for u2phy and u3phy.
> Therefore, add a hook to retrieve the USB 3.0 PHY to XHCI plat.
> 
> Signed-off-by: Stanley Chang <stanley_chang@xxxxxxxxxxx>
> ---
>  drivers/usb/host/xhci-plat.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index b9f9625467d6..61c95349b998 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -291,6 +291,21 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
>                         goto dealloc_usb2_hcd;
>                 }
>  
> +               xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev,
> +                           "usb-phy", 1);
> +               if (IS_ERR(xhci->shared_hcd->usb_phy)) {
> +                       if (PTR_ERR(xhci->shared_hcd->usb_phy) != -ENODEV)
> +                               dev_err(sysdev, "%s get usb3phy fail (ret=%d)\n",

Hello,

I'm booting 6.4-rc1 on a Turris Omnia (arm/boot/dts/armada-385-turris-omnia.dts)
and get those error messages:
[    0.231609] xhci-hcd f10f0000.usb3: xhci_plat_probe get usb3phy fail (ret=-6)
[    0.239716] xhci-hcd f10f8000.usb3: xhci_plat_probe get usb3phy fail (ret=-6)

It looks like a cosmetic issue with error codes, but maybe it can be fixed?


> +                                            __func__,
> +                                           (int)PTR_ERR(xhci->shared_hcd->usb_phy));
> +                       xhci->shared_hcd->usb_phy = NULL;
> +               } else {
> +                       ret = usb_phy_init(xhci->shared_hcd->usb_phy);
> +                       if (ret)
> +                               dev_err(sysdev, "%s init usb3phy fail (ret=%d)\n",
> +                                           __func__, ret);
> +               }
> +
>                 xhci->shared_hcd->tpl_support = hcd->tpl_support;
>         }
>  





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux