diff options
author | Konstantin Porotchkin <kostap@marvell.com> | 2017-02-12 09:10:30 (GMT) |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2017-03-29 05:38:08 (GMT) |
commit | 137b1883e756f60ef4b1e1720dafcbf7d76d87c5 (patch) | |
tree | 9cf02f88151b946788d5e27e34ca156c68314e37 /drivers | |
parent | e562e51ee2cf82383aa60aea49f81753529c0433 (diff) | |
download | u-boot-137b1883e756f60ef4b1e1720dafcbf7d76d87c5.tar.xz |
mvebu: usb: xhci: Add VBUS regulator supply to the host driver
The USB device should linked to VBUS regulator through "vbus-supply"
DTS property.
This patch adds handling for "vbus-supply" property inside the USB
device entry for turning on the VBUS regulator upon the host adapter probe.
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Neta Zur Hershkovits <neta@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/Kconfig | 1 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mvebu.c | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 5129a57..0bf8274 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -25,6 +25,7 @@ config USB_XHCI_MVEBU bool "MVEBU USB 3.0 support" default y depends on ARCH_MVEBU + select DM_REGULATOR help Choose this option to add support for USB 3.0 driver on mvebu SoCs, which includes Armada8K, Armada3700 and other Armada diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c index 46eb937..d880af1 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", ®ulator); + 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(); |