Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: phy: mxs: disconnect line when USB charger is attached

For mxs PHY, if there is a vbus but the bus is not enumerated, we need
to force the dp/dm as SE0 from the controller side. If not, there is
possible USB wakeup due to unstable dp/dm, since there is possible no
pull on dp/dm, such as there is a USB charger on the port.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20230627110353.1879477-3-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Xu Yang and committed by
Greg Kroah-Hartman
87ed257a 5eda42ae

+3 -1
+3 -1
drivers/usb/phy/phy-mxs-usb.c
··· 395 395 static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on) 396 396 { 397 397 bool vbus_is_on = false; 398 + enum usb_phy_events last_event = mxs_phy->phy.last_event; 398 399 399 400 /* If the SoCs don't need to disconnect line without vbus, quit */ 400 401 if (!(mxs_phy->data->flags & MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS)) ··· 407 406 408 407 vbus_is_on = mxs_phy_get_vbus_status(mxs_phy); 409 408 410 - if (on && !vbus_is_on && !mxs_phy_is_otg_host(mxs_phy)) 409 + if (on && ((!vbus_is_on && !mxs_phy_is_otg_host(mxs_phy)) 410 + || (last_event == USB_EVENT_VBUS))) 411 411 __mxs_phy_disconnect_line(mxs_phy, true); 412 412 else 413 413 __mxs_phy_disconnect_line(mxs_phy, false);