All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sunxi: Remove misleading USB-OTG charger message
@ 2021-11-04  1:01 Andre Przywara
  2021-12-07  6:30 ` Jagan Teki
  0 siblings, 1 reply; 2+ messages in thread
From: Andre Przywara @ 2021-11-04  1:01 UTC (permalink / raw)
  To: Jagan Teki
  Cc: u-boot, Samuel Holland, Chen-Yu Tsai, Icenowy Zheng, Maxime Ripard

The sunxi MUSB glue driver has some code to check for external VBUS
presence when it's going to use the MUSB host mode, and it warns if
there is VBUS provided through the cable (in sunxi_musb_enable()).

This code was apparently copied to the USB gadget detection code
(g_dnl_board_usb_cable_connected()), but here we actually *expect*
external VBUS power, so a warning is wrong and confusing.
So far this message rarely triggered, but a recent patch (6fa41cdd19b9)
changed this:
===========================
=> ums 0 mmc 2
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0xe90000
A charger is plugged into the OTG
/A charger is plugged into the OTG
\A charger is plugged into the OTG
|A charger is plugged into the OTG
-A charger is plugged into the OTG
....
===========================

Remove the message for the gadget cable detection call, and just return
the status of the VBUS detection, as this is what the callers are after.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 board/sunxi/board.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 4f5747c34a9..fdbcd402693 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -698,13 +698,7 @@ int g_dnl_board_usb_cable_connected(void)
 		return ret;
 	}
 
-	ret = sun4i_usb_phy_vbus_detect(&phy);
-	if (ret == 1) {
-		pr_err("A charger is plugged into the OTG\n");
-		return -ENODEV;
-	}
-
-	return ret;
+	return sun4i_usb_phy_vbus_detect(&phy);
 }
 #endif
 
-- 
2.17.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sunxi: Remove misleading USB-OTG charger message
  2021-11-04  1:01 [PATCH] sunxi: Remove misleading USB-OTG charger message Andre Przywara
@ 2021-12-07  6:30 ` Jagan Teki
  0 siblings, 0 replies; 2+ messages in thread
From: Jagan Teki @ 2021-12-07  6:30 UTC (permalink / raw)
  To: Andre Przywara
  Cc: u-boot, Samuel Holland, Chen-Yu Tsai, Icenowy Zheng, Maxime Ripard

On Thu, Nov 4, 2021 at 6:32 AM Andre Przywara <andre.przywara@arm.com> wrote:
>
> The sunxi MUSB glue driver has some code to check for external VBUS
> presence when it's going to use the MUSB host mode, and it warns if
> there is VBUS provided through the cable (in sunxi_musb_enable()).
>
> This code was apparently copied to the USB gadget detection code
> (g_dnl_board_usb_cable_connected()), but here we actually *expect*
> external VBUS power, so a warning is wrong and confusing.
> So far this message rarely triggered, but a recent patch (6fa41cdd19b9)
> changed this:
> ===========================
> => ums 0 mmc 2
> UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0xe90000
> A charger is plugged into the OTG
> /A charger is plugged into the OTG
> \A charger is plugged into the OTG
> |A charger is plugged into the OTG
> -A charger is plugged into the OTG
> ....
> ===========================
>
> Remove the message for the gadget cable detection call, and just return
> the status of the VBUS detection, as this is what the callers are after.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-07  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04  1:01 [PATCH] sunxi: Remove misleading USB-OTG charger message Andre Przywara
2021-12-07  6:30 ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.