From: Jon Hunter <jonathanh@nvidia.com>
To: Aaron Kling <webgeek1234@gmail.com>
Cc: JC Kuo <jckuo@nvidia.com>, Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
linux-phy@lists.infradead.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: tegra: xusb: Default otg mode to peripheral
Date: Tue, 6 May 2025 11:30:24 +0100 [thread overview]
Message-ID: <b96ab3b0-3afb-4918-8db8-f6cab45576fd@nvidia.com> (raw)
In-Reply-To: <CALHNRZ8uXZQObwQBC-sLudUdtprM24qU5yYdb4D3FEP2AQVkmQ@mail.gmail.com>
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
next prev parent reply other threads:[~2025-05-06 10:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-05-06 10:44 ` Aaron Kling
2025-05-06 11:04 ` Jon Hunter
2025-05-06 11:09 ` Jon Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b96ab3b0-3afb-4918-8db8-f6cab45576fd@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=jckuo@nvidia.com \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=vkoul@kernel.org \
--cc=webgeek1234@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox