Audio codec on TX2

Hi all

I wanna use I2S0 and I2C_GP0 to connect alc5659 audio codec.
i followed
https://devtalk.nvidia.com/default/topic/1031303/jetson-tx2/audio-codec-rt5631-on-tx2/
and the document
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/sound
to add this structure in dts i2c@3160000 node
rt5659 {
compatible = “realtek,rt5659”;
reg = <0x1b>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
realtek,ldo1-en-gpios =
<&gpio TEGRA_GPIO(J, 6) GPIO_ACTIVE_HIGH>;
};

but i can’t build kernel successfully

did NV people have any suggestion??

Hello!

We use the rt5658 codec on TX1/TX2 and so we should be able to help you with this.

Please note that if you are using I2C_GP0 on J21, then I believe you want to add you codec to the ‘i2c@c240000’ node.

What is the build problem you are seeing?

Regards,
Jon

Hi jonathanh

Thanks for your suggestion.

i add in i2c@c240000 but i use i2cdetect command can’t see the codec now

modify in tegra186-quill-p3310-1000-a00-00-base.dts
i2c@c240000 {
        clock-frequency = <400000>;

        rt5659@1c {
            compatible = "realtek,rt5659";
            reg = <0x1c>;
            interrupts = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
            realtek,ldo1-en-gpios =<&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_HIGH>;
        };
    };

i think i didn’t need to modify the sound structure.
do you have any patch or suggestion for rt5658/rt5659 ?

Hi Etta,

Does the kernel detect the codec?

$ find /sys/devices/*.i2c/ -name name -exec cat {} \; | grep rt565

Do you see any errors from i2c in the dmesg?

dmesg | grep i2c

Yes you also need to modify the sound structure as follows …

diff --git a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
index 46de427f71f8..6456929bcf20 100644
--- a/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
+++ b/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
@@ -813,8 +813,10 @@
 
                status = "okay";
                nvidia,audio-routing =
-                       "x Headphone",          "x OUT",
-                       "x IN",                 "x Mic",
+                       "x Headphone Jack",     "x HPO L Playback",
+                       "x Headphone Jack",     "x HPO R Playback",
+                       "x IN1P",               "x Mic Jack",
+                       "x Int Spk",            "x SPO Playback",
                        "y Headphone",          "y OUT",
                        "y IN",                 "y Mic",
                        "z Headphone",          "z OUT",
@@ -839,9 +841,9 @@
                rt565x_dai_link: nvidia,dai-link-1 {
                        link-name = "rt565x-playback";
                        cpu-dai = <&tegra_i2s1>;
-                       codec-dai = <&spdif_dit0>;
+                       codec-dai = <&rt5659_codec>;
                        cpu-dai-name = "I2S1";
-                       codec-dai-name = "dit-hifi";
+                       codec-dai-name = "rt5659-aif1";
                        format = "i2s";
                        bitclock-slave;
                        frame-slave;

Please note that you need to add the label ‘rt5659_codec’ to tegra186-quill-p3310-1000-a00-00-base.dts

i2c@c240000 {
        clock-frequency = <400000>;

        rt5659_codec: rt5659@1c {

Regards
Jon

Hi

i use this command

nvidia@tegra-ubuntu:~$ find /sys/devices/*.i2c/ -name name -exec cat {} ; | grep rt565
rt5659
nvidia@tegra-ubuntu:~$

but i can’t reset the audio codec so i can’t see device in u2c bus

nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –
nvidia@tegra-ubuntu:~$

i use GPIO20/AUD_INT to connect rt5659IRQ and use GPIO19/AUD_RST to connect rt5659.
i use rtc module to check i2c_gp0 bus so i can make sure the bus is fine.
rt5659 need to reset before setting.

how do i debug this step?
i followed your modify to setup the audio codec

the dtb about i2c
i2c@c240000 {
		#address-cells = <0x1>;
		#size-cells = <0x0>;
		#stream-id-cells = <0x1>;
		compatible = "nvidia,tegra186-i2c";
		reg = <0x0 0xc240000 0x0 0x100>;
		interrupts = <0x0 0x1a 0x4>;
		scl-gpio = <0x1c 0x30 0x0>;
		sda-gpio = <0x1c 0x31 0x0>;
		status = "okay";
		clock-frequency = <0x61a80>;
		clocks = <0xd 0xda 0xd 0x10d 0xd 0xdd>;
		clock-names = "div-clk", "parent", "slow-clk";
		resets = <0xd 0x14>;
		reset-names = "i2c";
		dmas = <0x19 0x16 0x19 0x16>;
		dma-names = "rx", "tx";
		linux,phandle = <0x8b>;
		phandle = <0x8b>;

		prod-settings {

			prod_c_fm {
				prod = <0x6c 0xffff0000 0x190000 0x94 0x3f00 0x200>;
			};

			prod_c_fmplus {
				prod = <0x6c 0xffff0000 0x100000 0x94 0x3f00 0x200>;
			};

			prod_c_hs {
				prod = <0x6c 0xffff 0x2 0x9c 0x3f00 0x300>;
			};

			prod_c_sm {
				prod = <0x6c 0xffff0000 0x160000 0x94 0x3f00 0x300>;
			};
		};

		lp8556-backlight-s-wqxga-10-1@2c {
			status = "disabled";
			disable-on-kernel-charging;
			compatible = "ti,lp8556";
			reg = <0x2c>;
			bl-name = "pwm-backlight";
			init-brt = [ff];
			dev-ctrl = [80];
			pwm-period = <0x9ce1>;
			pwm-names = "lp8556";
			pwms = <0x1b 0x0 0x9ce1>;
			bl-measured = <0x0 0x1 0x2 0x3 0x4 0x5 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xb 0xc 0xd 0xe 0xf 0xf 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x25 0x26 0x27 0x28 0x29 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x36 0x37 0x38 0x39 0x3a 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5e 0x5f 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7d 0x7e 0x7f 0x80 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf 0xb0 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc7 0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 0xd8 0xd9 0xdb 0xdc 0xdd 0xde 0xdf 0xe1 0xe2 0xe3 0xe4 0xe5 0xe6 0xe7 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfd 0xfe 0xff>;
			linux,phandle = <0x128>;
			phandle = <0x128>;
		};

		ov23850_c@36 {
			compatible = "nvidia,ov23850";
			reg = <0x36>;
			physical_w = "7.3998";
			physical_h = "5.5998";
			avdd-reg = "vana";
			dvdd-reg = "vdig";
			iovdd-reg = "vif";
			vcmvdd-reg = "vvcm";
			devnode = "video1";
			clocks = <0xd 0x5a 0xd 0x10d>;
			clock-names = "extperiph2", "pllp_grtba";
			mclk = "extperiph2";
			reset-gpios = <0x12 0x89 0x0>;
			pwdn-gpios = <0x12 0x5e 0x0>;
			vana-supply = <0x1d>;
			vdig-supply = <0x1e>;
			vif-supply = <0x1f>;
			vvcm-suply = <0x20>;
			status = "disabled";
			linux,phandle = <0x136>;
			phandle = <0x136>;

			mode0 {
				mclk_khz = "24000";
				num_lanes = [34 00];
				tegra_sinterface = "serial_c";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = [30 00];
				active_w = "5632";
				active_h = "4224";
				pixel_t = "bayer_bggr";
				readout_orientation = "270";
				line_length = "6000";
				inherent_gain = [31 00];
				mclk_multiplier = "25";
				pix_clk_hz = "600000000";
				min_gain_val = "1.0";
				max_gain_val = "15.5";
				min_hdr_ratio = [31 00];
				max_hdr_ratio = "64";
				min_framerate = "3.05185";
				max_framerate = "20";
				min_exp_time = "20";
				max_exp_time = "327350";
			};

			mode1 {
				mclk_khz = "24000";
				num_lanes = [34 00];
				tegra_sinterface = "serial_c";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = [30 00];
				active_w = "5632";
				active_h = "3168";
				pixel_t = "bayer_bggr";
				readout_orientation = "270";
				line_length = "5922";
				inherent_gain = [31 00];
				mclk_multiplier = "25";
				pix_clk_hz = "600000000";
				min_gain_val = "1.0";
				max_gain_val = "15.5";
				min_hdr_ratio = [31 00];
				max_hdr_ratio = "64";
				min_framerate = "3.09135";
				max_framerate = "30";
				min_exp_time = "19.74";
				max_exp_time = "323094";
			};

			ports {
				#address-cells = <0x1>;
				#size-cells = <0x0>;

				port@0 {
					reg = <0x0>;

					endpoint {
						csi-port = <0x2>;
						bus-width = <0x4>;
						remote-endpoint = <0x21>;
						linux,phandle = <0x144>;
						phandle = <0x144>;
					};
				};
			};
		};

		lc898212@72 {
			compatible = "nvidia,lc898212";
			reg = <0x72>;
			devnode = "video3";
			type = "default";
			min_focus_distance = "10.0";
			hyper_focal = "0.2";
			focal_length = "4.73";
			f_number = "2.2";
			aperture = "2.2";
			vvcm-supply = <0x20>;
			support_mfi = "true";
			status = "disabled";
			linux,phandle = <0x13a>;
			phandle = <0x13a>;

			ports {
				#address-cells = <0x1>;
				#size-cells = <0x0>;

				port@0 {
					reg = <0x0>;

					endpoint {
						remote-endpoint = <0x22>;
						linux,phandle = <0x140>;
						phandle = <0x140>;
					};
				};
			};
		};

		i2cmux@70 {
			compatible = "nxp,pca9546";
			reg = <0x70>;
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			vcc-supply = <0x23>;
			vcc-pullup-supply = <0x1a>;
			status = "disabled";
			linux,phandle = <0x11b>;
			phandle = <0x11b>;

			i2c@0 {
				reg = <0x0>;
				i2c-mux,deselect-on-exit;
				#address-cells = <0x1>;
				#size-cells = <0x0>;

				tas2552.9-0040@40 {
					compatible = "ti,tas2552";
					reg = <0x40>;
					vbat-supply = <0x1a>;
					iovdd-supply = <0x23>;
					avdd-supply = <0x24>;
					tas2552,pdm_edge_select = <0x0>;
					linux,phandle = <0x122>;
					phandle = <0x122>;
				};

				tas2552.9-0041@41 {
					compatible = "ti,tas2552";
					reg = <0x41>;
					vbat-supply = <0x1a>;
					iovdd-supply = <0x23>;
					avdd-supply = <0x24>;
					tas2552,pdm_edge_select = <0x1>;
					linux,phandle = <0x124>;
					phandle = <0x124>;
				};
			};

			i2c@1 {
				reg = <0x1>;
				i2c-mux,deselect-on-exit;
				#address-cells = <0x1>;
				#size-cells = <0x0>;

				ina3221x@40 {
					compatible = "ti,ina3221x";
					reg = <0x40>;
					ti,trigger-config = <0x7003>;
					ti,continuous-config = <0x7c07>;
					ti,enable-forced-continuous;
					#address-cells = <0x1>;
					#size-cells = <0x0>;

					channel@0 {
						reg = <0x0>;
						ti,rail-name = "VDD_5V";
						ti,shunt-resistor-mohm = <0xa>;
					};

					channel@1 {
						reg = <0x1>;
						ti,rail-name = "VDD_3V3";
						ti,shunt-resistor-mohm = <0xa>;
					};

					channel@2 {
						reg = <0x2>;
						ti,rail-name = "VDD_1V8";
						ti,shunt-resistor-mohm = <0x1>;
					};
				};

				ina3221x@41 {
					compatible = "ti,ina3221x";
					reg = <0x41>;
					ti,trigger-config = <0x7003>;
					ti,continuous-config = <0x7c07>;
					ti,enable-forced-continuous;
					#address-cells = <0x1>;
					#size-cells = <0x0>;

					channel@0 {
						reg = <0x0>;
						ti,rail-name = "VDD_5V_AUD";
						ti,shunt-resistor-mohm = <0x1>;
					};

					channel@1 {
						reg = <0x1>;
						ti,rail-name = "VDD_3V3_AUD";
						ti,shunt-resistor-mohm = <0xa>;
					};

					channel@2 {
						reg = <0x2>;
						ti,rail-name = "VDD_1V8_AUD";
						ti,shunt-resistor-mohm = <0xa>;
					};
				};

				ina3221x@42 {
					compatible = "ti,ina3221x";
					reg = <0x42>;
					ti,trigger-config = <0x7003>;
					ti,continuous-config = <0x7c07>;
					ti,enable-forced-continuous;
					#address-cells = <0x1>;
					#size-cells = <0x0>;

					channel@0 {
						reg = <0x0>;
						ti,rail-name = "VDD_3V3_GPS";
						ti,shunt-resistor-mohm = <0xa>;
					};

					channel@1 {
						reg = <0x1>;
						ti,rail-name = "VDD_3V3_NFC";
						ti,shunt-resistor-mohm = <0xa>;
					};

					channel@2 {
						reg = <0x2>;
						ti,rail-name = "VDD_3V3_GYRO";
						ti,shunt-resistor-mohm = <0xa>;
					};
				};
			};

			i2c@2 {
				reg = <0x2>;
				i2c-mux,deselect-on-exit;
				#address-cells = <0x1>;
				#size-cells = <0x0>;
			};

			i2c@3 {
				reg = <0x3>;
				i2c-mux,deselect-on-exit;
				#address-cells = <0x1>;
				#size-cells = <0x0>;

				rt5659.12-001a@1a {
					compatible = "realtek,rt5658";
					reg = <0x1a>;
					status = "disabled";
					gpios = <0x12 0x4d 0x0>;
					realtek,jd-src = <0x1>;
					realtek,dmic1-data-pin = <0x2>;
					linux,phandle = <0x126>;
					phandle = <0x126>;
				};
			};
		};

		gpio@20 {
			compatible = "ti,tca6416";
			reg = <0x20>;
			gpio-controller;
			#gpio-cells = <0x2>;
			vcc-supply = <0x1a>;
			status = "disabled";
			linux,phandle = <0x108>;
			phandle = <0x108>;
		};

		icm20628@68 {
			compatible = "invensense,mpu6xxx";
			reg = <0x68>;
			interrupt-parent = <0x1c>;
			interrupts = <0x2a 0x1>;
			accelerometer_matrix = [01 00 00 00 01 00 00 00 01];
			gyroscope_matrix = [01 00 00 00 01 00 00 00 01];
			vdd-supply = <0xf>;
			vlogic-supply = <0xf>;
			status = "disabled";
			linux,phandle = <0x11c>;
			phandle = <0x11c>;
		};

		ak8963@0d {
			compatible = "ak,ak89xx";
			reg = <0xd>;
			magnetic_field_matrix = [01 00 00 00 01 00 00 00 01];
			status = "disabled";
			linux,phandle = <0x11d>;
			phandle = <0x11d>;
		};

		bmp280@77 {
			compatible = "bmp,bmpX80";
			reg = <0x77>;
			status = "disabled";
			linux,phandle = <0x11e>;
			phandle = <0x11e>;
		};

		cm32180@48 {
			compatible = "capella,cm32180";
			reg = <0x48>;
			gpio_irq = <0x12 0x44 0x1>;
			light_uncalibrated_lo = <0x1>;
			light_calibrated_lo = <0x96>;
			light_uncalibrated_hi = <0x17318>;
			light_calibrated_hi = <0x1ab3f0>;
			status = "disabled";
			linux,phandle = <0x11f>;
			phandle = <0x11f>;
		};

		iqs263@44 {
			status = "disabled";
		};

		rt5659.1-001a@1a {
			compatible = "realtek,rt5658";
			reg = <0x1a>;
			status = "disabled";
			gpios = <0x12 0x4d 0x0>;
			realtek,jd-src = <0x1>;
			realtek,dmic1-data-pin = <0x2>;
			linux,phandle = <0x125>;
			phandle = <0x125>;
		};

		rt5659@1b {
			compatible = "realtek,rt5659";
			reg = <0x1b>;
			interrupts = <0x12 0x4d 0x0>;
			realtek,ldo1-en-gpios = <0x12 0x4e 0x0>;
		};
	};

Something is definitely not right here. On my TX2 I see …

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – – – – – – – – – – – – –
10: – – – – – – – – – – UU – – – – –
20: UU – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: UU UU UU – 44 – – – 48 – – – – – – –
50: 50 51 52 53 – – – 57 – – – – – – – –
60: – – – – – 65 – – 68 – – – – – – –
70: UU – – – – – – –

Can you disconnect the codec and try running i2cdetect again? I am wondering if the codec is causing problems for the other devices on the i2c bus.

On TX2 the AUD_RST is routed to pin GPIO_AUD1 on Tegra186. Can you dump the following …

ubuntu@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep gpio_aud1
Bank: 0 Reg: 0x02431010 Val: 0x00000000 → gpio_aud1_pj6

ubuntu@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_gpio | grep “Port|J:6”
Port:Pin:ENB DBC IN OUT_CTRL OUT_VAL INT_CLR
J:6 0x3 0x0 0x0 0x0 0x0 0x0

If you have the same as above then the pin is configured as a GPIO output and the current state is low. To set as high (assuming the reset is active low), you need to do something like …

diff --git a/kernel-dts/t18x-common-platforms/tegra186-quill-common-p3310-1000-a00.dtsi b/kernel-dts/t18x-common-platforms/tegra186-quill-common-p3310-1000-a00.dtsi
index fcb6bf109f37..529604d9393f 100644
--- a/kernel-dts/t18x-common-platforms/tegra186-quill-common-p3310-1000-a00.dtsi
+++ b/kernel-dts/t18x-common-platforms/tegra186-quill-common-p3310-1000-a00.dtsi
@@ -76,6 +76,13 @@
                        label = "e3325-lane0-mux";
                        status = "disabled";
                };
+               aud_rst {
+                       gpio-hog;
+                       gpios = <TEGRA_MAIN_GPIO(J, 6) 0>;
+                       output-high;
+                       label = "audio reset";
+                       status = "okay";
+               };
        };

Regards,
Jon

Hi jonathanh

i use jetpack3.1 to flash my tx2 module.
and i use i2cdetest on my tx2 nvidia EVB.
but my detect is different from you.
how do i debug this issue on my tx2 EVB board?

this is my i2cdetect on my tx2 nvidia EVB.

nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 0
[sudo] password for nvidia:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: UU UU UU UU -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- UU -- -- UU
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 5
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          ^C
nvidia@tegra-ubuntu:~$ ^C
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 6
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 7
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
50: 50 -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 8
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$ uname -a
Linux tegra-ubuntu 4.4.38-tegra #1 SMP PREEMPT Thu Jul 20 00:49:07 PDT 2017 aarch64 aarch64 aarch64 GNU/Linux
nvidia@tegra-ubuntu:~$

Sorry I realised that on my TX2 I have a camera, display, audio and debug cards connected. If I remove these cards then I see …

ubuntu@tegra-ubuntu:~$ sudo i2cdetect -y -r 1
[sudo] password for ubuntu:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

So I believe that by default you will not see anything on i2c1.

I2C1 is available on the gpio_sen8/9 pins and so what do you see for the following?

ubuntu@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep “sen8|sen9”
Bank: 1 Reg: 0x0c302088 Val: 0x00001441 → gpio_sen8_pee0
Bank: 1 Reg: 0x0c302090 Val: 0x00001441 → gpio_sen9_pee1

The above registers tell me if i2c1 is mapped to the gpio_sen8/9 correctly. Hopefully, you have the same as above.

If that looks good, then have you checked the reset as I mentioned above?

Regards,
Jon

Hi jonathanh

thanks for your suggestion.

I followed your step and have some error when bring up codec.

in tegra186-quill-common-p3310-1000-a00.dtsi
gpio@2200000 {
		wifi_over_pcie {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(R, 4) 0>;
			output-low;
			label = "wifi-over-pcie";
			status = "disabled";
		};
		pcie0_lane2_mux {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(R, 3) 0>;
			output-low;
			label = "pcie-lane2-mux";
			status = "disabled";
		};
		e3325_sdio_rst {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(B, 6) 0>;
			output-high;
			label = "e3325-sdio-rst";
			status = "disabled";
		};
		e3325_lane0_mux {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(B, 4) 0>;
			output-low;
			label = "e3325-lane0-mux";
			status = "disabled";
		};
		aud_rst {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(J, 6) 0>;
			output-high;
			label = "audio reset";
			status = "okay";
        };
	};


in tegra186-quill-p3310-1000-a00-00-base.dts

i2c@c240000 {
		clock-frequency = <400000>;
		rt5659_codec: rt5659@1b {
			compatible = "realtek,rt5659";
			reg = <0x1b>;
		};
	};

in tegra186-quill-common.dtsi

tegra_sound: sound {
		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
		nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
		nvidia,num-codec-link = <13>;
		nvidia,num-clk = <8>;
		nvidia,ldo-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_HIGH>;
		nvidia,hp-det-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
		nvidia,clk-rates = < 270950400	/* PLLA_x11025_RATE */
				     11289600	/* AUD_MCLK_x11025_RATE */
				     45158400	/* PLLA_OUT0_x11025_RATE */
				     45158400	/* AHUB_x11025_RATE */
				     245760000  /* PLLA_x8000_RATE */
				     12288000	/* AUD_MCLK_x8000_RATE */
				     49152000	/* PLLA_OUT0_x8000_RATE */
				     49152000 >;/* AHUB_x8000_RATE */
		clocks = <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
			<&tegra_car TEGRA186_CLK_PLLA>,
			<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
			<&tegra_car TEGRA186_CLK_AHUB>,
			<&tegra_car TEGRA186_CLK_CLK_M>,
			<&tegra_car TEGRA186_CLK_AUD_MCLK>;
		clock-names = "pll_p_out1", "pll_a", "pll_a_out0", "ahub",
				"clk_m", "extern1";
		resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
		reset-names = "extern1_rst";

		status = "okay";
		nvidia,audio-routing =
			"x Headphone Jack",     "x HPO L Playback",
			"x Headphone Jack",     "x HPO R Playback",
			"x IN1P",               "x Mic Jack",
			"x Int Spk",            "x SPO Playback",
			"y Headphone",		"y OUT",
			"y IN",			"y Mic",
			"z IN",			"z OUT",
			"m Headphone",		"m OUT",
			"m IN",			"m Mic",
			"n Headphone",		"n OUT",
			"n IN",			"n Mic",
			"o Headphone",		"o OUT",
			"o IN",			"o Mic",
			"a IN",			"a Mic",
			"b IN",			"b Mic",
			"c IN",			"c Mic",
			"d IN",			"d Mic",
			"e Headphone",		"e OUT",
			"e IN",			"e Mic",
			"d1 Headphone",		"d1 OUT",
			"d2 Headphone",		"d2 OUT";

		nvidia,xbar = <&tegra_axbar>;

		rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&rt5659_codec>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "rt5659-aif1";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};
....
....
....
}

the console message is

[    6.282487] tegra210_adsp_audio_platform_probe: platform probe started
[    6.283036] tegra210-adsp adsp_audio: Default param-type to BYTE for mp3-dec1
[    6.283254] tegra210-adsp adsp_audio: Default param-type to BYTE for spkprot
[    6.283556] tegra210-adsp adsp_audio: Default param-type to BYTE for src
[    6.283805] tegra210-adsp adsp_audio: Default param-type to BYTE for aac-dec1
[    6.284108] tegra210-adsp adsp_audio: Default param-type to BYTE for aec
[    6.284112] tegra210-adsp adsp_audio: adma channel page address dt entry not found
[    6.284113] tegra210-adsp adsp_audio: using adma channel page 0
[    6.295207] tegra210_adsp_audio_platform_probe probe successfull.
[    6.295207] OPE platform probe
[    6.295278] OPE platform probe successful
[    6.365993] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF1 <-> ADMAIF1 mapping ok
[    6.366069] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF2 <-> ADMAIF2 mapping ok
[    6.366139] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF3 <-> ADMAIF3 mapping ok
[    6.366208] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF4 <-> ADMAIF4 mapping ok
[    6.366277] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF5 <-> ADMAIF5 mapping ok
[    6.366345] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF6 <-> ADMAIF6 mapping ok
[    6.366418] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF7 <-> ADMAIF7 mapping ok
[    6.366487] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF8 <-> ADMAIF8 mapping ok
[    6.366557] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF9 <-> ADMAIF9 mapping ok
[    6.366626] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF10 <-> ADMAIF10 mapping ok
[    6.366702] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF11 <-> ADMAIF11 mapping ok
[    6.366770] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF12 <-> ADMAIF12 mapping ok
[    6.366872] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF13 <-> ADMAIF13 mapping ok
[    6.366940] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF14 <-> ADMAIF14 mapping ok
[    6.367007] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF15 <-> ADMAIF15 mapping ok
[    6.367078] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF16 <-> ADMAIF16 mapping ok
[    6.367150] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF17 <-> ADMAIF17 mapping ok
[    6.367221] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF18 <-> ADMAIF18 mapping ok
[    6.367292] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF19 <-> ADMAIF19 mapping ok
[    6.367363] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF20 <-> ADMAIF20 mapping ok
[    6.370346] tegra-snd-t186ref-mobile-rt565x sound: ADSP-FE1 <-> ADSP PCM1 mapping ok
[    6.370424] tegra-snd-t186ref-mobile-rt565x sound: ADSP-FE2 <-> ADSP PCM2 mapping ok
[    6.370448] compress asoc: ADSP-FE3 <-> ADSP COMPR1 mapping ok
[    6.370470] compress asoc: ADSP-FE4 <-> ADSP COMPR2 mapping ok
[    6.371182] gpio tegra-gpio wake12 for gpio=77(J:5)
[    6.411547] input: tegra-snd-t186ref-mobile-rt565x Headphone Jack as /devices/sound/sound/card1/input2
[    6.412235] tegra-snd-t186ref-mobile-rt565x sound: codec-dai "rt5659-aif1" registered
[    6.413005] GACT probability NOT on
[    6.413015] Mirror/redirect action on
[    6.413027] u32 classifier
[    6.413028]     Actions configured
[    6.413050] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[    6.413859] ipip: IPv4 over IPv4 tunneling driver
[    6.414184] Initializing XFRM netlink socket
[    6.414550] NET: Registered protocol family 10
[    6.415315] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    6.415380] NET: Registered protocol family 17
[    6.415395] NET: Registered protocol family 15

and 

nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 1
[sudo] password for nvidia:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$

but kernel always show

[   35.010863] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.010865] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.010899] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.010900] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.010902] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.010922] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.010924] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.010925] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.010947] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.010949] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.010950] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.010972] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.010973] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.010974] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.154159] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.154161] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.154164] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.154195] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.154196] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.154198] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.154219] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.154220] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.154222] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.154243] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.154245] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.154246] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.154267] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.154268] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.154269] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.280686] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.280688] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.280691] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.280783] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.280785] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.280786] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.280854] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.280856] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.280857] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.280936] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.280937] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.280939] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.281016] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.281017] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.281019] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.436279] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.436281] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.436284] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.436403] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.436404] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.436406] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.436494] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.436495] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.436497] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.436599] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.436600] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.436602] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   35.436703] tegra-snd-t186ref-mobile-rt565x sound: codec_dai clock not set
[   35.436704] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   35.436706] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524

do you have any suggestion?

So it appears that setting the codec sysclk is failing …

311                 if (!machine->is_codec_dummy) {
 312                         err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai,
 313                         RT5659_SCLK_S_MCLK, clk_out_rate, SND_SOC_CLOCK_IN);
 314                         if (err < 0) {
 315                                 dev_err(card->dev, "codec_dai clock not set\n");
 316                                 return err;
 317                         }
 318                 }

Interestingly, the error you are getting is -524 which means ENOTSUPP, which means the kernel did not find the ‘set_sysclk’ handler for the codec …

2032 /**
2033  * snd_soc_dai_set_sysclk - configure DAI system or master clock.
2034  * @dai: DAI
2035  * @clk_id: DAI specific clock ID
2036  * @freq: new clock frequency in Hz
2037  * @dir: new clock direction - input/output.
2038  *
2039  * Configures the DAI master (MCLK) or system (SYSCLK) clocking.
2040  */
2041 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
2042         unsigned int freq, int dir)
2043 {
2044         if (dai->driver && dai->driver->ops->set_sysclk)
2045                 return dai->driver->ops->set_sysclk(dai, clk_id, freq, dir);
2046         else if (dai->codec && dai->codec->driver->set_sysclk)
2047                 return dai->codec->driver->set_sysclk(dai->codec, clk_id, 0,
2048                                                       freq, dir);
2049         else
2050                 <b>return -ENOTSUPP;</b>
2051 }

Which is very odd as this is clearly defined in ‘rt5659_aif_dai_ops’. Can you make the following change to the print to get more info …

diff --git a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
index 422ccc703f48..d204c5cdbee8 100644
--- a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
+++ b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
@@ -312,7 +312,8 @@ static int tegra_t186ref_dai_init(struct snd_soc_pcm_runtime *rtd,
                        err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai,
                        RT5659_SCLK_S_MCLK, clk_out_rate, SND_SOC_CLOCK_IN);
                        if (err < 0) {
-                               dev_err(card->dev, "codec_dai clock not set\n");
+                               dev_err(card->dev, "codec_dai clock not set for %s\n",
+                                       card->rtd[idx].dai_link->codec_dai_name);
                                return err;
                        }

Regards,
Jon

Actually, there is more than one place where the error ‘codec_dai clock not set’ can be printed. Can you make the following change instead …

diff --git a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
index 422ccc703f48..50213210df41 100644
--- a/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
+++ b/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c
@@ -312,7 +312,8 @@ static int tegra_t186ref_dai_init(struct snd_soc_pcm_runtime *rtd,
                        err = snd_soc_dai_set_sysclk(card->rtd[idx].codec_dai,
                        RT5659_SCLK_S_MCLK, clk_out_rate, SND_SOC_CLOCK_IN);
                        if (err < 0) {
-                               dev_err(card->dev, "codec_dai clock not set\n");
+                               dev_err(card->dev, "codec_dai clock not set for %s\n",
+                                       card->rtd[idx].dai_link->codec_dai_name);
                                return err;
                        }
                }
@@ -366,7 +367,8 @@ static int tegra_t186ref_dai_init(struct snd_soc_pcm_runtime *rtd,
                                SND_SOC_CLOCK_IN);
 #endif
                        if (err < 0) {
-                               dev_err(card->dev, "codec_dai clock not set\n");
+                               dev_err(card->dev, "codec_dai clock not set for %s\n",
+                                       card->rtd[idx].dai_link->codec_dai_name);
                                return err;
                        }
                }
@@ -387,7 +389,8 @@ static int tegra_t186ref_dai_init(struct snd_soc_pcm_runtime *rtd,
                                SND_SOC_CLOCK_IN);
 #endif
                        if (err < 0) {
-                               dev_err(card->dev, "codec_dai clock not set\n");
+                               dev_err(card->dev, "codec_dai clock not set for %s\n",
+                                       card->rtd[idx].dai_link->codec_dai_name);
                                return err;
                        }
                }

hi jonathanh

i followed your suggestion to modify the dev_err().

and the console message as below

[   28.793339] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.793340] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.793342] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.794365] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.794367] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.794369] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.794417] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.794419] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.794420] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.794450] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.794451] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.794453] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.794480] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.794481] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.794483] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.794506] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.794507] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.794509] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.795549] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.795551] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.795553] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.795588] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.795589] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.795591] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.795619] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.795620] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.795621] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.795649] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.795650] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.795652] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.795675] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.795676] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.795677] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.796615] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.796616] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.796618] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.796739] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.796740] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.796742] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524
[   28.796828] tegra-snd-t186ref-mobile-rt565x sound: [line=336]codec_dai clock not set for dit-hifi
[   28.796830] tegra-snd-t186ref-mobile-rt565x sound: Failed dai init
[   28.796831] tegra-snd-t186ref-mobile-rt565x sound: ASoC: machine hw_params failed: -524

the sound structure

tegra_sound: sound {
		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
		nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
		nvidia,num-codec-link = <13>;
		nvidia,num-clk = <8>;
		nvidia,ldo-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_HIGH>;
		nvidia,hp-det-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
		nvidia,clk-rates = < 270950400	/* PLLA_x11025_RATE */
				     11289600	/* AUD_MCLK_x11025_RATE */
				     45158400	/* PLLA_OUT0_x11025_RATE */
				     45158400	/* AHUB_x11025_RATE */
				     245760000  /* PLLA_x8000_RATE */
				     12288000	/* AUD_MCLK_x8000_RATE */
				     49152000	/* PLLA_OUT0_x8000_RATE */
				     49152000 >;/* AHUB_x8000_RATE */
		clocks = <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
			<&tegra_car TEGRA186_CLK_PLLA>,
			<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
			<&tegra_car TEGRA186_CLK_AHUB>,
			<&tegra_car TEGRA186_CLK_CLK_M>,
			<&tegra_car TEGRA186_CLK_AUD_MCLK>;
		clock-names = "pll_p_out1", "pll_a", "pll_a_out0", "ahub",
				"clk_m", "extern1";
		resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
		reset-names = "extern1_rst";

		status = "okay";
		nvidia,audio-routing =
			"x Headphone Jack",     "x HPO L Playback",
			"x Headphone Jack",     "x HPO R Playback",
			"x IN1P",               "x Mic Jack",
			"x Int Spk",            "x SPO Playback",
			"y Headphone",		"y OUT",
			"y IN",			"y Mic",
			"z IN",			"z OUT",
			"m Headphone",		"m OUT",
			"m IN",			"m Mic",
			"n Headphone",		"n OUT",
			"n IN",			"n Mic",
			"o Headphone",		"o OUT",
			"o IN",			"o Mic",
			"a IN",			"a Mic",
			"b IN",			"b Mic",
			"c IN",			"c Mic",
			"d IN",			"d Mic",
			"e Headphone",		"e OUT",
			"e IN",			"e Mic",
			"d1 Headphone",		"d1 OUT",
			"d2 Headphone",		"d2 OUT";

		nvidia,xbar = <&tegra_axbar>;

		rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&rt5659_codec>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "rt5659-aif1";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};
		nvidia,dai-link-2 {
			link-name = "spdif-dit-1";
			cpu-dai = <&tegra_i2s2>;
			codec-dai = <&spdif_dit1>;
			cpu-dai-name = "I2S2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "y";
			status = "okay";
		};
		nvidia,dai-link-3 {
			link-name = "spdif-dit-2";
			cpu-dai = <&tegra_i2s3>;
			codec-dai = <&spdif_dit2>;
			cpu-dai-name = "I2S3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "z";
			status = "okay";
		};
		nvidia,dai-link-4 {
			link-name = "spdif-dit-3";
			cpu-dai = <&tegra_i2s4>;
			codec-dai = <&spdif_dit3>;
			cpu-dai-name = "I2S4";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "m";
			status = "okay";
		};
		nvidia,dai-link-5 {
			link-name = "spdif-dit-4";
			cpu-dai = <&tegra_i2s5>;
			codec-dai = <&spdif_dit4>;
			cpu-dai-name = "I2S5";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "n";
			status = "okay";
		};
		nvidia,dai-link-6 {
			link-name = "spdif-dit-6";
			cpu-dai = <&tegra_i2s6>;
			codec-dai = <&spdif_dit6>;
			cpu-dai-name = "I2S6";
			codec-dai-name = "dit-hifi";
			tx-mask = <0xFF>;
			rx-mask = <0xFF>;
			format = "dsp_a";
			bitclock-slave;
			frame-slave;
			bitclock-inversion;
			frame-inversion;
			bit-format = "s16_le";
			bclk_ratio = <4>;
			srate = <8000>;
			num-channel = <1>;
			ignore_suspend;
			name-prefix = "o";
			status = "okay";
		};
		nvidia,dai-link-7 {
			link-name = "spdif-dit-7";
			cpu-dai = <&tegra_dmic1>;
			codec-dai = <&spdif_dit7>;
			cpu-dai-name = "DMIC1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "a";
			status = "okay";
		};
		nvidia,dai-link-8 {
			link-name = "spdif-dit-8";
			cpu-dai = <&tegra_dmic2>;
			codec-dai = <&spdif_dit8>;
			cpu-dai-name = "DMIC2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "b";
			status = "okay";
		};
		nvidia,dai-link-9 {
			link-name = "spdif-dit-9";
			cpu-dai = <&tegra_dmic3>;
			codec-dai = <&spdif_dit9>;
			cpu-dai-name = "DMIC3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "c";
			status = "okay";
		};
		nvidia,dai-link-10 {
			link-name = "spdif-dit-10";
			cpu-dai = <&tegra_dmic4>;
			codec-dai = <&spdif_dit10>;
			cpu-dai-name = "DMIC4";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "d";
			status = "okay";
		};
		spdif_dai_link: nvidia,dai-link-11 {
			link-name = "spdif-playback";
			cpu-dai = <&tegra_spdif>;
			codec-dai = <&spdif_dit11>;
			cpu-dai-name = "SPDIF1-1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "e";
			status = "okay";
		};
		dspk_1_dai_link: nvidia,dai-link-12 {
			link-name = "dspk-playback-r";
			cpu-dai = <&tegra_dspk1>;
			codec-dai = <&spdif_dit12>;
			cpu-dai-name = "DSPK1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "d1";
			status = "okay";
		};
		dspk_2_dai_link: nvidia,dai-link-13 {
			link-name = "dspk-playback-l";
			cpu-dai = <&tegra_dspk2>;
			codec-dai = <&spdif_dit13>;
			cpu-dai-name = "DSPK2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "d2";
			status = "okay";
                };
	};

do you have same issue when you bring up rt5658 ?

i update the kernel.
i use R28.2 and followed jonathanh step to bring up my rt5659.

in tegra186-quill-common-p3310-1000-a00.dtsi

gpio@2200000 {
		wifi_over_pcie {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(R, 4) 0>;
			output-low;
			label = "wifi-over-pcie";
			status = "disabled";
		};
		pcie0_lane2_mux {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(R, 3) 0>;
			output-low;
			label = "pcie-lane2-mux";
			status = "disabled";
		};
		e3325_sdio_rst {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(B, 6) 0>;
			output-high;
			label = "e3325-sdio-rst";
			status = "disabled";
		};
		e3325_lane0_mux {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(B, 4) 0>;
			output-low;
			label = "e3325-lane0-mux";
			status = "disabled";
		};
		aud_rst {
			gpio-hog;
			gpios = <TEGRA_MAIN_GPIO(J, 6) 0>;
			output-high;
			label = "audio reset";
			status = "okay";
        };
	};

in tegra186-quill-p3310-1000-a00-00-base.dts

	i2c@c240000 {
		clock-frequency = <400000>;
		rt5659_codec: rt5659@1b {
			compatible = "realtek,rt5659";
			reg = <0x1b>;
		};
	};

in tegra186-quill-common.dtsi

tegra_sound: sound {
		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
		nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
		nvidia,num-codec-link = <13>;
		nvidia,num-clk = <8>;
		nvidia,ldo-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_HIGH>;
		nvidia,hp-det-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
		nvidia,clk-rates = < 270950400	/* PLLA_x11025_RATE */
				     11289600	/* AUD_MCLK_x11025_RATE */
				     45158400	/* PLLA_OUT0_x11025_RATE */
				     45158400	/* AHUB_x11025_RATE */
				     245760000  /* PLLA_x8000_RATE */
				     12288000	/* AUD_MCLK_x8000_RATE */
				     49152000	/* PLLA_OUT0_x8000_RATE */
				     49152000 >;/* AHUB_x8000_RATE */
		clocks = <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
			<&tegra_car TEGRA186_CLK_PLLA>,
			<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
			<&tegra_car TEGRA186_CLK_AHUB>,
			<&tegra_car TEGRA186_CLK_CLK_M>,
			<&tegra_car TEGRA186_CLK_AUD_MCLK>;
		clock-names = "pll_p_out1", "pll_a", "pll_a_out0", "ahub",
				"clk_m", "extern1";
		resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
		reset-names = "extern1_rst";

		status = "okay";
		nvidia,audio-routing =
			"x Headphone Jack",     "x HPO L Playback",
			"x Headphone Jack",     "x HPO R Playback",
			"x IN1P",               "x Mic Jack",
			"x Int Spk",            "x SPO Playback",
			"y Headphone",		"y OUT",
			"y IN",			"y Mic",
			"z Headphone",		"z OUT",
			"z IN",			"z Mic",
			"m Headphone",		"m OUT",
			"m IN",			"m Mic",
			"n Headphone",		"n OUT",
			"n IN",			"n Mic",
			"o Headphone",		"o OUT",
			"o IN",			"o Mic",
			"a IN",			"a Mic",
			"b IN",			"b Mic",
			"c IN",			"c Mic",
			"d IN",			"d Mic",
			"e Headphone",		"e OUT",
			"e IN",			"e Mic",
			"d1 Headphone",		"d1 OUT",
			"d2 Headphone",		"d2 OUT";

		nvidia,xbar = <&tegra_axbar>;
 
		rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&spdif_dit0>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};
		nvidia,dai-link-2 {
			link-name = "spdif-dit-1";
			cpu-dai = <&tegra_i2s2>;
			codec-dai = <&spdif_dit1>;
			cpu-dai-name = "I2S2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "y";
			status = "okay";
		};
		nvidia,dai-link-3 {
			link-name = "spdif-dit-2";
			cpu-dai = <&tegra_i2s3>;
			codec-dai = <&spdif_dit2>;
			cpu-dai-name = "I2S3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "z";
			status = "okay";
		};
		nvidia,dai-link-4 {
			link-name = "spdif-dit-3";
			cpu-dai = <&tegra_i2s4>;
			codec-dai = <&spdif_dit3>;
			cpu-dai-name = "I2S4";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "m";
			status = "okay";
		};
		nvidia,dai-link-5 {
			link-name = "spdif-dit-4";
			cpu-dai = <&tegra_i2s5>;
			codec-dai = <&spdif_dit4>;
			cpu-dai-name = "I2S5";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "n";
			status = "okay";
		};
		nvidia,dai-link-6 {
			link-name = "spdif-dit-6";
			cpu-dai = <&tegra_i2s6>;
			codec-dai = <&spdif_dit6>;
			cpu-dai-name = "I2S6";
			codec-dai-name = "dit-hifi";
			tx-mask = <0xFF>;
			rx-mask = <0xFF>;
			format = "dsp_a";
			bitclock-slave;
			frame-slave;
			bitclock-inversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <4>;
			srate = <8000>;
			num-channel = <1>;
			ignore_suspend;
			name-prefix = "o";
			status = "okay";
		};
		nvidia,dai-link-7 {
			link-name = "spdif-dit-7";
			cpu-dai = <&tegra_dmic1>;
			codec-dai = <&spdif_dit7>;
			cpu-dai-name = "DMIC1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "a";
			status = "okay";
		};
		nvidia,dai-link-8 {
			link-name = "spdif-dit-8";
			cpu-dai = <&tegra_dmic2>;
			codec-dai = <&spdif_dit8>;
			cpu-dai-name = "DMIC2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "b";
			status = "okay";
		};
		nvidia,dai-link-9 {
			link-name = "spdif-dit-9";
			cpu-dai = <&tegra_dmic3>;
			codec-dai = <&spdif_dit9>;
			cpu-dai-name = "DMIC3";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "c";
			status = "okay";
		};
		nvidia,dai-link-10 {
			link-name = "spdif-dit-10";
			cpu-dai = <&tegra_dmic4>;
			codec-dai = <&spdif_dit10>;
			cpu-dai-name = "DMIC4";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			ignore_suspend;
			num-channel = <2>;
			name-prefix = "d";
			status = "okay";
		};
		spdif_dai_link: nvidia,dai-link-11 {
			link-name = "spdif-playback";
			cpu-dai = <&tegra_spdif>;
			codec-dai = <&spdif_dit11>;
			cpu-dai-name = "SPDIF1-1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "e";
			status = "okay";
		};
		dspk_1_dai_link: nvidia,dai-link-12 {
			link-name = "dspk-playback-r";
			cpu-dai = <&tegra_dspk1>;
			codec-dai = <&spdif_dit12>;
			cpu-dai-name = "DSPK1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "d1";
			status = "okay";
		};
		dspk_2_dai_link: nvidia,dai-link-13 {
			link-name = "dspk-playback-l";
			cpu-dai = <&tegra_dspk2>;
			codec-dai = <&spdif_dit13>;
			cpu-dai-name = "DSPK2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "d2";
			status = "okay";
                };
	};

i can’t modify codec-dai = <&rt5659_codec>;
so the dai-link-1 is use default setting.
the console message is

[    6.202161] tegra210_adsp_audio_platform_probe: platform probe started
[    6.210109] tegra210-adsp adsp_audio: Default param-type to BYTE for mp3-dec1
[    6.218345] tegra210-adsp adsp_audio: Default param-type to BYTE for spkprot
[    6.226556] tegra210-adsp adsp_audio: Default param-type to BYTE for src
[    6.234341] tegra210-adsp adsp_audio: Default param-type to BYTE for aac-dec1
[    6.242573] tegra210-adsp adsp_audio: Default param-type to BYTE for aec
[    6.250050] tegra210-adsp adsp_audio: adma channel page address dt entry not found
[    6.259089] tegra210-adsp adsp_audio: using adma channel page 0
[    6.265803] tegra210_adsp_audio_platform_probe probe successfull.
[    6.282904] OPE platform probe
[    6.287775] OPE platform probe successful
[    6.386174] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF1 <-> ADMAIF1 mapping ok
[    6.394812] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF2 <-> ADMAIF2 mapping ok
[    6.403401] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF3 <-> ADMAIF3 mapping ok
[    6.412004] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF4 <-> ADMAIF4 mapping ok
[    6.420599] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF5 <-> ADMAIF5 mapping ok
[    6.429205] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF6 <-> ADMAIF6 mapping ok
[    6.437833] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF7 <-> ADMAIF7 mapping ok
[    6.446442] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF8 <-> ADMAIF8 mapping ok
[    6.455141] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF9 <-> ADMAIF9 mapping ok
[    6.467603] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF10 <-> ADMAIF10 mapping ok
[    6.476598] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF11 <-> ADMAIF11 mapping ok
[    6.485614] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF12 <-> ADMAIF12 mapping ok
[    6.494678] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF13 <-> ADMAIF13 mapping ok
[    6.503757] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF14 <-> ADMAIF14 mapping ok
[    6.512839] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF15 <-> ADMAIF15 mapping ok
[    6.521909] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF16 <-> ADMAIF16 mapping ok
[    6.530976] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF17 <-> ADMAIF17 mapping ok
[    6.540039] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF18 <-> ADMAIF18 mapping ok
[    6.549118] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF19 <-> ADMAIF19 mapping ok
[    6.558179] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF20 <-> ADMAIF20 mapping ok
[    6.570817] tegra-snd-t186ref-mobile-rt565x sound: ADSP-FE1 <-> ADSP PCM1 mapping ok
[    6.580025] tegra-snd-t186ref-mobile-rt565x sound: ADSP-FE2 <-> ADSP PCM2 mapping ok
[    6.589131] compress asoc: ADSP-FE3 <-> ADSP COMPR1 mapping ok
[    6.595678] compress asoc: ADSP-FE4 <-> ADSP COMPR2 mapping ok
[    6.618473] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no source widget found for x HPO L Playback
[    6.628928] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route x HPO L Playback -> direct -> x Headphone Jack
[    6.641356] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no source widget found for x HPO R Playback
[    6.651737] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route x HPO R Playback -> direct -> x Headphone Jack
[    6.664139] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no sink widget found for x IN1P
[    6.673475] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route x Mic Jack -> direct -> x IN1P
[    6.684509] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no source widget found for x SPO Playback
[    6.694731] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route x SPO Playback -> direct -> x Int Spk
[    6.725687] input: tegra-snd-t186ref-mobile-rt565x Headphone Jack as /devices/sound/sound/card1/input2
[    6.737051] tegra-snd-t186ref-mobile-rt565x sound: codec-dai "dit-hifi" registered
[    6.745879] tegra-snd-t186ref-mobile-rt565x sound: This is a dummy codec
[    6.753770] GACT probability NOT on
[    6.757894] Mirror/redirect action on
[    6.762177] u32 classifier
[    6.765498]     Actions configured
[    6.769539] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[    6.776989] IPVS: Registered protocols ()
[    6.781677] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[    6.790273] IPVS: Creating netns size=1424 id=0
[    6.795438] IPVS: ipvs loaded.
[    6.799068] IPVS: [rr] scheduler registered.
[    6.803998] ipip: IPv4 over IPv4 tunneling driver

nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 1
[sudo] password for nvidia:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$

any NV people can give some suggestion?

Thanks, however, without seeing your source file (which probably has some local modifications), it is not 100% clear to me what line 336 is. The print I had suggested would have printed the name of the dai-link and made it clear what was failing. Can you either provide the source file or implement the print I suggested.

No I have not had this issue.

Regards,
Jon

Yes this is expected because you have not modified the ‘codec-dai’ and ‘codec-dai-name’ for nvidia,dai-link-1. You say that you cannot modify this, but what exactly do you mean by that? Are you getting a compilation error? If so you need to make sure you have added the codec to the appropriate i2c bus.

Regards
Jon

Hi jonathanh

i am very sorry about my Explanation.

now i use R28.2 to test audio codec.
if i modify the dai-link1 i have build error

nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s1>;
-			codec-dai = <&spdif_dit0>;
+                       codec-dai = <&rt5659_codec>;
			cpu-dai-name = "I2S1";
-			codec-dai-name = "dit-hifi";
+                       codec-dai-name = "rt5659-aif1";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};

and the build message is

CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  GEN     ./Makefile
  Using .. as source for kernel
  CHK     include/generated/utsrelease.h
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-ape-cam.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-edp.dtb
make[2]: `include/generated/mach-types.h' is up to date.
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-dsi-hdmi-dp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-dp.dtb
  CHK     include/generated/timeconst.h
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-dp-bl.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-hdmi.dtb
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    ../scripts/checksyscalls.sh
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-hdmi-imx274.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-dsi-dp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dp-primary.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-c03-00.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-a00-00.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base-mods-display.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-imx274.dtb
  CHK     include/generated/compile.h
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-a00-00-imx274.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-c03-00-imx274.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-dp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c00-00-auo-1080p-edp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-e3313-1000-a00-00-e2598.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-ucm1.dtb
ERROR (phandle_references): Reference to non-existent node or label "rt5659_codec"

ERROR: Input tree has errors, aborting (use -f to force output)
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-ucm1.dtb] Error 2
make[1]: *** [dtbs] Error 2
make[1]: *** Waiting for unfinished jobs....
  CHK     kernel/config_data.h
make[1]: Leaving directory `/home/etta/storage-disk/nvidia/tx2-kernel/audio-r28.2/sources/kernel/kernel-4.4/kernel-out'
make: *** [sub-make] Error 2

No problem. Looking back at your change in comment #3, you need to add the label ‘rt5659_codec’ to where you had added the codec. For example …

i2c@c240000 {
        clock-frequency = <400000>;

        <b>rt5659_codec: </b>rt5659@1c {
            compatible = "realtek,rt5659";
            reg = <0x1c>;
            interrupts = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
            realtek,ldo1-en-gpios =<&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_HIGH>;
        };
    };

Regards,
Jon

Hi jonathanh

i can build the kernel and i can bring up codec.

when i use command to play music aplay -Dhw:1,0 test.wav
i can’t hear anything.

[    4.499030] PD DISP2 index4 UP
[    4.500625] Parent Clock set for DC plld2
[    4.503771] tegradc 15210000.nvdisplay: hdmi: pclk:106700K, set prod-setting:prod_c_150M
[    4.518175] random: nonblocking pool is initialized
[    5.664589] tegradc 15210000.nvdisplay: hdmi: plugged
[    6.263514] tegra210_adsp_audio_platform_probe: platform probe started
[    6.271967] tegra210-adsp adsp_audio: Default param-type to BYTE for mp3-dec1
[    6.280709] tegra210-adsp adsp_audio: Default param-type to BYTE for spkprot
[    6.289426] tegra210-adsp adsp_audio: Default param-type to BYTE for src
[    6.297747] tegra210-adsp adsp_audio: Default param-type to BYTE for aac-dec1
[    6.306563] tegra210-adsp adsp_audio: Default param-type to BYTE for aec
[    6.314661] tegra210-adsp adsp_audio: adma channel page address dt entry not found
[    6.323635] tegra210-adsp adsp_audio: using adma channel page 0
[    6.330976] tegra210_adsp_audio_platform_probe probe successfull.
[    6.347914] OPE platform probe
[    6.354206] OPE platform probe successful
[    6.455927] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF1 <-> ADMAIF1 mapping ok
[    6.464453] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF2 <-> ADMAIF2 mapping ok
[    6.472996] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF3 <-> ADMAIF3 mapping ok
[    6.481461] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF4 <-> ADMAIF4 mapping ok
[    6.489959] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF5 <-> ADMAIF5 mapping ok
[    6.498397] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF6 <-> ADMAIF6 mapping ok
[    6.506886] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF7 <-> ADMAIF7 mapping ok
[    6.515296] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF8 <-> ADMAIF8 mapping ok
[    6.523736] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF9 <-> ADMAIF9 mapping ok
[    6.532109] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF10 <-> ADMAIF10 mapping ok
[    6.540714] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF11 <-> ADMAIF11 mapping ok
[    6.549256] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF12 <-> ADMAIF12 mapping ok
[    6.557853] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF13 <-> ADMAIF13 mapping ok
[    6.566404] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF14 <-> ADMAIF14 mapping ok
[    6.574985] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF15 <-> ADMAIF15 mapping ok
[    6.583492] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF16 <-> ADMAIF16 mapping ok
[    6.592047] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF17 <-> ADMAIF17 mapping ok
[    6.600557] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF18 <-> ADMAIF18 mapping ok
[    6.609099] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF19 <-> ADMAIF19 mapping ok
[    6.617558] tegra-snd-t186ref-mobile-rt565x sound: ADMAIF20 <-> ADMAIF20 mapping ok
[    6.629819] tegra-snd-t186ref-mobile-rt565x sound: ADSP-FE1 <-> ADSP PCM1 mapping ok
[    6.638455] tegra-snd-t186ref-mobile-rt565x sound: ADSP-FE2 <-> ADSP PCM2 mapping ok
[    6.646900] compress asoc: ADSP-FE3 <-> ADSP COMPR1 mapping ok
[    6.653401] compress asoc: ADSP-FE4 <-> ADSP COMPR2 mapping ok
[    6.675754] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no source widget found for d1 OUT
[    6.684810] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route d1 OUT -> direct -> d1 Headphone
[    6.695472] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no source widget found for d2 OUT
[    6.704411] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route d2 OUT -> direct -> d2 Headphone
[    6.741394] input: tegra-snd-t186ref-mobile-rt565x Headphone Jack as /devices/sound/sound/card1/input2
[    6.752135] tegra-snd-t186ref-mobile-rt565x sound: codec-dai "rt5659-aif1" registered
[    6.761229] GACT probability NOT on
[    6.765428] Mirror/redirect action on
[    6.769796] u32 classifier
[    6.773175]     Actions configured
[    6.777278] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[    6.784849] IPVS: Registered protocols ()
[    6.789598] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[    6.797776] IPVS: Creating netns size=1424 id=0
[    6.803083] IPVS: ipvs loaded.
[    6.806868] IPVS: [rr] scheduler registered.
[    6.811977] ipip: IPv4 over IPv4 tunneling driver
[    6.817761] Initializing XFRM netlink socket
[    6.823072] NET: Registered protocol family 10
[    6.828891] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    6.835114] NET: Registered protocol family 17
nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 1: ADMAIF2 CIF ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 2: ADMAIF3 CIF ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 3: ADMAIF4 CIF ADMAIF4-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 4: ADMAIF5 CIF ADMAIF5-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 5: ADMAIF6 CIF ADMAIF6-5 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 6: ADMAIF7 CIF ADMAIF7-6 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 7: ADMAIF8 CIF ADMAIF8-7 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 8: ADMAIF9 CIF ADMAIF9-8 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 9: ADMAIF10 CIF ADMAIF10-9 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 10: ADMAIF11 CIF ADMAIF11-10 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 11: ADMAIF12 CIF ADMAIF12-11 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 12: ADMAIF13 CIF ADMAIF13-12 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 13: ADMAIF14 CIF ADMAIF14-13 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 14: ADMAIF15 CIF ADMAIF15-14 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 15: ADMAIF16 CIF ADMAIF16-15 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 16: ADMAIF17 CIF ADMAIF17-16 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 17: ADMAIF18 CIF ADMAIF18-17 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 18: ADMAIF19 CIF ADMAIF19-18 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 19: ADMAIF20 CIF ADMAIF20-19 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 154: ADSP PCM1 ADSP-FE1-154 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 155: ADSP PCM2 ADSP-FE2-155 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$ aplay -Dhw:1,0 test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

how do i debug it?

Great! Are you using the headphone output?

Can you try executing the following commands to configure the codec?

amixer -c tegrasndt186ref cset name="I2S1 Mux" "ADMAIF1"
amixer -c tegrasndt186ref cset name="x Stereo DAC MIXR DAC R1 Switch" on
amixer -c tegrasndt186ref cset name="x Stereo DAC MIXL DAC L1 Switch" on
amixer -c tegrasndt186ref cset name="x HPO R Playback Switch" on
amixer -c tegrasndt186ref cset name="x HPO L Playback Switch" on
amixer -c tegrasndt186ref cset name="x Headphone Jack Switch" on
amixer -c tegrasndt186ref cset name="x Stereo DAC MIXR DAC R1 Switch" on
amixer -c tegrasndt186ref cset name="x Stereo DAC MIXL DAC L1 Switch" on
amixer -c tegrasndt186ref cset name="x Headphone Playback Volume" "31,31"
amixer -c tegrasndt186ref cset name="x DAC1 Playback Volume" "175,175"
amixer -c tegrasndt186ref cset name="x DAC1 Playback Switch" on
amixer -c tegrasndt186ref cset name="x DAC1 MIXR DAC1 Switch" on
amixer -c tegrasndt186ref cset name="x DAC1 MIXL DAC1 Switch" on
amixer -c tegrasndt186ref cset name="x Int Spk Switch" on

Regards,
Jon

Hi jonathanh

i use headphone output.
after i set the amixer command i still can’t hear the voice.
the log as beolw

nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="I2S1 Mux" "ADMAIF1"
numid=687,iface=MIXER,name='I2S1 Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=83
  ; Item #0 'None'
  ; Item #1 'ADMAIF1'
  ; Item #2 'ADMAIF2'
  ; Item #3 'ADMAIF3'
  ; Item #4 'ADMAIF4'
  ; Item #5 'ADMAIF5'
  ; Item #6 'ADMAIF6'
  ; Item #7 'ADMAIF7'
  ; Item #8 'ADMAIF8'
  ; Item #9 'ADMAIF9'
  ; Item #10 'ADMAIF10'
  ; Item #11 'ADMAIF11'
  ; Item #12 'ADMAIF12'
  ; Item #13 'ADMAIF13'
  ; Item #14 'ADMAIF14'
  ; Item #15 'ADMAIF15'
  ; Item #16 'ADMAIF16'
  ; Item #17 'I2S1'
  ; Item #18 'I2S2'
  ; Item #19 'I2S3'
  ; Item #20 'I2S4'
  ; Item #21 'I2S5'
  ; Item #22 'I2S6'
  ; Item #23 'SFC1'
  ; Item #24 'SFC2'
  ; Item #25 'SFC3'
  ; Item #26 'SFC4'
  ; Item #27 'MIXER1-1'
  ; Item #28 'MIXER1-2'
  ; Item #29 'MIXER1-3'
  ; Item #30 'MIXER1-4'
  ; Item #31 'MIXER1-5'
  ; Item #32 'AMX1'
  ; Item #33 'AMX2'
  ; Item #34 'AMX3'
  ; Item #35 'AMX4'
  ; Item #36 'ARAD1'
  ; Item #37 'SPDIF1-1'
  ; Item #38 'SPDIF1-2'
  ; Item #39 'AFC1'
  ; Item #40 'AFC2'
  ; Item #41 'AFC3'
  ; Item #42 'AFC4'
  ; Item #43 'AFC5'
  ; Item #44 'AFC6'
  ; Item #45 'OPE1'
  ; Item #46 'SPKPROT1'
  ; Item #47 'MVC1'
  ; Item #48 'MVC2'
  ; Item #49 'IQC1-1'
  ; Item #50 'IQC1-2'
  ; Item #51 'IQC2-1'
  ; Item #52 'IQC2-2'
  ; Item #53 'DMIC1'
  ; Item #54 'DMIC2'
  ; Item #55 'DMIC3'
  ; Item #56 'DMIC4'
  ; Item #57 'ADX1-1'
  ; Item #58 'ADX1-2'
  ; Item #59 'ADX1-3'
  ; Item #60 'ADX1-4'
  ; Item #61 'ADX2-1'
  ; Item #62 'ADX2-2'
  ; Item #63 'ADX2-3'
  ; Item #64 'ADX2-4'
  ; Item #65 'ADX3-1'
  ; Item #66 'ADX3-2'
  ; Item #67 'ADX3-3'
  ; Item #68 'ADX3-4'
  ; Item #69 'ADX4-1'
  ; Item #70 'ADX4-2'
  ; Item #71 'ADX4-3'
  ; Item #72 'ADX4-4'
  ; Item #73 'ADMAIF17'
  ; Item #74 'ADMAIF18'
  ; Item #75 'ADMAIF19'
  ; Item #76 'ADMAIF20'
  ; Item #77 'ASRC1-1'
  ; Item #78 'ASRC1-2'
  ; Item #79 'ASRC1-3'
  ; Item #80 'ASRC1-4'
  ; Item #81 'ASRC1-5'
  ; Item #82 'ASRC1-6'
  : values=1
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x Stereo DAC MIXR DAC R1 Switch" on
numid=952,iface=MIXER,name='x Stereo DAC MIXR DAC R1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x Stereo DAC MIXL DAC L1 Switch" on
numid=947,iface=MIXER,name='x Stereo DAC MIXL DAC L1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x HPO R Playback Switch" on
numid=1008,iface=MIXER,name='x HPO R Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x HPO L Playback Switch" on
numid=1007,iface=MIXER,name='x HPO L Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x Headphone Jack Switch" on
numid=670,iface=MIXER,name='x Headphone Jack Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x Stereo DAC MIXR DAC R1 Switch" on
numid=952,iface=MIXER,name='x Stereo DAC MIXR DAC R1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x Stereo DAC MIXL DAC L1 Switch" on
numid=947,iface=MIXER,name='x Stereo DAC MIXL DAC L1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x Headphone Playback Volume" "31,31"
numid=578,iface=MIXER,name='x Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0
  : values=31,31
  | dBscale-min=-23.25dB,step=0.75dB,mute=0
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x DAC1 Playback Volume" "175,175"
numid=581,iface=MIXER,name='x DAC1 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=175,step=0
  : values=175,175
  | dBscale-min=-656.25dB,step=3.75dB,mute=0
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x DAC1 Playback Switch" on
numid=582,iface=MIXER,name='x DAC1 Playback Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x DAC1 MIXR DAC1 Switch" on
numid=938,iface=MIXER,name='x DAC1 MIXR DAC1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x DAC1 MIXL DAC1 Switch" on
numid=936,iface=MIXER,name='x DAC1 MIXL DAC1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ amixer -c tegrasndt186ref cset name="x Int Spk Switch" on
numid=669,iface=MIXER,name='x Int Spk Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
nvidia@tegra-ubuntu:~$ sudo i2cdetect -y -r 1
[sudo] password for nvidia:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
nvidia@tegra-ubuntu:~$

before i insert the headphone

nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep gpio_aud0_pj5
Bank: 0 Reg: 0x02431018 Val: 0x00000058 -> gpio_aud0_pj5
nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_gpio | grep "Port\|J:5"
Port:Pin:ENB DBC IN OUT_CTRL OUT_VAL INT_CLR
J:5 0x1 0x0 0x1 0x1 0x0 0x0
nvidia@tegra-ubuntu:~$

after i insert the headphone

nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep gpio_aud0_pj5
Bank: 0 Reg: 0x02431018 Val: 0x00000058 -> gpio_aud0_pj5
nvidia@tegra-ubuntu:~$
nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_gpio | grep "Port\|J:5"
Port:Pin:ENB DBC IN OUT_CTRL OUT_VAL INT_CLR
J:5 0x1 0x0 0x1 0x1 0x0 0x0
nvidia@tegra-ubuntu:~$

how can i get the i2c_gp0 i2s0 GPIO20/AUD_INT and GPIO19/AUD_RST message to debug this issue?

what’s mean of the message?

[    6.611719] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no source widget found for d1 OUT
[    6.621300] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route d1 OUT -> direct -> d1 Headphone
[    6.632489] tegra-snd-t186ref-mobile-rt565x sound: ASoC: no source widget found for d2 OUT
[    6.641998] tegra-snd-t186ref-mobile-rt565x sound: ASoC: Failed to add route d2 OUT -> direct -> d2 Headphone