[PATCH] usb: dwc3-generic: use DR_MODE_OTG when dr_mode isn't specified

Neil Armstrong neil.armstrong at linaro.org
Wed Oct 16 15:49:11 CEST 2024


Hi,

On 16/10/2024 13:22, Marek Vasut wrote:
> On 10/16/24 10:26 AM, Neil Armstrong wrote:
>> The USB DRD bindingsa at [1] are clear, if not specified the dr_mode
>> property defaults to otg, and this is how Linux behaves.
>>
>> A cleanup is ongoing on the Linux Device Trees to remove dr_mode when
>> set to "otg", so take this in account and do not fail anymore when
>> dr_mode isn't specified in the glue or dwc3 node.
>>
>> [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb-drd.yaml
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong at linaro.org>
> Is there a matching Linux kernel commit which implements this behavior in Linux ?

In DWC3, the logic is there since v3.12-rc1 in commit a45c82b84c844 ("usb: dwc3: adapt to use dr_mode device tree helper") [1]

```
if (dwc->dr_mode == USB_DR_MODE_UNKNOWN)
	dwc->dr_mode = USB_DR_MODE_OTG;
```

[1] https://github.com/torvalds/linux/commit/a45c82b84c844cd85b2ed1aa32596f1bffa32716

Neil


More information about the U-Boot mailing list