usb: dwc2: Properly account for the force mode delays
authorJohn Youn <johnyoun@synopsys.com>
Thu, 8 Sep 2016 02:39:43 +0000 (19:39 -0700)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 8 Sep 2016 11:02:54 +0000 (14:02 +0300)
commit2938fc63e0c26bf694436ac81bc776c8b7eced0c
tree46b4d9f5763f7cd6e37aade7db3fd948d78fbe77
parentfef6bc37dbafe0d6d71c808c8867a8c5ab4b9816
usb: dwc2: Properly account for the force mode delays

When a force mode bit is set and the IDDIG debounce filter is enabled,
there is a delay for the forced mode to take effect. This delay is due
to the IDDIG debounce filter and is variable depending on the platform's
PHY clock speed. To account for this delay we can poll for the expected
mode.

On a clear force mode, since we don't know what mode to poll for, delay
for a fixed 100 ms. This is the maximum delay based on the slowest PHY
clock speed.

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/core.c