* [PATCH] phy: sun4i-usb: Avoid polling just for ID pin without OTG mode
@ 2026-12-06 4:31 Chen-Yu Tsai
0 siblings, 0 replies; only message in thread
From: Chen-Yu Tsai @ 2026-12-06 4:31 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland
Cc: linux-phy, linux-arm-kernel, linux-sunxi, Ondřej Jirman,
Andre Przywara
On some devices only the ID pin is hooked up, and there is no VBUS
sensing or control, with VBUS directly tied to system 5V. On these
devices we typically just force the OTG controller to host mode only.
There is no point in polling just the ID pin if the result is never
going to be used. So skip polling if the mode is not OTG and the ID pin
is the only thing that needs to be polled.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
drivers/phy/allwinner/phy-sun4i-usb.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index f26eed0db17e..66454653bfc4 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -441,8 +441,11 @@ static bool sun4i_usb_phy0_have_vbus_det(struct sun4i_usb_phy_data *data)
static bool sun4i_usb_phy0_poll(struct sun4i_usb_phy_data *data)
{
- if ((data->id_det_gpio && data->id_det_irq <= 0) ||
- (data->vbus_det_gpio && data->vbus_det_irq <= 0))
+ if (data->dr_mode == USB_DR_MODE_OTG &&
+ data->id_det_gpio && data->id_det_irq <= 0)
+ return true;
+
+ if (data->vbus_det_gpio && data->vbus_det_irq <= 0)
return true;
/*
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-06 4:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06 4:31 [PATCH] phy: sun4i-usb: Avoid polling just for ID pin without OTG mode Chen-Yu Tsai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox