I connected the uda1334 module to the orin nx module according to the connection in this article Only Right output works in Adafruit I2S UDA1334A Breakout Board. After plugging in the headphones, there is sound output.
step:
1.pinmux config
2.playback
amixer -c APE cset name="I2S2 Mux" ADMAIF2
aplay -D hw:APE,1 <in_wav>
I noticed that the decoder has a mute function, and there is a corresponding driver in the kernel driver (location: kernel-5.10/sound/soc/codecs/uda1334.c), but I didn’t actually use the uda1334 driver in this way. So I made the following changes to try to use my uda1334 driver.
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index bab95b241..813b78f15 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -994,6 +994,7 @@ CONFIG_SND_SOC_ES7134=m
CONFIG_SND_SOC_MAX98927=m
CONFIG_SND_SOC_PCM3168A_I2C=m
CONFIG_SND_SOC_RT5640=m
+CONFIG_SND_SOC_UDA1334=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_TAS571X=m
CONFIG_SND_SIMPLE_CARD=m
diff --git a/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3767-common-audio.dtsi b/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3767-common-audio.dtsi
index 7d79edd..e43dd38 100644
--- a/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3767-common-audio.dtsi
+++ b/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3767-common-audio.dtsi
@@ -181,6 +181,12 @@
assigned-clocks = <&bpmp_clks TEGRA234_CLK_AUD_MCLK>;
assigned-clock-parents = <&bpmp_clks TEGRA234_CLK_PLLA_OUT0>;
};
+
+ uda1334: audio-codec {
+ compatible = "nxp,uda1334";
+ nxp,mute-gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(H, 0) GPIO_ACTIVE_LOW>;
+ nxp,deemph-gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Q, 6) GPIO_ACTIVE_LOW>;
+ };
};
hdr40_snd_link_i2s: &i2s2_to_codec { };
After completing the above configuration, I used aplay to play, and there was sound, but the code in uda1334.c was still not executed. When I executed aplay to play on other platforms, the uda1334_startup function should be executed, but it was not executed here (the startup member in snd_soc_dai_ops). I want to know how I can set the decoder driver to be executed?