Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@kernel.org>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Vinod Koul <vkoul@kernel.org>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	 JC Kuo <jckuo@nvidia.com>,
	linux-phy@lists.infradead.org, linux-tegra@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: tegra: Clean-up Makefile for Tegra186
Date: Tue, 13 Oct 2026 18:07:31 +0200	[thread overview]
Message-ID: <as5WkN6Wt08TeRax@orome> (raw)
In-Reply-To: <20261012-tegra-phy-v1-1-3241bf3c86e9@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 3889 bytes --]

On Mon, Oct 12, 2026 at 12:16:31PM +0100, Jon Hunter wrote:
> The Makefile for the Tegra XUSB PHY driver has an entry for every Tegra
> SoC that compiles the xusb-tegra186.c file. Clean this up by adding a
> new Kconfig option called PHY_TEGRA186_XUSB that when defined compiles
> the xusb-tegra186.c file.
> 
> Finally, update the xusb.[ch] files to use this new config option as
> well instead of using the individual SoC Kconfig options.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/phy/tegra/Kconfig  |  6 ++++++
>  drivers/phy/tegra/Makefile |  6 +-----
>  drivers/phy/tegra/xusb.c   | 10 +---------
>  drivers/phy/tegra/xusb.h   | 10 +---------
>  4 files changed, 9 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/phy/tegra/Kconfig b/drivers/phy/tegra/Kconfig
> index b5ed5bc0c8ef..bc14c1c443b1 100644
> --- a/drivers/phy/tegra/Kconfig
> +++ b/drivers/phy/tegra/Kconfig
> @@ -11,6 +11,12 @@ config PHY_TEGRA_XUSB
>  	  To compile this driver as a module, choose M here: the module will
>  	  be called phy-tegra-xusb.
>  
> +config PHY_TEGRA186_XUSB
> +	bool
> +	default y if ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC || \
> +		     ARCH_TEGRA_234_SOC || ARCH_TEGRA_238_SOC || \
> +		     ARCH_TEGRA_264_SOC
> +
>  config PHY_TEGRA194_P2U
>  	tristate "NVIDIA Tegra194 PIPE2UPHY PHY driver"
>  	depends on ARCH_TEGRA || COMPILE_TEST
> diff --git a/drivers/phy/tegra/Makefile b/drivers/phy/tegra/Makefile
> index 018a4cab2b40..7d9c05149d6b 100644
> --- a/drivers/phy/tegra/Makefile
> +++ b/drivers/phy/tegra/Makefile
> @@ -5,10 +5,6 @@ phy-tegra-xusb-y += xusb.o
>  phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_124_SOC) += xusb-tegra124.o
>  phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_132_SOC) += xusb-tegra124.o
>  phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_210_SOC) += xusb-tegra210.o
> -phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_186_SOC) += xusb-tegra186.o
> -phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_194_SOC) += xusb-tegra186.o
> -phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_234_SOC) += xusb-tegra186.o
> -phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_238_SOC) += xusb-tegra186.o
> -phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_264_SOC) += xusb-tegra186.o
> +phy-tegra-xusb-$(CONFIG_PHY_TEGRA186_XUSB) += xusb-tegra186.o

I suppose that's one way of doing it, but I don't know if I see the
advantage in it. You're effectively trading 5 lines of Makefile for
6 lines of Kconfig.

>  obj-$(CONFIG_PHY_TEGRA194_P2U) += phy-tegra194-p2u.o
>  obj-$(CONFIG_PHY_TEGRA_MPHY) += phy-tegra-mphy.o
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index 89ce9ac87300..79a3624faa10 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -60,31 +60,23 @@ static const struct of_device_id tegra_xusb_padctl_of_match[] = {
>  		.data = &tegra210_xusb_padctl_soc,
>  	},
>  #endif
> -#if defined(CONFIG_ARCH_TEGRA_186_SOC)
> +#if defined(CONFIG_PHY_TEGRA186_XUSB)
>  	{
>  		.compatible = "nvidia,tegra186-xusb-padctl",
>  		.data = &tegra186_xusb_padctl_soc,
>  	},
> -#endif
> -#if defined(CONFIG_ARCH_TEGRA_194_SOC)
>  	{
>  		.compatible = "nvidia,tegra194-xusb-padctl",
>  		.data = &tegra194_xusb_padctl_soc,
>  	},
> -#endif
> -#if defined(CONFIG_ARCH_TEGRA_234_SOC)
>  	{
>  		.compatible = "nvidia,tegra234-xusb-padctl",
>  		.data = &tegra234_xusb_padctl_soc,
>  	},
> -#endif
> -#if defined(CONFIG_ARCH_TEGRA_238_SOC)
>  	{
>  		.compatible = "nvidia,tegra238-xusb-padctl",
>  		.data = &tegra238_xusb_padctl_soc,
>  	},
> -#endif
> -#if defined(CONFIG_ARCH_TEGRA_264_SOC)
>  	{
>  		.compatible = "nvidia,tegra264-xusb-padctl",
>  		.data = &tegra264_xusb_padctl_soc,

And this means you now get data for all SoCs as soon as one of them is
enabled. Yes, I know that most of the time we want to build multi-SoC
kernels anyway, but it now is not just a clean up anymore.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-10-13 16:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 11:16 [PATCH] phy: tegra: Clean-up Makefile for Tegra186 Jon Hunter
2026-10-13 16:07 ` Thierry Reding [this message]
2026-10-13 18:17   ` 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=as5WkN6Wt08TeRax@orome \
    --to=thierry.reding@kernel.org \
    --cc=jckuo@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=vkoul@kernel.org \
    /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