summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2024-02-20 17:26:25 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2024-02-20 17:26:25 +0100
commit56ad67babb7fbc461007632243e216a1c814d210 (patch)
tree4a8fc0150757c2892b869b8c10821aceaa4c7039
parent50b3a42d82f07083075f41a4391c6f20bb4aed7b (diff)
Revert "usb: phy: mxs: fix getting wrong state with mxs_phy_is_otg_host()"
This reverts commit 484ddaa90b7e8b40b0a479dfc24f0a1b9cd70e7d. Downstream NXP and stable have deviated to far, do not pull this in. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 7a7eb8af6044..8a262c5a0408 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -388,8 +388,14 @@ static void __mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool disconnect)
static bool mxs_phy_is_otg_host(struct mxs_phy *mxs_phy)
{
- return IS_ENABLED(CONFIG_USB_OTG) &&
- mxs_phy->phy.last_event == USB_EVENT_ID;
+ void __iomem *base = mxs_phy->phy.io_priv;
+ u32 phyctrl = readl(base + HW_USBPHY_CTRL);
+
+ if (IS_ENABLED(CONFIG_USB_OTG) &&
+ !(phyctrl & BM_USBPHY_CTRL_OTG_ID_VALUE))
+ return true;
+
+ return false;
}
static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on)