usb: dwc2: disable erroneous overcurrent condition
authorDinh Nguyen <dinguyen@opensource.altera.com>
Sat, 5 Mar 2016 00:57:04 +0000 (18:57 -0600)
committerMarek Vasut <marex@denx.de>
Sat, 5 Mar 2016 01:21:36 +0000 (02:21 +0100)
For the case where an external VBUS is used, we should enable the external
VBUS comparator in the driver. This would prevent an unnecessary overcurrent
error which would then disable the host port.

The overcurrent condition was happening on the SoCFPGA Cyclone5 devkit, thus
USB was not working on the devkit. This patch fixes that problem.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
drivers/usb/host/dwc2.c
drivers/usb/host/dwc2.h

index c6727c381cbc4798632c75c13cf650e621b53f4d..b2f4bc685af165c535eb0ecc2e73f583a333a862 100644 (file)
@@ -263,7 +263,9 @@ static void dwc_otg_core_init(struct dwc2_core_regs *regs)
 
        /* Program the ULPI External VBUS bit if needed */
 #ifdef CONFIG_DWC2_PHY_ULPI_EXT_VBUS
-       usbcfg |= DWC2_GUSBCFG_ULPI_EXT_VBUS_DRV;
+       usbcfg |= (DWC2_GUSBCFG_ULPI_EXT_VBUS_DRV |
+                  DWC2_GUSBCFG_ULPI_INT_VBUS_INDICATOR |
+                  DWC2_GUSBCFG_INDICATOR_PASSTHROUGH);
 #else
        usbcfg &= ~DWC2_GUSBCFG_ULPI_EXT_VBUS_DRV;
 #endif
index 594757b609a9e2138c70646cfffb9e52ba85c97a..4482dc621d692f30445f28d56ff793ecbd844767 100644 (file)
@@ -152,6 +152,8 @@ struct dwc2_core_regs {
 #define DWC2_GUSBCFG_ULPI_INT_VBUS_INDICATOR_OFFSET    21
 #define DWC2_GUSBCFG_TERM_SEL_DL_PULSE                 (1 << 22)
 #define DWC2_GUSBCFG_TERM_SEL_DL_PULSE_OFFSET          22
+#define DWC2_GUSBCFG_INDICATOR_PASSTHROUGH             (1 << 24)
+#define DWC2_GUSBCFG_INDICATOR_PASSTHROUGH_OFFSET      24
 #define DWC2_GUSBCFG_IC_USB_CAP                                (1 << 26)
 #define DWC2_GUSBCFG_IC_USB_CAP_OFFSET                 26
 #define DWC2_GUSBCFG_IC_TRAFFIC_PULL_REMOVE            (1 << 27)