[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALHNRZ9tgWTo8tUB1+Whf68CYu+qiMhO_S+KC2R0kFbDAjT9OQ@mail.gmail.com>
Date: Tue, 6 May 2025 05:44:53 -0500
From: Aaron Kling <webgeek1234@...il.com>
To: Jon Hunter <jonathanh@...dia.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 Tue, May 6, 2025 at 5:30 AM Jon Hunter <jonathanh@...dia.com> wrote:
>
>
> 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.
Let me make sure I understand you correctly. You're requesting to
update the binding as above, listing peripheral as default when unset;
fix my commit message; and leave my code change as-is? I'm unclear on
if the code is okay as-is or not.
Sincerely,
Aaron Kling
Powered by blists - more mailing lists