phy: rockchip-inno-usb2: reinit charge state when usb disconnect

When detect the usb peripheral disconnect from PC usb
host port or usb charger, we need to reinit the charge
state immediately, then it can do usb battery charge
detect work to get correct charge type if usb re-plug
in again in a short time.

Change-Id: I187f1d23a11b00f57e0a3699b6174cd7a59be3f1
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu 2017-11-21 17:35:11 +08:00 committed by Tao Huang
parent 16efe6c228
commit 6e3c63017e

View File

@ -1035,6 +1035,8 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
dev_dbg(&rport->phy->dev, "usb disconnect\n");
rport->state = OTG_STATE_B_IDLE;
rport->perip_connected = false;
rphy->chg_state = USB_CHG_STATE_UNDEFINED;
rphy->chg_type = POWER_SUPPLY_TYPE_UNKNOWN;
delay = OTG_SCHEDULE_DELAY * 2;
wake_unlock(&rport->wakelock);
}