UPSTREAM: usb: dwc2: Speed dwc2_get_hwparams() on some host-only ports
authorJacob Chen <jacob2.chen@rock-chips.com>
Tue, 16 Aug 2016 01:11:25 +0000 (09:11 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 18 Aug 2016 10:49:11 +0000 (18:49 +0800)
commit5605cf91799dcfa245a70e3c03ad26291dd34839
tree39fe43a2712b9a8d729337fa2ad4c7d82f9488c6
parente8ef004a4954d5f5fa44b06e0c47c411e3c7f458
UPSTREAM: 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().

Change-Id: I912ac2dd5e0ff3f8c12b8263ce268296bbed315f
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
(cherry picked from commit f619473140df4e1a10f4c10f693d214807ebdb03)
drivers/usb/dwc2/core.c