Can't enable i2s4 on jetpack4.4.1

Hi,

I’ve porting the codec max9867 with machine driver on the custom board.
The code drivers can work ok:

nvidia@nvidia-desktop:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tegrahda [tegra-hda], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 1: ADMAIF2 CIF ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 2: ADMAIF3 CIF ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 3: ADMAIF4 CIF ADMAIF4-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 4: ADMAIF5 CIF ADMAIF5-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 5: ADMAIF6 CIF ADMAIF6-5 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 6: ADMAIF7 CIF ADMAIF7-6 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 7: ADMAIF8 CIF ADMAIF8-7 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 8: ADMAIF9 CIF ADMAIF9-8 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile], device 9: ADMAIF10 CIF ADMAIF10-9 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

however, there is no sound by:

amixer -c tegrasndt210ref cset name="ADMAIF1 Mux" I2S4
aplay <wavfile>.wav

I‘ve measured the pins signal and confirmed aud_mclk output existed, while i2s4 pins had no signal.
the pinctrl of i2s4 as:

nvidia@nvidia-desktop:~$ sudo grep dap4 /sys/kernel/debug/tegra_pinctrl_reg
Bank: 1 Reg: 0x70003144 Val: 0x00000000 -> dap4_fs_pj4
Bank: 1 Reg: 0x70003148 Val: 0x00000044 -> dap4_din_pj5
Bank: 1 Reg: 0x7000314c Val: 0x00000000 -> dap4_dout_pj6
Bank: 1 Reg: 0x70003150 Val: 0x00000000 -> dap4_sclk_pj7

sudo grep i2s /sys/kernel/debug/pinctrl/pinctrl-handles
    type: MUX_GROUP controller 700008d4.pinmux group: dap2_din_paa2 (89) function: i2s2 (23)
    type: MUX_GROUP controller 700008d4.pinmux group: dap2_dout_paa3 (90) function: i2s2 (23)
    type: MUX_GROUP controller 700008d4.pinmux group: dap2_fs_paa0 (88) function: i2s2 (23)
    type: MUX_GROUP controller 700008d4.pinmux group: dap2_sclk_paa1 (91) function: i2s2 (23)
    type: MUX_GROUP controller 700008d4.pinmux group: dap4_din_pj5 (93) function: i2s4b (26)
    type: MUX_GROUP controller 700008d4.pinmux group: dap4_dout_pj6 (94) function: i2s4b (26)
    type: MUX_GROUP controller 700008d4.pinmux group: dap4_fs_pj4 (92) function: i2s4b (26)
    type: MUX_GROUP controller 700008d4.pinmux group: dap4_sclk_pj7 (95) function: i2s4b (26)

nvidia@nvidia-desktop:~$ sudo grep "Name:\|J:\|BB" /sys/kernel/debug/tegra_gpio
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
 J: 2:1 f0 d0 00 00 00 00 000000
BB: 6:3 00 00 00 00 00 00 000000

I’ve updated tegra210-porg-pinmux-p3448-0002-b00.dtsi( I used tegra210-p3448-0002-p3449-0000-b00.dts):

--- a/source/kernel_src/hardware_545s_r1_0/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0002-b00.dtsi
+++ b/source/kernel_src/hardware_545s_r1_0/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0002-b00.dtsi
@@ -792,7 +792,7 @@
 
 			dap4_din_pj5 {
 				nvidia,pins = "dap4_din_pj5";
-				nvidia,function = "rsvd1";
+				nvidia,function = "i2s4b";
 				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
 				nvidia,tristate = <TEGRA_PIN_DISABLE>;
 				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -800,7 +800,7 @@
 
 			dap4_dout_pj6 {
 				nvidia,pins = "dap4_dout_pj6";
-				nvidia,function = "rsvd1";
+				nvidia,function = "i2s4b";
 				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
 				nvidia,tristate = <TEGRA_PIN_DISABLE>;
 				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
@@ -808,7 +808,7 @@
 
 			dap4_fs_pj4 {
 				nvidia,pins = "dap4_fs_pj4";
-				nvidia,function = "rsvd1";
+				nvidia,function = "i2s4b";
 				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
 				nvidia,tristate = <TEGRA_PIN_DISABLE>;
 				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
@@ -816,7 +816,7 @@
 
 			dap4_sclk_pj7 {
 				nvidia,pins = "dap4_sclk_pj7";
-				nvidia,function = "rsvd1";
+				nvidia,function = "i2s4b";
 				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
 				nvidia,tristate = <TEGRA_PIN_DISABLE>;
 				nvidia,enable-input = <TEGRA_PIN_DISABLE>;

The hardware of the custom board is ok, because audio can output well when replacing NANO with NX on the same board.

Hello!

From playback please ensure that …

amixer -c tegrasndt210ref cset name="I2S4 Mux" ADMAIF1
aplay -D hw:tegrasndt210ref,0 <wavfile>.wav

If the above does not work, then please run the following commands and share the output …

amixer -c tegrasndt210ref cset name="I2S4 Mux" ADMAIF1
echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
aplay -D hw:tegrasndt210ref,0 <wavfile>.wav
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable

Regards,
Jon

Hi,

Thank you,

I fixed the ‘amixer’ command.
And, I found the solution of I2S problem in https://forums.developer.nvidia.com/t/audio-i2s-on-40-pin-connector/72612/47

Hello!

Thanks for the update. If you remove the following from the ‘gpio-input’ node this should also work …

                               TEGRA_GPIO(J, 5)
                               TEGRA_GPIO(J, 6)
                               TEGRA_GPIO(J, 4)
                               TEGRA_GPIO(J, 7)

Regards,
Jon