From 3b03f7cf1579c9f38503de87b06ddec33f0e1e3e Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Sat, 5 Aug 2023 04:10:26 +0000 Subject: [PATCH] tegra234: p3737-0000: Move audio codec to base from overlay The audio codec and sound nodes are added into the base DTS file in mainline. Hence, to align the base DTB with mainline, move the audio codec from overlay file to the base file. Cherry picked from commit f3e2de01530fdeb1317d7680740f0b5894ffd607 Change: Partial integration limited to codec only. Rest of changes are already integrated. Bug 4037899 Change-Id: I0d4835b2d1503610261dacc3049d61514592fea2 Signed-off-by: Mohan Kumar Signed-off-by: Thierry Reding Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2949578 (cherry picked from commit 2cf1cedaa40cc86496f3ba76087e67982f3622e3) Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2955889 GVS: Gerrit_Virtual_Submit --- overlay/tegra234-p3737-0000.dtsi | 18 +------------ tegra234-p3737-0000+p3701-0000.dts | 18 +++++++++++++ tegra234-p3737-0000.dtsi | 41 ++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 17 deletions(-) diff --git a/overlay/tegra234-p3737-0000.dtsi b/overlay/tegra234-p3737-0000.dtsi index 7861f44..69f38f5 100644 --- a/overlay/tegra234-p3737-0000.dtsi +++ b/overlay/tegra234-p3737-0000.dtsi @@ -95,24 +95,8 @@ __overlay__ { bus@0 { i2c@31e0000 { - rt5640: rt5640.8-001c@1c { - compatible = "realtek,rt5640"; - reg = <0x1c>; - - clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>; - clock-names = "mclk"; - - realtek,dmic1-data-pin = <0>; /* RT5659_DMIC1_NULL */ - realtek,dmic2-data-pin = <0>; /* RT5659_DMIC2_NULL */ - realtek,jack-detect-source = <7>; - - /* Codec IRQ output */ - interrupt-parent = <&gpio>; - interrupts = ; - + rt5640: audio-codec@1c { #sound-dai-cells = <1>; - sound-name-prefix = "CVB-RT"; - status = "okay"; }; }; diff --git a/tegra234-p3737-0000+p3701-0000.dts b/tegra234-p3737-0000+p3701-0000.dts index 418a50b..722fa21 100644 --- a/tegra234-p3737-0000+p3701-0000.dts +++ b/tegra234-p3737-0000+p3701-0000.dts @@ -401,6 +401,24 @@ <&dmic3_port>; label = "NVIDIA Jetson AGX Orin APE"; + + widgets = "Microphone", "CVB-RT MIC Jack", + "Microphone", "CVB-RT MIC", + "Headphone", "CVB-RT HP Jack", + "Speaker", "CVB-RT SPK"; + + routing = /* I2S1 <-> RT5640 */ + "CVB-RT AIF1 Playback", "I2S1 DAP-Playback", + "I2S1 DAP-Capture", "CVB-RT AIF1 Capture", + /* RT5640 codec controls */ + "CVB-RT HP Jack", "CVB-RT HPOL", + "CVB-RT HP Jack", "CVB-RT HPOR", + "CVB-RT IN1P", "CVB-RT MIC Jack", + "CVB-RT IN2P", "CVB-RT MIC Jack", + "CVB-RT SPK", "CVB-RT SPOLP", + "CVB-RT SPK", "CVB-RT SPORP", + "CVB-RT DMIC1", "CVB-RT MIC", + "CVB-RT DMIC2", "CVB-RT MIC"; }; thermal-zones { diff --git a/tegra234-p3737-0000.dtsi b/tegra234-p3737-0000.dtsi index d94147f..eb79e80 100644 --- a/tegra234-p3737-0000.dtsi +++ b/tegra234-p3737-0000.dtsi @@ -1,9 +1,26 @@ // SPDX-License-Identifier: GPL-2.0 +#include + / { compatible = "nvidia,p3737-0000"; bus@0 { + aconnect@2900000 { + ahub@2900800 { + i2s@2901000 { + ports { + port@1 { + endpoint { + dai-format = "i2s"; + remote-endpoint = <&rt5640_ep>; + }; + }; + }; + }; + }; + }; + i2c@3160000 { status = "okay"; @@ -20,6 +37,30 @@ }; }; + i2c@31e0000 { + status = "okay"; + + audio-codec@1c { + compatible = "realtek,rt5640"; + reg = <0x1c>; + interrupt-parent = <&gpio>; + interrupts = ; + clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>; + clock-names = "mclk"; + realtek,dmic1-data-pin = ; + realtek,dmic2-data-pin = ; + realtek,jack-detect-source = ; + sound-name-prefix = "CVB-RT"; + + port { + rt5640_ep: endpoint { + remote-endpoint = <&i2s1_dap>; + mclk-fs = <256>; + }; + }; + }; + }; + pwm@3280000 { status = "okay"; };