[PATCH] phy: tegra: Clean-up Makefile for Tegra186

Thierry Reding thierry.reding at kernel.org
Tue Oct 13 09:07:31 PDT 2026


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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-phy/attachments/20261013/b511682e/attachment-0001.sig>


More information about the linux-phy mailing list