usb: rockchip-inno-usb2: check EXTCON_USB_VBUS_EN state in otg sm work

If extcon cable state is EXTCON_USB_VBUS_EN, it also means
that otg host connected, don't need to do charge detection.

Change-Id: Ie7c97c4cd0cfd2688edbfb3bbff93d2f58e9ef9a
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
Wu Liang feng
2016-10-15 12:18:43 +08:00
committed by Tao Huang
parent 1610160cdb
commit 68d99f33c8

View File

@@ -623,7 +623,8 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
rockchip_usb2phy_power_off(rport->phy);
/* fall through */
case OTG_STATE_B_IDLE:
if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) > 0) {
if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) > 0 ||
extcon_get_state(rphy->edev, EXTCON_USB_VBUS_EN) > 0 ) {
dev_dbg(&rport->phy->dev, "usb otg host connect\n");
rport->state = OTG_STATE_A_HOST;
rockchip_usb2phy_power_on(rport->phy);