Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/3] phy: tegra: xusb: Add Tegra238 support
@ 2026-09-21 12:14 Jon Hunter
  2026-09-21 12:14 ` [PATCH 1/3] dt-bindings: phy: tegra194: Add compatible for Tegra238 Jon Hunter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jon Hunter @ 2026-09-21 12:14 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thierry Reding, JC Kuo
  Cc: Thierry Reding, Wayne Chang, linux-phy, devicetree, linux-tegra,
	Jon Hunter

Add support for the Tegra238 device to the Tegra XUSB PHY driver and
add the necessary device-tree binding documentation for this device.

This series also includes a trivial clean-up patch to use the
dev_err_probe() function in the Tegra XUSB PHY driver instead of open
coding this function.

This series is based on top of the series that adds support for the
Tegra264 device to the Tegra XUSB PHY driver [0].

[0] https://lore.kernel.org/linux-tegra/20260903071937.533646-1-waynec@nvidia.com/

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
Jon Hunter (3):
      dt-bindings: phy: tegra194: Add compatible for Tegra238
      phy: tegra: xusb: Use dev_err_probe()
      phy: tegra: Add support for Tegra238 XUSB pad controller

 .../bindings/phy/nvidia,tegra194-xusb-padctl.yaml  | 38 ++++++++++++++++++++++
 drivers/phy/tegra/xusb-tegra186.c                  | 29 +++++++++++++----
 drivers/phy/tegra/xusb.c                           | 15 +++++----
 drivers/phy/tegra/xusb.h                           |  3 ++
 4 files changed, 72 insertions(+), 13 deletions(-)
---
base-commit: e657a464aba873f5eaf3ca821b6e4016674492d6
change-id: 20260918-tegra-phy-1611f1d54afa
prerequisite-message-id: <20260903071937.533646-1-waynec@nvidia.com>
prerequisite-patch-id: 4d5aee86ddf39567e3751c3e3067d9381635de46
prerequisite-patch-id: 532f630446505f9258dee65ab43887fc3cf877e0
prerequisite-patch-id: 4660a52fe6277f5d91ee70cee0b74280a8ce927e
prerequisite-patch-id: d58ecf03061a3c26f4f0a71f2dd5c97a673e23eb

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


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

* [PATCH 1/3] dt-bindings: phy: tegra194: Add compatible for Tegra238
  2026-09-21 12:14 [PATCH 0/3] phy: tegra: xusb: Add Tegra238 support Jon Hunter
@ 2026-09-21 12:14 ` Jon Hunter
  2026-09-25 13:31   ` Krzysztof Kozlowski
  2026-09-21 12:14 ` [PATCH 2/3] phy: tegra: xusb: Use dev_err_probe() Jon Hunter
  2026-09-21 12:14 ` [PATCH 3/3] phy: tegra: Add support for Tegra238 XUSB pad controller Jon Hunter
  2 siblings, 1 reply; 6+ messages in thread
From: Jon Hunter @ 2026-09-21 12:14 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thierry Reding, JC Kuo
  Cc: Thierry Reding, Wayne Chang, linux-phy, devicetree, linux-tegra,
	Jon Hunter

The Tegra238 XUSB pad controller is similar to that found on the
Tegra194 and Tegra234, but only has three USB2 ports and three USB3
ports.

Add the Tegra238 compatible string for the XUSB pad controller and
constrain the binding so that a Tegra238 device tree can only have three
USB2 and three USB3 ports.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 .../bindings/phy/nvidia,tegra194-xusb-padctl.yaml  | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra194-xusb-padctl.yaml b/Documentation/devicetree/bindings/phy/nvidia,tegra194-xusb-padctl.yaml
index f6fe3c90b5b0..fbafe8eb150b 100644
--- a/Documentation/devicetree/bindings/phy/nvidia,tegra194-xusb-padctl.yaml
+++ b/Documentation/devicetree/bindings/phy/nvidia,tegra194-xusb-padctl.yaml
@@ -45,6 +45,7 @@ properties:
     enum:
       - nvidia,tegra194-xusb-padctl
       - nvidia,tegra234-xusb-padctl
+      - nvidia,tegra238-xusb-padctl
       - nvidia,tegra264-xusb-padctl
 
   reg:
@@ -542,6 +543,43 @@ properties:
             description: connection to a USB Type C controller
             $ref: /schemas/graph.yaml#/properties/port
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra238-xusb-padctl
+    then:
+      properties:
+        pads:
+          properties:
+            usb2:
+              properties:
+                lanes:
+                  properties:
+                    usb2-3: false
+            usb3:
+              properties:
+                lanes:
+                  properties:
+                    usb3-3: false
+        ports:
+          properties:
+            usb2-3: false
+            usb3-0:
+              properties:
+                nvidia,usb2-companion:
+                  enum: [ 0, 1, 2 ]
+            usb3-1:
+              properties:
+                nvidia,usb2-companion:
+                  enum: [ 0, 1, 2 ]
+            usb3-2:
+              properties:
+                nvidia,usb2-companion:
+                  enum: [ 0, 1, 2 ]
+            usb3-3: false
+
 additionalProperties: false
 
 required:

-- 
2.43.0


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

* [PATCH 2/3] phy: tegra: xusb: Use dev_err_probe()
  2026-09-21 12:14 [PATCH 0/3] phy: tegra: xusb: Add Tegra238 support Jon Hunter
  2026-09-21 12:14 ` [PATCH 1/3] dt-bindings: phy: tegra194: Add compatible for Tegra238 Jon Hunter
@ 2026-09-21 12:14 ` Jon Hunter
  2026-09-23  6:36   ` Jon Hunter
  2026-09-21 12:14 ` [PATCH 3/3] phy: tegra: Add support for Tegra238 XUSB pad controller Jon Hunter
  2 siblings, 1 reply; 6+ messages in thread
From: Jon Hunter @ 2026-09-21 12:14 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thierry Reding, JC Kuo
  Cc: Thierry Reding, Wayne Chang, linux-phy, devicetree, linux-tegra,
	Jon Hunter

Use the function dev_err_probe() instead of open coding the same logic.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/phy/tegra/xusb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index d0d0b252a205..f16c81520a60 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -1257,13 +1257,8 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
 
 	err = tegra_xusb_setup_ports(padctl);
 	if (err) {
-		const char *level = KERN_ERR;
-
-		if (err == -EPROBE_DEFER)
-			level = KERN_DEBUG;
-
-		dev_printk(level, &pdev->dev,
-			   dev_fmt("failed to setup XUSB ports: %d\n"), err);
+		dev_err_probe(&pdev->dev, err, "failed to setup XUSB ports\n",
+			      err);
 		goto remove_pads;
 	}
 

-- 
2.43.0


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

* [PATCH 3/3] phy: tegra: Add support for Tegra238 XUSB pad controller
  2026-09-21 12:14 [PATCH 0/3] phy: tegra: xusb: Add Tegra238 support Jon Hunter
  2026-09-21 12:14 ` [PATCH 1/3] dt-bindings: phy: tegra194: Add compatible for Tegra238 Jon Hunter
  2026-09-21 12:14 ` [PATCH 2/3] phy: tegra: xusb: Use dev_err_probe() Jon Hunter
@ 2026-09-21 12:14 ` Jon Hunter
  2 siblings, 0 replies; 6+ messages in thread
From: Jon Hunter @ 2026-09-21 12:14 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thierry Reding, JC Kuo
  Cc: Thierry Reding, Wayne Chang, linux-phy, devicetree, linux-tegra,
	Jon Hunter

Add support for the Tegra238 XUSB pad controller by populating the
Tegra238 specific SoC data for the controller. The Tegra238 has three
USB2 and USB3 ports, uses the same port ops as Tegra186 and has the
same supplies as Tegra194. Due to the dependencies the Tegra238 device
has on the Tegra186 port ops and Tegra194 supplies, drop the compile
time guards around these structures.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/phy/tegra/xusb-tegra186.c | 29 +++++++++++++++++++++++------
 drivers/phy/tegra/xusb.c          |  6 ++++++
 drivers/phy/tegra/xusb.h          |  3 +++
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c
index 322efdea0d80..aa8ab94fad4c 100644
--- a/drivers/phy/tegra/xusb-tegra186.c
+++ b/drivers/phy/tegra/xusb-tegra186.c
@@ -1599,7 +1599,6 @@ static const struct tegra_xusb_padctl_ops tegra186_xusb_padctl_ops = {
 	.utmi_pad_power_down = tegra186_utmi_pad_power_down,
 };
 
-#if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC)
 static const char * const tegra186_xusb_padctl_supply_names[] = {
 	"avdd-pll-erefeut",
 	"avdd-usb",
@@ -1665,11 +1664,7 @@ const struct tegra_xusb_padctl_soc tegra186_xusb_padctl_soc = {
 	.num_supplies = ARRAY_SIZE(tegra186_xusb_padctl_supply_names),
 };
 EXPORT_SYMBOL_GPL(tegra186_xusb_padctl_soc);
-#endif
 
-#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
-	IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) || \
-	IS_ENABLED(CONFIG_ARCH_TEGRA_264_SOC)
 static const char * const tegra194_xusb_padctl_supply_names[] = {
 	"avdd-usb",
 	"vclamp-usb",
@@ -1755,6 +1750,29 @@ const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = {
 };
 EXPORT_SYMBOL_GPL(tegra234_xusb_padctl_soc);
 
+const struct tegra_xusb_padctl_soc tegra238_xusb_padctl_soc = {
+	.num_pads = ARRAY_SIZE(tegra186_pads),
+	.pads = tegra186_pads,
+	.ports = {
+		.usb2 = {
+			.ops = &tegra186_usb2_port_ops,
+			.count = 3,
+		},
+		.usb3 = {
+			.ops = &tegra186_usb3_port_ops,
+			.count = 3,
+		},
+	},
+	.ops = &tegra186_xusb_padctl_ops,
+	.supply_names = tegra194_xusb_padctl_supply_names,
+	.num_supplies = ARRAY_SIZE(tegra194_xusb_padctl_supply_names),
+	.supports_gen2 = true,
+	.poll_trk_completed = true,
+	.trk_hw_mode = false,
+	.supports_lp_cfg_en = true,
+};
+EXPORT_SYMBOL_GPL(tegra238_xusb_padctl_soc);
+
 const struct tegra_xusb_padctl_soc tegra264_xusb_padctl_soc = {
 	.num_pads = ARRAY_SIZE(tegra194_pads),
 	.pads = tegra194_pads,
@@ -1778,7 +1796,6 @@ const struct tegra_xusb_padctl_soc tegra264_xusb_padctl_soc = {
 	.has_per_pad_term = true,
 };
 EXPORT_SYMBOL_GPL(tegra264_xusb_padctl_soc);
-#endif
 
 MODULE_AUTHOR("JC Kuo <jckuo@nvidia.com>");
 MODULE_DESCRIPTION("NVIDIA Tegra186 XUSB Pad Controller driver");
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index f16c81520a60..ea181671395b 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -78,6 +78,12 @@ static const struct of_device_id tegra_xusb_padctl_of_match[] = {
 		.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",
diff --git a/drivers/phy/tegra/xusb.h b/drivers/phy/tegra/xusb.h
index d8d799d9e752..b9de4f3b5781 100644
--- a/drivers/phy/tegra/xusb.h
+++ b/drivers/phy/tegra/xusb.h
@@ -514,6 +514,9 @@ extern const struct tegra_xusb_padctl_soc tegra194_xusb_padctl_soc;
 #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

-- 
2.43.0


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

* Re: [PATCH 2/3] phy: tegra: xusb: Use dev_err_probe()
  2026-09-21 12:14 ` [PATCH 2/3] phy: tegra: xusb: Use dev_err_probe() Jon Hunter
@ 2026-09-23  6:36   ` Jon Hunter
  0 siblings, 0 replies; 6+ messages in thread
From: Jon Hunter @ 2026-09-23  6:36 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thierry Reding, JC Kuo
  Cc: Thierry Reding, Wayne Chang, linux-phy, devicetree, linux-tegra


On 21/09/2026 13:14, Jon Hunter wrote:
> Use the function dev_err_probe() instead of open coding the same logic.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>   drivers/phy/tegra/xusb.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index d0d0b252a205..f16c81520a60 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -1257,13 +1257,8 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
>   
>   	err = tegra_xusb_setup_ports(padctl);
>   	if (err) {
> -		const char *level = KERN_ERR;
> -
> -		if (err == -EPROBE_DEFER)
> -			level = KERN_DEBUG;
> -
> -		dev_printk(level, &pdev->dev,
> -			   dev_fmt("failed to setup XUSB ports: %d\n"), err);
> +		dev_err_probe(&pdev->dev, err, "failed to setup XUSB ports\n",
> +			      err);


Looks like I left this extra unneeded 'err' argument. I will fix this in
the next version.

Jon

-- 
nvpublic


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

* Re: [PATCH 1/3] dt-bindings: phy: tegra194: Add compatible for Tegra238
  2026-09-21 12:14 ` [PATCH 1/3] dt-bindings: phy: tegra194: Add compatible for Tegra238 Jon Hunter
@ 2026-09-25 13:31   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-25 13:31 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Vinod Koul, Neil Armstrong, Manivannan Sadhasivam, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thierry Reding, JC Kuo,
	Thierry Reding, Wayne Chang, linux-phy, devicetree, linux-tegra

On Mon, Sep 21, 2026 at 01:14:45PM +0100, Jon Hunter wrote:
> The Tegra238 XUSB pad controller is similar to that found on the
> Tegra194 and Tegra234, but only has three USB2 ports and three USB3
> ports.
> 
> Add the Tegra238 compatible string for the XUSB pad controller and
> constrain the binding so that a Tegra238 device tree can only have three
> USB2 and three USB3 ports.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  .../bindings/phy/nvidia,tegra194-xusb-padctl.yaml  | 38 ++++++++++++++++++++++
>  1 file changed, 38 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


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

end of thread, other threads:[~2026-09-25 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21 12:14 [PATCH 0/3] phy: tegra: xusb: Add Tegra238 support Jon Hunter
2026-09-21 12:14 ` [PATCH 1/3] dt-bindings: phy: tegra194: Add compatible for Tegra238 Jon Hunter
2026-09-25 13:31   ` Krzysztof Kozlowski
2026-09-21 12:14 ` [PATCH 2/3] phy: tegra: xusb: Use dev_err_probe() Jon Hunter
2026-09-23  6:36   ` Jon Hunter
2026-09-21 12:14 ` [PATCH 3/3] phy: tegra: Add support for Tegra238 XUSB pad controller Jon Hunter

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