Creating dai link between cpu-dai (Master) and multiple codecs (Slaves)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating dai link between cpu-dai (Master) and multiple codecs (Slaves)

1,874 Views
moranmoran
Contributor III

Hello

I am working on a custom design: the host IMX8MM - SAI2  is the audio master for two ADC codecs (TDM) --> my target is to capture 8 MIC ( 4 from each ).

I couldn't find any example for such dai-link: 2 * ADC ( codec ) salves for the same host.

Consider below  dai description :

moranmoran_0-1639925134317.png

Please find my below DTS nodes :

#### Sound card :

sfld-sound-card {
compatible = "simple-audio-card";
simple-audio-card,name = "SFLD-sound-card";
simple-audio-card-widgets =
"Microphone", "Channel1in",
"Microphone", "Channel2in",
"Microphone", "Channel3in",
"Microphone", "Channel4in",
"Microphone", "Channel5in",
"Microphone", "Channel6in",
"Microphone", "Channel7in",
"Microphone", "Channel8in";
simple-audio-card,routing =
"CPU-Capture", "Capture";

simple-audio-card,dai-link@0 {
format = "i2s";
bitclock-master = <&cpu_dai>;
frame-master = <&cpu_dai>;

cpu_dai: cpu { // CPU SAI (Master)
sound-dai = <&sai2>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-rx-mask = <1 1 1 1 1 1 1 1>;
};

codec@0 { // ADC # 1 (slave) --> 4 channels
sound-dai = <&tlv320adc_0> ;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-rx-mask = <1 1 1 1 0 0 0 0>;
};
};

simple-audio-card,dai-link@1 {
format = "i2s";
bitclock-master = <&cpu_dai_1>;
frame-master = <&cpu_dai_1>;

cpu_dai_1: cpu {
sound-dai = <&sai2>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-rx-mask = <1 1 1 1 1 1 1 1>;
};

codec {
sound-dai = <&tlv320adc_1> ;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
dai-tdm-slot-rx-mask = <0 0 0 0 1 1 1 1>;
};

};

};

###### i2c

&i2c4 {
clock-frequency = <100000>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c4>;
pinctrl-1 = <&pinctrl_i2c4_gpio>;
scl-gpios = <&gpio5 20 GPIO_ACTIVE_HIGH>;
sda-gpios = <&gpio5 21 GPIO_ACTIVE_HIGH>;
status = "okay";

tlv320adc_0: tlv320adc@4c {
#sound-dai-cells = <0>;
compatible = "ti,tlv320adc6140";
reg = <0x4c> , <0x4d>;
ti,mic-bias-source = <6>;
// ti,pdm-edge-select = <0 0 0 0>;
ti,gpi-config = <0 0 0 0>;
ti,gpio-config = <0 0>;
ti,gpo-config-1 = <0 0>;
ti,gpo-config-2 = <0 0>;
// reset-gpios = <>;
};

tlv320adc_1: tlv320adc@4d {
#sound-dai-cells = <0>;
compatible = "ti,tlv320adc6140";
reg = <0x4d>;
ti,mic-bias-source = <6>;
// ti,pdm-edge-select = <0 0 0 0>;
ti,gpi-config = <0 0 0 0>;
ti,gpio-config = <0 0>;
ti,gpo-config-1 = <0 0>;
ti,gpo-config-2 = <0 0>;
// reset-gpios = <>;

};
};

 

Please advise how is possible to describe such dai-link in ALSA .

Best regards,

Moran.

 

 

Labels (2)
0 Kudos
3 Replies

1,864 Views
igorpadykov
NXP Employee
NXP Employee

Hi Moran

 

for such case may be useful to look at "sound-bt-sco" example

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mm-evk.d...

 

Best regards
igor

0 Kudos

1,851 Views
moranmoran
Contributor III

Hi Igor.

I'm still can't understand how to declare the 2*ADC ( I2C ) under the "sound-card".

As far as I understand, while using my "sound-card" Alsa should access (works in front) both devices I2C.

 

BR,

Moran. 

0 Kudos

1,792 Views
moranmoran
Contributor III

Hi,

Can someone advise or give an example?

 

Thanks in advance,

Moran/

0 Kudos