usb: dwc3: gadget: change detemination method of connect status
authorMeng Dongyang <daniel.meng@rock-chips.com>
Fri, 2 Dec 2016 10:27:09 +0000 (18:27 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 8 Dec 2016 12:22:06 +0000 (20:22 +0800)
commit17edd1a0b675a73470f2db9c6fb7b3bf693a9b27
tree18c81f8c8028e8c6dc2fb732f73928ac0d7822b6
parent78c84e83bb530d10e7f811cd9fcbebbbd5eea87b
usb: dwc3: gadget: change detemination method of connect status

In current code, the connect status will be set to connected state when
reset interrupt occur and change to disconnected state in disconnect
interrupt.

But the usb charger may bring about reset signal in accident if we
connect and disconnect quickly. In this case, the dwc3 controller will
change link state and set to connect status, yet not change to
disconnected state when disconnect. So the dwc3 controller suspend
fail and result in a mistake when quick reconnect.

This patch set connect status to connected state when transfer complete
to make sure that usb is connect to PC exactly.

Change-Id: I8e5894d2e08b88bb5434222100d8f5c91c9f1a9d
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
drivers/usb/dwc3/gadget.c