forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
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)