[PATCH v2 1/2] regulator: rzg2l: implement connectivity notification

Michele Bisogno micbis.openwrt at gmail.com
Thu Apr 16 16:44:25 CEST 2026


Implement CON_CTRL manual connectivity notification.
By setting SEL_CONNECT and CONNECT_1, the UTM+ core is notified of
connection status in peripheral mode.
---
 drivers/power/regulator/rzg2l-usbphy-regulator.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/power/regulator/rzg2l-usbphy-regulator.c b/drivers/power/regulator/rzg2l-usbphy-regulator.c
index 0354555d0b5..03f8dec4f08 100644
--- a/drivers/power/regulator/rzg2l-usbphy-regulator.c
+++ b/drivers/power/regulator/rzg2l-usbphy-regulator.c
@@ -9,16 +9,22 @@
 #include <renesas/rzg2l-usbphy.h>
 
 #define VBENCTL			0x03c
+#define CON_CTRL		0x020
 #define VBENCTL_VBUS_SEL	BIT(0)
+#define SEL_CONNECT		BIT(4)
+#define CONNECT_1		BIT(0)
 
 static int rzg2l_usbphy_regulator_set_enable(struct udevice *dev, bool enable)
 {
 	struct rzg2l_usbphy_ctrl_priv *priv = dev_get_priv(dev->parent);
 
-	if (enable)
+	if (enable) {
 		clrbits_le32(priv->regs + VBENCTL, VBENCTL_VBUS_SEL);
-	else
+		setbits_le32(priv->regs + CON_CTRL, SEL_CONNECT | CONNECT_1);
+	} else {
 		setbits_le32(priv->regs + VBENCTL, VBENCTL_VBUS_SEL);
+		clrbits_le32(priv->regs + CON_CTRL, SEL_CONNECT | CONNECT_1);
+	}
 
 	return 0;
 }
-- 
2.34.1



More information about the U-Boot mailing list