Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH] phy: tegra: xusb: Default otg mode to peripheral
@ 2025-04-04  8:17 Aaron Kling via B4 Relay
  2025-04-14  4:45 ` Aaron Kling
  2025-05-06 11:09 ` Jon Hunter
  0 siblings, 2 replies; 10+ messages in thread
From: Aaron Kling via B4 Relay @ 2025-04-04  8:17 UTC (permalink / raw)
  To: JC Kuo, Vinod Koul, Kishon Vijay Abraham I, Thierry Reding,
	Jonathan Hunter
  Cc: linux-phy, linux-tegra, linux-kernel, Aaron Kling

From: Aaron Kling <webgeek1234@gmail.com>

Currently, if usb-role-switch is set and role-switch-default-mode is
not, a xusb port will be inoperable until that port is hotplugged,
because the driver defaults to role none. Instead of requiring all
devices to set the default mode, assume that the port is primarily
intended for use in device mode. This assumption already has precedence
in the synopsys dwc3 driver.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
 drivers/phy/tegra/xusb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 79d4814d758d5e1f0e8200d61e131606adbb0e2d..c56e83216d0f566a09b67377172fb04c8406f4cf 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -731,13 +731,11 @@ static void tegra_xusb_parse_usb_role_default_mode(struct tegra_xusb_port *port)
 
 	if (mode == USB_DR_MODE_HOST)
 		role = USB_ROLE_HOST;
-	else if (mode == USB_DR_MODE_PERIPHERAL)
+	else
 		role = USB_ROLE_DEVICE;
 
-	if (role != USB_ROLE_NONE) {
-		usb_role_switch_set_role(port->usb_role_sw, role);
-		dev_dbg(&port->dev, "usb role default mode is %s", modes[mode]);
-	}
+	usb_role_switch_set_role(port->usb_role_sw, role);
+	dev_dbg(&port->dev, "usb role default mode is %s", modes[mode]);
 }
 
 static int tegra_xusb_usb2_port_parse_dt(struct tegra_xusb_usb2_port *usb2)

---
base-commit: 91e5bfe317d8f8471fbaa3e70cf66cae1314a516
change-id: 20250404-xusb-peripheral-c45b1637f33b

Best regards,
-- 
Aaron Kling <webgeek1234@gmail.com>



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

end of thread, other threads:[~2025-05-06 11:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04  8:17 [PATCH] phy: tegra: xusb: Default otg mode to peripheral Aaron Kling via B4 Relay
2025-04-14  4:45 ` Aaron Kling
2025-04-21  1:44   ` Aaron Kling
2025-05-05  7:44     ` Aaron Kling
2025-05-06  9:51       ` Jon Hunter
2025-05-06 10:03         ` Aaron Kling
2025-05-06 10:30           ` Jon Hunter
2025-05-06 10:44             ` Aaron Kling
2025-05-06 11:04               ` Jon Hunter
2025-05-06 11:09 ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox