Jon,
Thanks. I found that documentation not long before your response. I’ve been going in circles chasing down some error messages, but I’ve hit a dead end. I’ve modified tegra186-quill-common.dtsi. Currently it has:
i2c@3160000 {
.....
tlv320aic31xx: tlv320aic31xx@18 {
compatible = "ti,tlv320aic3120";
reg = <0x18>;
status = "okay";
/* Deprecated in future versions (used reset-gpios instead) */
gpio-reset = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_LOW>; //GPIO3_PJ.06
};
};
.....
tegra_sound: sound {
compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
nvidia,num-codec-link = <12>;
clocks = <&tegra_car TEGRA186_CLK_PLLA>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_AHUB>,
<&tegra_car TEGRA186_CLK_AUD_MCLK>;
clock-names = "pll_a", "pll_a_out0", "ahub", "extern1";
assigned-clocks = <&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_AHUB>,
<&tegra_car TEGRA186_CLK_AUD_MCLK>;
assigned-clock-parents = <&tegra_car TEGRA186_CLK_PLLA>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>;
resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
reset-names = "extern1_rst";
status = "okay";
nvidia,audio-routing =
"x Headphone", "x HPL",
"x Headphone", "x HPR",
"x Speaker", "x SPK",
"x MIC1LP", "x Mic",
"x MIC1RP", "x Mic",
"x MIC1LM", "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",
"d3 Headphone", "d3 OUT";
nvidia,xbar = <&tegra_axbar>;
mclk-fs = <256>;
rt565x_dai_link: nvidia,dai-link-1 {
link-name = "tlv320aic31xx-codec";
cpu-dai = <&tegra_i2s1>;
codec-dai = <&tlv320aic31xx>;
cpu-dai-name = "I2S1";
codec-dai-name = "tlv320aic31xx-hifi";
format = "i2s";
bit-format = "s16_le";
srate = <48000>;
num-channel = <2>;
ignore_suspend;
bitclock-master;
frame-master;
frame-noninversion;
name-prefix = "x";
status = "okay";
};
....
};
I also modified tegra_machine_driver_mobile.c to include the following (I’m not sure if I really need this though):
rtd = snd_soc_get_pcm_runtime(card, "tlv320aic31xx-codec");
if (rtd) {
dai_params =
(struct snd_soc_pcm_stream *)rtd->dai_link->params;
dai_params->rate_min = srate;
dai_params->channels_min = channels;
dai_params->formats = formats;
dev_err(card->dev, "matched snd_soc_get_pcm_runtime");
}
With this configuration when I get the following errors at boot time:
$ dmesg | grep tlv
[ 1.620563] tlv320aic31xx-codec 0-0018: Unable to sync registers 0x1b-0x1d. -121
[ 1.620568] tlv320aic31xx-codec 0-0018: Failed to restore cache: -121
[ 1.630663] tlv320aic31xx-codec 0-0018: aic31xx_wait_bits: Failed! 0x25 was 0xffffffc0 expected 0x10 (-16, 0x10, 0 us)
[ 1.630671] tlv320aic31xx-codec 0-0018: ASoC: POST_PMU: x SPK ClassD event failed: -1
After investigation I think I had the codec added to the wrong i2c in the devicetree because I see the following with i2cdetect. (Also, we are connected to I2C_GP0_CLK/DAT on the board)
$ i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: UU UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
$ i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
$ i2cdetect -l
i2c-3 i2c 3190000.i2c I2C adapter
i2c-1 i2c c240000.i2c I2C adapter
i2c-8 i2c 31e0000.i2c I2C adapter
i2c-6 i2c 31c0000.i2c I2C adapter
i2c-4 i2c Tegra BPMP I2C adapter I2C adapter
i2c-2 i2c 3180000.i2c I2C adapter
i2c-0 i2c 3160000.i2c I2C adapter
i2c-7 i2c c250000.i2c I2C adapter
i2c-5 i2c 31b0000.i2c I2C adapter
If I move the codec from i2c@3160000 to i2c@c240000 in the devicetree then there are no error messages in dmesg, but
$ i2cdetect -y -r 1
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: -- -- -- -- -- -- -- --
and I still don’t get any audio.
Any ideas where I’m going wrong?