@@ -14,6 +14,8 @@
#include <usb/xhci.h>
+#include "phy.h"
+
struct mvebu_xhci_platdata {
fdt_addr_t hcd_base;
};
@@ -49,6 +51,10 @@ static int xhci_usb_probe(struct udevice *dev)
len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));
hcor = (struct xhci_hcor *)((uintptr_t)ctx->hcd + len);
+ ret = usb_phys_setup(dev);
+ if (ret)
+ return ret;
+
ret = device_get_supply_regulator(dev, "vbus-supply", ®ulator);
if (!ret) {
ret = regulator_set_enable(regulator, true);
@@ -64,6 +70,17 @@ static int xhci_usb_probe(struct udevice *dev)
return xhci_register(dev, ctx->hcd, hcor);
}
+static int xhci_usb_remove(struct udevice *dev)
+{
+ int ret;
+
+ ret = xhci_deregister(dev);
+ if (ret)
+ return ret;
+
+ return usb_phys_shutdown(dev);
+}
+
static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
{
struct mvebu_xhci_platdata *plat = dev_get_platdata(dev);
@@ -93,7 +110,7 @@ U_BOOT_DRIVER(usb_xhci) = {
.of_match = xhci_usb_ids,
.ofdata_to_platdata = xhci_usb_ofdata_to_platdata,
.probe = xhci_usb_probe,
- .remove = xhci_deregister,
+ .remove = xhci_usb_remove,
.ops = &xhci_usb_ops,
.platdata_auto_alloc_size = sizeof(struct mvebu_xhci_platdata),
.priv_auto_alloc_size = sizeof(struct mvebu_xhci),
Use the new usb_phys_setup and usb_phys_shutdown to initialize potential generic-phys in the xhci-mvebu driver. Signed-off-by: Marek Beh?n <marek.behun at nic.cz> --- drivers/usb/host/xhci-mvebu.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)