mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
phy: rockchip: inno-usb2: fix incorrect perip_connected
The U2PHY sent "peripheral connected" extcon message to DWC3 even if
there is no USB cable pluuged when the otg_sm_work is scheduled first
time, this would be resumed DWC3 unexpectedly and cause the DWC3 gadget
to incorrect state. So initialize the perip_connected to false before
send the extcon message to fix it.
This can fix the ADB can not be enumerated when plug the USB cable
in the first time after the system boot up and the below messages
may find in the Kernel log on RK3562-EVB2 board.
[ 7.218101] read descriptors
[ 7.218191] read strings
[ 7.306784] dwc3 fe500000.usb: failed to enable ep0out
Fixes: 00168bb5b5 ("phy: rockchip: inno-usb2: fix otg port with vbus always on")
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I90209f15605d16ca746dd6c44fbaf6d9c1684eaa
This commit is contained in:
@@ -1291,6 +1291,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
|
||||
} else {
|
||||
rphy->chg_state = USB_CHG_STATE_UNDEFINED;
|
||||
rphy->chg_type = POWER_SUPPLY_TYPE_UNKNOWN;
|
||||
rport->perip_connected = false;
|
||||
mutex_unlock(&rport->mutex);
|
||||
if (!rport->dis_u2_susphy)
|
||||
rockchip_usb2phy_power_off(rport->phy);
|
||||
|
||||
Reference in New Issue
Block a user