From: Wu Liang feng Date: Sat, 15 Oct 2016 04:18:43 +0000 (+0800) Subject: usb: rockchip-inno-usb2: check EXTCON_USB_VBUS_EN state in otg sm work X-Git-Tag: firefly_0821_release~1392 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cfe5a90196a067846339b0ca29eec2aff456d971;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c index e9a5f51c9146..5f0066206483 100644 --- a/drivers/phy/phy-rockchip-inno-usb2.c +++ b/drivers/phy/phy-rockchip-inno-usb2.c @@ -603,7 +603,9 @@ 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_cable_state_(rphy->edev, EXTCON_USB_HOST) > 0) { + if (extcon_get_cable_state_(rphy->edev, EXTCON_USB_HOST) > 0 || + extcon_get_cable_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);