Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH] phy: tegra: Clean-up Makefile for Tegra186
@ 2026-10-12 11:16 Jon Hunter
  2026-10-13 16:07 ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Hunter @ 2026-10-12 11:16 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Thierry Reding,
	JC Kuo
  Cc: linux-phy, linux-tegra, linux-kernel, Jon Hunter

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
 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,
diff --git a/drivers/phy/tegra/xusb.h b/drivers/phy/tegra/xusb.h
index b9de4f3b5781..086bb2d09bda 100644
--- a/drivers/phy/tegra/xusb.h
+++ b/drivers/phy/tegra/xusb.h
@@ -505,19 +505,11 @@ extern const struct tegra_xusb_padctl_soc tegra124_xusb_padctl_soc;
 #if defined(CONFIG_ARCH_TEGRA_210_SOC)
 extern const struct tegra_xusb_padctl_soc tegra210_xusb_padctl_soc;
 #endif
-#if defined(CONFIG_ARCH_TEGRA_186_SOC)
+#if defined(CONFIG_PHY_TEGRA186_XUSB)
 extern const struct tegra_xusb_padctl_soc tegra186_xusb_padctl_soc;
-#endif
-#if defined(CONFIG_ARCH_TEGRA_194_SOC)
 extern const struct tegra_xusb_padctl_soc tegra194_xusb_padctl_soc;
-#endif
-#if defined(CONFIG_ARCH_TEGRA_234_SOC)
 extern const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc;
-#endif
-#if defined(CONFIG_ARCH_TEGRA_238_SOC)
 extern const struct tegra_xusb_padctl_soc tegra238_xusb_padctl_soc;
-#endif
-#if defined(CONFIG_ARCH_TEGRA_264_SOC)
 extern const struct tegra_xusb_padctl_soc tegra264_xusb_padctl_soc;
 #endif
 

---
base-commit: becb95e45ef0dda9ffb35156d909d3da7a2789c3
change-id: 20261012-tegra-phy-e951c11e733c

Best regards,
--  
Jon Hunter <jonathanh@nvidia.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: tegra: Clean-up Makefile for Tegra186
  2026-10-12 11:16 [PATCH] phy: tegra: Clean-up Makefile for Tegra186 Jon Hunter
@ 2026-10-13 16:07 ` Thierry Reding
  2026-10-13 18:17   ` Jon Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2026-10-13 16:07 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, JC Kuo,
	linux-phy, linux-tegra, linux-kernel

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: tegra: Clean-up Makefile for Tegra186
  2026-10-13 16:07 ` Thierry Reding
@ 2026-10-13 18:17   ` Jon Hunter
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Hunter @ 2026-10-13 18:17 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, JC Kuo,
	linux-phy, linux-tegra, linux-kernel


On 13/10/2026 17:07, Thierry Reding wrote:
> 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>

...

>> 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.
So you already get all the data for all the SoCs. This is simply
populating the compatible string and pointer for the data structure in
the match table.

Prior to commit 8f56fdf3d8cb ("phy: tegra: Add support for Tegra238 XUSB
pad controller") it was possible to only have some of the SoC data
present, however, due to all the inter-dependencies between all the
underlying structures, IMO it became pointless and messy.

So I still see this as a clean-up overall.

Jon

-- 
nvpublic


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-13 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 11:16 [PATCH] phy: tegra: Clean-up Makefile for Tegra186 Jon Hunter
2026-10-13 16:07 ` Thierry Reding
2026-10-13 18:17   ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox