phy: phy-rockchip-naneng-usb2: update USB_DCP state if cable plug-out

The *USB_DCP* should be updated when the cable plug out from dedicated
charging port. As a result, the charger could set the charging current
by *EXTCON_CHG_USB_DCP*.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I478e584552a627de928378c6da1e6392a8fb04c4
This commit is contained in:
Ziyuan Xu
2020-11-12 17:50:54 +08:00
committed by Tao Huang
parent 8334797c5f
commit 0f8f894bb7

View File

@@ -951,8 +951,11 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
break;
}
} else {
if (!rport->perip_connected)
if (!rport->perip_connected) {
if (extcon_get_state(rphy->edev, EXTCON_CHG_USB_DCP) > 0)
extcon_set_state_sync(rphy->edev, EXTCON_CHG_USB_DCP, 0);
return;
}
dev_dbg(&rport->phy->dev, "usb peripheral disconnect\n");
wake_unlock(&rport->wakelock);