Skip to contentSkip to conversation

Tegra CEC Updates

PATCH Superseded Aaron Kling 2 participants 6 messages Apr 8, 2025

Subsystems (4)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Tegra CEC Updates

This series updates Tegra hdmi cec support to be usable out of the box on Tegra210 through Tegra194.

---
Changes in v2:
- Dropped patch 2, per request
- Added change to declare fallback compatibles instead, as per request
- Update patch 1 to allow fallback compatibles
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Aaron Kling (4):
media: dt-bindings: Document Tegra186 and Tegra194 cec
arm64: tegra: Add fallback cec compatibles
arm64: tegra: Add CEC controller on Tegra210
arm64: tegra: Wire up cec to devkits

 .../bindings/media/cec/nvidia,tegra114-cec.yaml           | 15 +++++++++++----
 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts        |  6 ++++++
 .../boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts    |  6 ++++++
 arch/arm64/boot/dts/nvidia/tegra186.dtsi                  |  2 +-
 arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts        |  6 ++++++
 arch/arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi       |  6 ++++++
 arch/arm64/boot/dts/nvidia/tegra194.dtsi                  |  2 +-
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts        |  6 ++++++
 arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts        |  6 ++++++
 arch/arm64/boot/dts/nvidia/tegra210.dtsi                  |  9 +++++++++
 10 files changed, 58 insertions(+), 6 deletions(-)

---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250407-tegra-cec-7e3a7bef456f

Best regards,

Signature · 1 line
Aaron Kling <[email protected]>
#1 lore raw

PATCH v2 1/4 media: dt-bindings: Document Tegra186 and Tegra194 cec

These are already used in device trees, so describe them here. As the driver only declares up through Tegra210, these must use a fallback compatible of tegra210-cec.

---
 .../bindings/media/cec/nvidia,tegra114-cec.yaml           | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/media/cec/nvidia,tegra114-cec.yaml +11 -4
index a6b73498bc217a2e884e31af91e9d8845c9b1d76..20d8eb975c2bf67acd407a4683a698b2bfb7c5f8 100644
@@ -14,10 +14,17 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - nvidia,tegra114-cec
-      - nvidia,tegra124-cec
-      - nvidia,tegra210-cec
+    oneOf:
+      - items:
+        - enum:
+          - nvidia,tegra114-cec
+          - nvidia,tegra124-cec
+          - nvidia,tegra210-cec
+      - items:
+        - enum:
+          - nvidia,tegra186-cec
+          - nvidia,tegra194-cec
+        - const: nvidia,tegra210-cec
 
   clocks:
     maxItems: 1
Signature · 1 line
2.48.1
#2 lore raw

Re: [PATCH v2 1/4] media: dt-bindings: Document Tegra186 and Tegra194 cec

Quoted 9 lines · Aaron Kling

These are already used in device trees, so describe them here. As the driver only declares up through Tegra210, these must use a fallback compatible of tegra210-cec.

---
 .../bindings/media/cec/nvidia,tegra114-cec.yaml           | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/media/cec/nvidia,tegra114-cec.yaml:19:9: [warning] wrong indentation: expected 10 but found 8 (indentation) ./Documentation/devicetree/bindings/media/cec/nvidia,tegra114-cec.yaml:20:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/media/cec/nvidia,tegra114-cec.yaml:24:9: [warning] wrong indentation: expected 10 but found 8 (indentation) ./Documentation/devicetree/bindings/media/cec/nvidia,tegra114-cec.yaml:25:11: [warning] wrong indentation: expected 12 but found 10 (indentation)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#3 lore raw

PATCH v2 2/4 arm64: tegra: Add fallback cec compatibles

In reply to Aaron Kling

The tegra_cec driver only declares support up to Tegra210 and will not declare support for Tegra186 or Tegra194. Thus list a fallback compatible for these archs to tegra210-cec as they work as-is with the existing driver.

---
 arch/arm64/boot/dts/nvidia/tegra186.dtsi | 2 +-
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +1 -1
index 2b3bb5d0af17bd521f87db0484fcbe943dd1a797..7f76c81d744ac72fd117b82f4b799322d2a11b82 100644
@@ -1183,7 +1183,7 @@ gic: interrupt-controller@3881000 {
 	};
 
 	cec@3960000 {
-		compatible = "nvidia,tegra186-cec";
+		compatible = "nvidia,tegra186-cec", "nvidia,tegra210-cec";
 		reg = <0x0 0x03960000 0x0 0x10000>;
 		interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&bpmp TEGRA186_CLK_CEC>;
arch/arm64/boot/dts/nvidia/tegra194.dtsi +1 -1
index 33f92b77cd9d9e530eae87a4bb8ba61993ceffeb..9b39bc126381b78efe067df790614d74b24897ce 100644
@@ -1339,7 +1339,7 @@ gic: interrupt-controller@3881000 {
 		};
 
 		cec@3960000 {
-			compatible = "nvidia,tegra194-cec";
+			compatible = "nvidia,tegra194-cec", "nvidia,tegra210-cec";
 			reg = <0x0 0x03960000 0x0 0x10000>;
 			interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&bpmp TEGRA194_CLK_CEC>;
Signature · 1 line
2.48.1
#4 lore raw

PATCH v2 3/4 arm64: tegra: Add CEC controller on Tegra210

In reply to Aaron Kling

The CEC controller found on Tegra210 can be used to control consumer devices using the HDMI CEC pin.

---
 arch/arm64/boot/dts/nvidia/tegra210.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/nvidia/tegra210.dtsi +9 -0
index b6c84d195c0ef9ae90721fada09ffd46a9c11fa3..402b0ede1472af625d9d9e811f5af306d436cc98 100644
@@ -959,6 +959,15 @@ fuse@7000f800 {
 		reset-names = "fuse";
 	};
 
+	cec@70015000 {
+		compatible = "nvidia,tegra210-cec";
+		reg = <0x0 0x070015000 0x0 0x1000>;
+		interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&tegra_car TEGRA210_CLK_CEC>;
+		clock-names = "cec";
+		status = "disabled";
+	};
+
 	mc: memory-controller@70019000 {
 		compatible = "nvidia,tegra210-mc";
 		reg = <0x0 0x70019000 0x0 0x1000>;
Signature · 1 line
2.48.1
#5 lore raw

PATCH v2 4/4 arm64: tegra: Wire up cec to devkits

In reply to Aaron Kling

This enables hdmi cec and routes it to the hdmi port on all supported Tegra210, Tegra186, and Tegra194 devkits.

---
 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts            | 6 ++++++
 arch/arm64/boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts | 6 ++++++
 arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts            | 6 ++++++
 arch/arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi           | 6 ++++++
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts            | 6 ++++++
 arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts            | 6 ++++++
 6 files changed, 36 insertions(+)
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts +6 -0
index 15aa49fc450399c7bd525adcdb6e92a27a185805..90155e4ff1feb609f79416a410c3666ebef8b634 100644
@@ -2394,6 +2394,12 @@ usb@3550000 {
 		phy-names = "usb2-0";
 	};
 
+	cec@3960000 {
+		status = "okay";
+
+		hdmi-phandle = <&sor1>;
+	};
+
 	i2c@c250000 {
 		/* carrier board ID EEPROM */
 		eeprom@57 {
arch/arm64/boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts +6 -0
index 26f71651933d1d8ef32bbd1645cac1820bd2e104..a6d7fec2e84fb917018aff843845b02c34fede33 100644
@@ -712,6 +712,12 @@ usb@3550000 {
 		phy-names = "usb2-0";
 	};
 
+	cec@3960000 {
+		status = "okay";
+
+		hdmi-phandle = <&sor1>;
+	};
+
 	hsp@3c00000 {
 		status = "okay";
 	};
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +6 -0
index c32876699a43e9f57b3888c5bc0f5da73c5b95b5..ea6f397a27926e3dcd54002177f68749bc1cc309 100644
@@ -2121,6 +2121,12 @@ usb@3610000 {
 			phy-names = "usb2-0", "usb2-1", "usb2-3", "usb3-0", "usb3-2", "usb3-3";
 		};
 
+		cec@3960000 {
+			status = "okay";
+
+			hdmi-phandle = <&sor2>;
+		};
+
 		i2c@c240000 {
 			typec@8 {
 				compatible = "cypress,cypd4226";
arch/arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi +6 -0
index 4a17ea5e40fd034c6f4acb023cd7908d6800f710..16cf4414de599baea96362b494be40c800a8197f 100644
@@ -2174,6 +2174,12 @@ usb@3610000 {
 			phy-names = "usb2-1", "usb2-2", "usb3-2";
 		};
 
+		cec@3960000 {
+			status = "okay";
+
+			hdmi-phandle = <&sor1>;
+		};
+
 		host1x@13e00000 {
 			display-hub@15200000 {
 				status = "okay";
arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts +6 -0
index a6a58e51822d90f8815df880ea7e668caff1b1ec..627abf51a5a472ddcc42fdc1d783876b0a03da47 100644
@@ -90,6 +90,12 @@ eeprom@57 {
 		};
 	};
 
+	cec@70015000 {
+		status = "okay";
+
+		hdmi-phandle = <&sor1>;
+	};
+
 	clock@70110000 {
 		status = "okay";
 
arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts +6 -0
index 0ecdd7243b2eb1abba9adbe9a404b226c29b85ef..ec0e84cb83ef9bf8f0e52e2958db33666813917c 100644
@@ -419,6 +419,12 @@ pmc@7000e400 {
 		nvidia,sys-clock-req-active-high;
 	};
 
+	cec@70015000 {
+		status = "okay";
+
+		hdmi-phandle = <&sor1>;
+	};
+
 	hda@70030000 {
 		nvidia,model = "NVIDIA Jetson Nano HDA";
 
Signature · 1 line
2.48.1