From c20fbc62daed1caf8a82e4e18dbba4c2c632e556 Mon Sep 17 00:00:00 2001 From: DarkBahamut Date: Thu, 23 Feb 2017 10:50:30 +0900 Subject: [PATCH] usb: host: xhci-plat: Bring USB phy up earlier to ensure streams supported --- drivers/usb/host/xhci-plat.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index df5d7d89b885..469f34d6366c 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -209,6 +209,22 @@ static int xhci_plat_probe(struct platform_device *pdev) if (priv_match) *priv = *priv_match; } + + hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); + if (IS_ERR(hcd->usb_phy)) { + ret = PTR_ERR(hcd->usb_phy); + if (ret == -EPROBE_DEFER) + goto put_usb3_hcd; + hcd->usb_phy = NULL; + } else { + ret = usb_phy_init(hcd->usb_phy); + if (ret) + goto put_usb3_hcd; + } + + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); + if (ret) + goto disable_usb_phy; device_wakeup_enable(hcd->self.controller); @@ -227,22 +243,6 @@ static int xhci_plat_probe(struct platform_device *pdev) if (HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci->shared_hcd->can_do_streams = 1; - hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); - if (IS_ERR(hcd->usb_phy)) { - ret = PTR_ERR(hcd->usb_phy); - if (ret == -EPROBE_DEFER) - goto put_usb3_hcd; - hcd->usb_phy = NULL; - } else { - ret = usb_phy_init(hcd->usb_phy); - if (ret) - goto put_usb3_hcd; - } - - ret = usb_add_hcd(hcd, irq, IRQF_SHARED); - if (ret) - goto disable_usb_phy; - /* Get possile USB 3.0 type PHY (PIPE3) available with xhci */ xhci->shared_hcd->phy = devm_phy_get(pdev->dev.parent, "usb3-phy"); if (IS_ERR(xhci->shared_hcd->phy)) {