]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc2: Speed dwc2_get_hwparams() on some host-only ports
authorDouglas Anderson <dianders@chromium.org>
Thu, 17 Dec 2015 19:14:54 +0000 (11:14 -0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 22 Dec 2015 17:53:01 +0000 (11:53 -0600)
commitc376a15c4b3fac237359af8872ce48df91769630
tree2544da8288077d9547ae5a4d749692440411511a
parenta4c545ea569b32d7fbd5558a01d91949a68dca4e
usb: dwc2: Speed dwc2_get_hwparams() on some host-only ports

On some host-only DWC2 ports (like the one in rk3288) when we set
GUSBCFG_FORCEHOSTMODE in GUSBCFG and then read back, we don't see the
bit set.  Presumably that's because the port is always forced to HOST
mode so there's no reason to implement these status bits.

Since we know dwc2_core_reset() is always called before
dwc2_get_hwparams() and we know dwc2_core_reset() should have set
GUSBCFG_FORCEHOSTMODE whenever hsotg->dr_mode == USB_DR_MODE_HOST, we
can just check hsotg->dr_mode to decide that we can skip the delays in
dwc2_get_hwparams().

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/core.c