Hello,
I am working on bringup of a custom board that has three ADAU1761 codecs, and a NXP LS1028A SoC. The codecs are supposed to be configured in TDM8 mode and share a common playback I2S bus connected to SAI4, and a common capture I2S bus connected to SAI3.
What is the recommended way of modelling this setup in the Linux device tree ?
So far I have tried the following:
&i2c0 {
status = "okay";
i2c_codec1: adau1761@38 {
compatible = "adi,adau1761";
#sound-dai-cells=<0>;
reg = <0x38>;
tdm-offset = <0>;
clocks = <&adau1761_mclk>;
clock-names = "mclk";
};
i2c_codec2: adau1761@39 {
compatible = "adi,adau1761";
#sound-dai-cells=<0>;
reg = <0x39>;
tdm-offset = <16>;
clocks = <&adau1761_mclk>;
clock-names = "mclk";
};
i2c_codec3: adau1761@3a {
compatible = "adi,adau1761";
#sound-dai-cells=<0>;
reg = <0x3a>;
tdm-offset = <32>;
clocks = <&adau1761_mclk>;
clock-names = "mclk";
};
};
At first I attempted creating three simple-audio-card's. That attempted failed since sharing the same cpu (SAI3 and SAI4) failed with no ALSA device as a result.
Then I attempted cerating a single simple-audio-card with a dai-link containing two cpu sub-nodes and three codec sub-nodes. ALSA enumerates this device, and I get the expected ADAU171 controls for a single codec. But how do I get the two other sets of ADAU171 controls? And how do I do the widgets and routing for this ?
Note: The widgets and routing below is just experimental.
sound {
status = "okay";
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,widgets =
"Headphone", "O1 Headphone",
"Headphone", "O2 Headphone",
"Headphone", "O3 Headphone";
simple-audio-card,routing =
"Playback", "O1 Headphone",
"Playback", "O2 Headphone",
"Playback", "O3 Headphone";
simple-audio-card,dai-link {
format = "i2s";
convert-channels = <8>;
bitclock-master = <&snd_dai_playback>;
frame-master = <&snd_dai_playback>;
snd_dai_capture: cpu@0 {
sound-dai = <&sai3>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <16>;
};
snd_dai_playback: cpu@1 {
sound-dai = <&sai4>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <16>;
};
codec@0 {
sound-dai = <&i2c_codec1>;
frame-master;
bitclock-master;
system-clock-frequency = <25000000>;
};
codec@1 {
sound-dai = <&i2c_codec2>;
system-clock-frequency = <25000000>;
};
codec@2 {
sound-dai = <&i2c_codec3>;
system-clock-frequency = <25000000>;
};
};
};