mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
phy: rockchip: inno-usb2: fix charger detection error
We found a charger detection error on RK3566 Tablet. 1. Plug in a Type-C to Type-A cable and connect to PC USB Host or USB charger, then the charger detection is normal. 2. Plug out the cable, then the charger disconnection detection is normal. 3. Plug in a Type-C to Type-A receptacle and plug out again. Then the charger is detected unexpectedly. To fix this issue, reinitialize the cable state of USB charger to EXTCON_NONE when USB charger is disconnected. Signed-off-by: William Wu <william.wu@rock-chips.com> Change-Id: Ic56e4ee865af129c222f4c90c3d6e753f4e785bd
This commit is contained in:
@@ -1125,11 +1125,14 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
|
||||
return;
|
||||
}
|
||||
|
||||
if (extcon_get_state(rphy->edev, cable) != rport->vbus_attached)
|
||||
if (extcon_get_state(rphy->edev, cable) != rport->vbus_attached) {
|
||||
extcon_set_state_sync(rphy->edev,
|
||||
cable, rport->vbus_attached);
|
||||
else if (rport->state == OTG_STATE_A_HOST &&
|
||||
extcon_get_state(rphy->edev, cable))
|
||||
|
||||
if (!rport->vbus_attached)
|
||||
cable = EXTCON_NONE;
|
||||
} else if (rport->state == OTG_STATE_A_HOST &&
|
||||
extcon_get_state(rphy->edev, cable)) {
|
||||
/*
|
||||
* If plug in OTG host cable when the rport state is
|
||||
* OTG_STATE_B_PERIPHERAL, the vbus voltage will stay
|
||||
@@ -1137,6 +1140,8 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
|
||||
* changed. We need to set cable state here.
|
||||
*/
|
||||
extcon_set_state_sync(rphy->edev, cable, false);
|
||||
cable = EXTCON_NONE;
|
||||
}
|
||||
|
||||
if (rphy->edev_self &&
|
||||
(extcon_get_state(rphy->edev, EXTCON_USB) !=
|
||||
|
||||
Reference in New Issue
Block a user