diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-09-29 18:58:42 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-10-02 11:20:57 +0200 |
commit | d1bdca4eb6de0b87dc14cf615d61ed08e6c3c5c3 (patch) | |
tree | e506f03931111a14e252184c8498452e0b50a196 | |
parent | 8954d498f99dcc53bce824a39fa682bd61f0aa75 (diff) |
[wip: needs rewrite] xhci roothub FEAT_POWER change
-rw-r--r-- | drivers/usb/host/xhci.c | 15 |
1 files changed, 14 insertions, 1 deletions
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 <asm/unaligned.h> #include <linux/errno.h> #include "xhci.h" +#include <power/regulator.h> #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; |