forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/usb/phy/phy-mxs-usb.c
....@@ -388,14 +388,8 @@
388388
389389 static bool mxs_phy_is_otg_host(struct mxs_phy *mxs_phy)
390390 {
391
- void __iomem *base = mxs_phy->phy.io_priv;
392
- u32 phyctrl = readl(base + HW_USBPHY_CTRL);
393
-
394
- if (IS_ENABLED(CONFIG_USB_OTG) &&
395
- !(phyctrl & BM_USBPHY_CTRL_OTG_ID_VALUE))
396
- return true;
397
-
398
- return false;
391
+ return IS_ENABLED(CONFIG_USB_OTG) &&
392
+ mxs_phy->phy.last_event == USB_EVENT_ID;
399393 }
400394
401395 static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on)