summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-mvebu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-03-24 07:21:57 -0400
committerTom Rini <trini@konsulko.com>2017-03-24 07:21:57 -0400
commitc1daa4077365747d4f85ed8c93ba4d318d96a4af (patch)
tree4ac54134dd1970f7a98bcc3b9e225ea54d448f86 /drivers/usb/host/xhci-mvebu.c
parentd0ffda8ed208ff2957cd09ccc37e2d6dff81523e (diff)
parent60083261a1b33b492ddb5335c125f1223087068b (diff)
Merge git://www.denx.de/git/u-boot-marvell
This mainly adds support for some new boards, like the ARMv8 community boards MACCHIATOBin and ESPRESSBin
Diffstat (limited to 'drivers/usb/host/xhci-mvebu.c')
-rw-r--r--drivers/usb/host/xhci-mvebu.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c
index 46eb937838..d880af1113 100644
--- a/drivers/usb/host/xhci-mvebu.c
+++ b/drivers/usb/host/xhci-mvebu.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <fdtdec.h>
#include <usb.h>
+#include <power/regulator.h>
#include <asm/gpio.h>
#include "xhci.h"
@@ -44,12 +45,22 @@ static int xhci_usb_probe(struct udevice *dev)
struct mvebu_xhci_platdata *plat = dev_get_platdata(dev);
struct mvebu_xhci *ctx = dev_get_priv(dev);
struct xhci_hcor *hcor;
- int len;
+ int len, ret;
+ struct udevice *regulator;
ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));
hcor = (struct xhci_hcor *)((uintptr_t)ctx->hcd + len);
+ ret = device_get_supply_regulator(dev, "vbus-supply", &regulator);
+ if (!ret) {
+ ret = regulator_set_enable(regulator, true);
+ if (ret) {
+ printf("Failed to turn ON the VBUS regulator\n");
+ return ret;
+ }
+ }
+
/* Enable USB xHCI (VBUS, reset etc) in board specific code */
board_xhci_enable();