[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b96ab3b0-3afb-4918-8db8-f6cab45576fd@nvidia.com>
Date: Tue, 6 May 2025 11:30:24 +0100
From: Jon Hunter <jonathanh@...dia.com>
To: Aaron Kling <webgeek1234@...il.com>
Cc: JC Kuo <jckuo@...dia.com>, Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Thierry Reding <thierry.reding@...il.com>, linux-phy@...ts.infradead.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] phy: tegra: xusb: Default otg mode to peripheral
On 06/05/2025 11:03, Aaron Kling wrote:
...
>> Sorry for the delay. I have had a look at this patch and I am not sure
>> about this. The function you are changing is called
>> 'tegra_xusb_parse_usb_role_default_mode' and it is doing precisely what
>> it was intended to do. In other words, parse device-tree and set the
>> mode accordingly. So forcing the mode in this function does not feel
>> correct.
>>
>> Also from the description it is not 100% clear to me the exact scenario
>> where this is really a problem.
>
> My specific use case is booting AOSP/Android on Tegra devices using
> mainline support. Android debug bridge is configured to use xudc on
> the otg ports. As mainline is currently set up, the default usb role
> is 'none'. So if I boot a unit with a usb cable already plugged into
> the debug port, I cannot access adb.
>
> I originally fixed this by setting role-switch-default-mode in the
> device tree for every device I'm targeting. Then I looked at just
> defaulting to peripheral mode in code. And as mentioned in the commit
> message, other usb drivers already default to peripheral mode instead
> of none. I'm open to other solutions, but requiring every device tree
> to set a default role doesn't seem like a good solution either.
Thanks for the background. I see that the
Documentation/devicetree/bindings/usb/usb-drd.yaml states that ...
role-switch-default-mode:
description:
Indicates if usb-role-switch is enabled, the device default operation
mode of controller while usb role is USB_ROLE_NONE.
$ref: /schemas/types.yaml#/definitions/string
enum: [host, peripheral]
default: peripheral
Rather than reference 'synopsys dwc3' which is not related to the Tegra,
it would be better to update the binding doc for Tegra XUSB padctl device
to list this property and define the default mode.
Jon
--
nvpublic
Powered by blists - more mailing lists