usb: chipidea: vbus event may exist before starting gadget
authorPeter Chen <peter.chen@nxp.com>
Wed, 19 Oct 2016 07:32:58 +0000 (15:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Oct 2017 08:14:18 +0000 (10:14 +0200)
commit7b8c9e6e0fca80c0da2ab94b5b1f96841f0c9be4
tree394ef9870d85169e4ea2c00cb15fedcccd38c56a
parent093fe104c5bbd99b4934bd80216b6e6d7371c4fc
usb: chipidea: vbus event may exist before starting gadget

[ Upstream commit c3b674a04b8ab62a1d35e86714d466af0a0ecc18 ]

At some situations, the vbus may already be there before starting
gadget. So we need to check vbus event after switching to gadget in
order to handle missing vbus event. The typical use cases are plugging
vbus cable before driver load or the vbus has already been there
after stopping host but before starting gadget.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Tested-by: Stephen Boyd <stephen.boyd@linaro.org>
Reported-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/otg.c