Siddharth Vadapalli bfb530e06c usb: cdns3: use VBUS Valid to determine role for dr_mode OTG
The cdns3_bind() function is responsible for identifying the appropriate
driver to bind to the USB Controller's device-tree node. If the device-tree
node has the 'dr_mode' property set to 'otg', the existing approach fails
to bind a driver, leading to loss of functionality.

To address this, use the VBUS Valid field of the OTG Status register to
determine the role as follows:
- If VBUS Valid field is set, it indicates that a USB Host is supplying
  power and the Controller should assume the Peripheral role.
- If VBUS Valid field is clear, it indicates the absence of a USB Host and
  the Controller should assume the Host role.

Additionally, when 'dr_mode' happens to be 'otg' and the STRAP settings
are not specified, use VBUS Valid to determine the role in cdns3_drd_init()
and assign it to cdns->dr_mode.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
2026-02-16 15:08:43 +01:00
..
2025-10-30 12:32:12 -06:00
2026-01-15 09:25:21 +01:00
2026-01-21 12:05:15 -06:00
2026-01-02 15:51:54 -06:00
2025-08-27 15:49:59 +08:00
2025-08-14 10:58:46 -06:00
2026-01-14 16:25:09 +01:00
2025-10-14 10:42:27 +03:00
2026-02-02 14:24:40 -06:00
2025-11-07 15:34:22 -06:00