Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: webgeek1234@gmail.com, JC Kuo <jckuo@nvidia.com>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: 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 12:09:04 +0100	[thread overview]
Message-ID: <a9898a59-2dba-4ffd-a535-893eb989efc8@nvidia.com> (raw)
In-Reply-To: <20250404-xusb-peripheral-v1-1-99c184b9bf5f@gmail.com>



On 04/04/2025 09:17, Aaron Kling via B4 Relay wrote:
> From: Aaron Kling <webgeek1234@gmail.com>
> 
> Currently, if usb-role-switch is set and role-switch-default-mode is
> not, a xusb port will be inoperable until that port is hotplugged,
> because the driver defaults to role none. Instead of requiring all
> devices to set the default mode, assume that the port is primarily
> intended for use in device mode. This assumption already has precedence
> in the synopsys dwc3 driver.
> 
> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> ---
>   drivers/phy/tegra/xusb.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index 79d4814d758d5e1f0e8200d61e131606adbb0e2d..c56e83216d0f566a09b67377172fb04c8406f4cf 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -731,13 +731,11 @@ static void tegra_xusb_parse_usb_role_default_mode(struct tegra_xusb_port *port)
>   
>   	if (mode == USB_DR_MODE_HOST)
>   		role = USB_ROLE_HOST;
> -	else if (mode == USB_DR_MODE_PERIPHERAL)
> +	else
>   		role = USB_ROLE_DEVICE;

It would be simpler to initialise 'role' as USB_ROLE_DEVICE at the start 
of the function instead of USB_ROLE_NONE. A comment would also be good 
to why this is the default.

Jon

-- 
nvpublic


      parent reply	other threads:[~2025-05-06 11:09 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
2025-05-06 10:44             ` Aaron Kling
2025-05-06 11:04               ` Jon Hunter
2025-05-06 11:09 ` Jon Hunter [this message]

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=a9898a59-2dba-4ffd-a535-893eb989efc8@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