Hello team,
I have one custom device based on Nvidia jetson xavier NX. I need to check I2S interface. We are using 40 pin connector for this. I tired below changes in
in driver and device tree file. I am mentioning the changes of dts file here.
hdr40_i2c1: i2c@31e0000 {
pinctrl-names = “default”;
pinctrl-0 = <&dpaux_default>;
#size-cells = <0>;
#address-cells = <1>;
ssm2518: ssm2518@34 {
compatible = "adi,ssm2518";
reg = <0x34>;
gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 1) GPIO_ACTIVE_HIGH>;
status = "okay";
};
};
tegra_sound: sound {
status = “okay”;
compatible = “nvidia,tegra-audio-t186ref-mobile-rt565x”;
nvidia,model = “jetson-xaviernx-ape”;
nvidia,num-codec-link = <2>;
clocks = <&bpmp_clks TEGRA194_CLK_PLLA>,
<&bpmp_clks TEGRA194_CLK_PLLA_OUT0>,
<&bpmp_clks TEGRA194_CLK_AUD_MCLK>;
clock-names = “pll_a”, “pll_a_out0”, “extern1”;
assigned-clocks = <&bpmp_clks TEGRA194_CLK_PLLA_OUT0>,
<&bpmp_clks TEGRA194_CLK_AUD_MCLK>;
assigned-clock-parents = <&bpmp_clks TEGRA194_CLK_PLLA>,
<&bpmp_clks TEGRA194_CLK_PLLA_OUT0>;
nvidia,audio-routing =
"x Headphone", "x OUT",
"x IN", "x Mic",
"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",
"d1 Headphone", "d1 OUT",
"d2 Headphone", "d2 OUT";
mclk-fs = <256>;
nvidia,dai-link-1 {
name-prefix = "n";
};
hdr40_snd_link_i2s: nvidia,dai-link-1 {
name-prefix = "x";
};
ssm2518_snd_link_i2s: nvidia,dai-link-5 {
link-name = "ssm2518-codec";
cpu-dai = <&tegra_i2s5>;
codec-dai = <&ssm2518>;
cpu-dai-name = "I2S5";
codec-dai-name = "ssm2518";
format = "i2s";
bitclock-slave;
frame-slave;
bitclock-noninversion;
bit-format = "s16_le";
srate = <48000>;
num-channel = <2>;
bclk_ratio = <1>;
ignore_suspend;
name-prefix = "x";
status = "okay";
};
};
Can you please check once with this changes. we put our kernel driver on kernel-4.9/sound/soc/codec directory.
Linux_for_Tegra/source/public/kernel/kernel-4.9/sound/soc/codecs/ssm2518.c
Linux_for_Tegra/source/public/kernel/kernel-4.9/sound/soc/codecs/ssm2518.h
Made require changes related to SSM2518 in below files:
Linux_for_Tegra/source/public/kernel/kernel-4.9/sound/soc/codecs/Kconfig
Linux_for_Tegra/source/public/kernel/kernel-4.9/sound/soc/codecs/Makefile
sound/soc/tegra-alt/Kconfig
Whenever I am tring to detect sound card, it will give the below error:
" [ 6.453753] tegra-asoc: sound: ASoC: CODEC DAI ssm2518 not registered
[ 6.453968] tegra-asoc: sound: snd_soc_register_card failed (-517)
"
I had added the debug logs for the same. It if failed in “soc_bind_dai_link” API, it will check the list of registered codecs.
Also I had checked the codec list:
nx@nx-desktop:~$ sudo cat /sys/kernel/debug/asoc/codecs
[sudo] password for nx:
ssm2518.8-0034
tegra186-dspk.1
tegra186-dspk.0
tegra186-asrc
tegra186-arad
tegra210-ope.0
tegra210-mvc.1
tegra210-mvc.0
tegra186-afc.5
tegra186-afc.4
tegra186-afc.3
tegra186-afc.2
tegra186-afc.1
tegra186-afc.0
tegra210-sfc.3
tegra210-sfc.2
tegra210-sfc.1
tegra210-sfc.0
tegra210-mixer
tegra210-adx.3
tegra210-adx.2
tegra210-adx.1
tegra210-adx.0
tegra210-amx.3
tegra210-amx.2
tegra210-amx.1
tegra210-amx.0
tegra210-dmic.3
tegra210-dmic.2
tegra210-dmic.1
tegra210-dmic.0
tegra210-i2s.5
tegra210-i2s.4
tegra210-i2s.3
tegra210-i2s.2
tegra210-i2s.1
tegra210-i2s.0
tegra186-admaif
tegra210-axbar
spdif_dit:spdif-dit.13@d
spdif_dit:spdif-dit.12@c
spdif_dit:spdif-dit.11@b
spdif_dit:spdif-dit.10@a
spdif_dit:spdif-dit.9@9
spdif_dit:spdif-dit.8@8
spdif_dit:spdif-dit.7@7
spdif_dit:spdif-dit.6@6
spdif_dit:spdif-dit.5@5
spdif_dit:spdif-dit.4@4
spdif_dit:spdif-dit.3@3
spdif_dit:spdif-dit.2@2
spdif_dit:spdif-dit.1@1
spdif_dit:spdif-dit.0@0
snd-soc-dummy
nx@nx-desktop:~$
I2C detect logs:
nx@nx-desktop:~$ i2cdetect -y -a -r 8
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: – – – – – – – – – – – – – – – –
nx@nx-desktop:~$
I2C device is detected properly and read/write operation is also working fine. I validated with one more change like, executeing below command for enable
I2S5 interface and reboot the device, but not getting success.
$ sudo /opt/nvidia/jetson-io/config-by-function.py -o dtbo i2s5
Can you please help us to resolve this issue asap, as we have to give release on urgent basis.
Thanks and regards
Harsh