UPSTREAM: usb: dwc2: Restore GUSBCFG in dwc2_get_hwparams()
authorJacob Chen <jacob2.chen@rock-chips.com>
Tue, 16 Aug 2016 01:15:55 +0000 (09:15 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 18 Aug 2016 10:48:09 +0000 (18:48 +0800)
commit186b8dd21c19106cf685c5de31a1b69f2e54eeff
tree9b047f9473e7341d018acc184fb5ed540b1ed0da
parent6fd9def28b7a1cc8763113ca0fb52e594d874568
UPSTREAM: usb: dwc2: Restore GUSBCFG in dwc2_get_hwparams()

Previously dwc2_get_hwparams() was changing GUSBCFG and not putting it
back the way it was (specifically it set and cleared FORCEHOSTMODE).
Since we want to move dwc2_core_reset() _before_ dwc2_get_hwparams() we
should make sure dwc2_get_hwparams() isn't messing with things in a
permanent way.

Since we're now looking at GUSBCFG, it's obvious that we shouldn't need
all the extra delays if FORCEHOSTMODE was already set.  This will avoid
some delays for any ports that have forced host mode.

Change-Id: I514aaaf77a7ee3f0871efb15e659b93b9717c5f1
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 991824677fe0a555394d8093b64647dbd08b89b0)
drivers/usb/dwc2/core.c