From d1bdca4eb6de0b87dc14cf615d61ed08e6c3c5c3 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Fri, 29 Sep 2017 18:58:42 +0200 Subject: [wip: needs rewrite] xhci roothub FEAT_POWER change --- drivers/usb/host/xhci.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index efb075b006..6a34f05753 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -30,6 +30,7 @@ #include #include #include "xhci.h" +#include #ifndef CONFIG_USB_MAX_CONTROLLER_COUNT #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 @@ -48,7 +49,7 @@ static struct descriptor { 0x2a, /* bDescriptorType: hub descriptor */ 2, /* bNrPorts -- runtime modified */ cpu_to_le16(0x8), /* wHubCharacteristics */ - 10, /* bPwrOn2PwrGood */ + 20, /* bPwrOn2PwrGood */ 0, /* bHubCntrCurrent */ { /* Device removable */ } /* at most 7 ports! XXX */ @@ -1036,6 +1037,18 @@ static int xhci_submit_root(struct usb_device *udev, unsigned long pipe, xhci_writel(status_reg, reg); break; case USB_PORT_FEAT_POWER: + // if (le16_to_cpu(req->index) == 1) + { + struct udevice *regulator; + int ret = regulator_get_by_platname("usbhub_enable", ®ulator); + if (ret) { + printf("*** could not get 'usbhub_enable' regulator\n"); + } else { + // regulator_set_enable(regulator, false); + // udelay(100); + regulator_set_enable(regulator, false); + } + } reg |= PORT_POWER; xhci_writel(status_reg, reg); break; -- cgit v1.2.3