1 --- a/drivers/usb/host/xhci-plat.c
2 +++ b/drivers/usb/host/xhci-plat.c
4 #include <linux/module.h>
6 #include <linux/platform_device.h>
7 +#include <linux/usb/phy.h>
8 #include <linux/slab.h>
9 #include <linux/usb/xhci_pdriver.h>
11 @@ -158,12 +159,27 @@ static int xhci_plat_probe(struct platfo
12 if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
13 xhci->shared_hcd->can_do_streams = 1;
15 + hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
16 + if (IS_ERR(hcd->usb_phy)) {
17 + ret = PTR_ERR(hcd->usb_phy);
18 + if (ret == -EPROBE_DEFER)
20 + hcd->usb_phy = NULL;
22 + ret = usb_phy_init(hcd->usb_phy);
27 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
30 + goto disable_usb_phy;
35 + usb_phy_shutdown(hcd->usb_phy);
38 usb_put_hcd(xhci->shared_hcd);
40 @@ -187,6 +203,7 @@ static int xhci_plat_remove(struct platf
41 struct clk *clk = xhci->clk;
43 usb_remove_hcd(xhci->shared_hcd);
44 + usb_phy_shutdown(hcd->usb_phy);
45 usb_put_hcd(xhci->shared_hcd);