Hi community.
I have using IMX8MP with kernel 5.15.60.
I want to create a 768KHz 32bit 16ch Full-duplex audio device. (I attached block-diagram.)
How should I describe it in dts when using "simple-audio-card"?
// linux-imx/Documentation/devicetree/bindings/sound/fsl-sai.txt
// I want to use SAI1 as 768KHz, 32bits, TX 16ch (8 lanes), RX 16ch (8 lanes), but I don't know how to set the dts file.
// TX/RX_SYNC, TX/RX_BCLK are provided external FPGA.
&sai1 {
/* Basic settings are done in "imx8mp.dtsi". */
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
fsl,sai-synchronous-rx; // <<= add for TDM
fsl,sai-multi-lane; // <<= add for TDM
fsl,dataline = <8 0xFF 0xFF>; // <<= add for TDM
status = "okay";
};
~~~
sound-aio16ch{
compatible = "simple-audio-card";
simple-audio-card,name = "products-AIO";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&dailink0_master>; // <<-- What should i write here? (SAI1 does not supply TX/RX_SYNC, TX/RX_BCLK.)
simple-audio-card,frame-master = <&dailink0_master>; // <<-- What should i write here? (SAI1 does not supply TX/RX_SYNC, TX/RX_BCLK.)
simple-audio-card,widgets = // <<-- What should i write here? (I read "simple-card.yaml", but I don't really understand how to write it.)
"Microphone", "Microphone Jack",
"Headphone", "Headphone Jack",
"Speaker", "External Speaker";
simple-audio-card,routing = // <<-- What should i write here? (I read "simple-card.yaml", but I don't really understand how to write it.)
"MIC_IN", "Microphone Jack",
"Headphone Jack", "HP_OUT",
"External Speaker", "LINE_OUT";
simple-audio-card,cpu {
sound-dai = <&sai1>;
dai-tdm-slot-num = <16>;
dai-tdm-slot-width = <32>;
};
dailink0_master: simple-audio-card,codec { // <<-- What should i write here?
sound-dai = <&ak4648>;
};
};
Best Regards,
KASHIWAGI Takashi
Solved! Go to Solution.
Hi @Dhruvit san.
Thank you for reply.
For "simple-audio-card,widgets" property please refer to the Documentation/devicetree/bindings/sound/widgets.txt file from the kernel source code.
simple-audio-card,routing: A list of the connections between audio components. Each entry is a pair of strings, the first being the connection's sink, and the second being the connection's source.
Understood. I will read that document.
Best Regards,
KASHIWAGI Takashi
I hope you are doing well.
Hi Dhruvit-san.
Thank you for reply!
Kindly take a reference of the below documents to describe the channel number and width.Documentation/devicetree/bindings/sound/tdm-slot.txtfrom the Linux source code.
For clock-related configuration, it can be done using the "assigned-clock-rates" property. For more information, kindly refer to the Documentation/devicetree/bindings/clock/clock-bindings.txtfrom the Linux source code.
adda16ch:codec{
compatible = "teac,adda16ch";
#sound-dai-cells = <0>;
status = "okay";
};
sound-adda16ch{
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
compatible = "simple-audio-card";
simple-audio-card,name = "ADDA16InOut";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&testADDA>;
simple-audio-card,frame-master = <&testADDA>;
simple-audio-card,widgets =
"Line", "Line In Jack",
"Line", "Line Out Jack";
simple-audio-card,routing =
"AIN1", "Line In Jack",
"AIN2", "Line In Jack",
"AIN3", "Line In Jack",
"AIN4", "Line In Jack",
"AIN5", "Line In Jack",
"AIN6", "Line In Jack",
"AIN7", "Line In Jack",
"AIN8", "Line In Jack",
"AIN9", "Line In Jack",
"AIN10", "Line In Jack",
"AIN11", "Line In Jack",
"AIN12", "Line In Jack",
"AIN13", "Line In Jack",
"AIN14", "Line In Jack",
"AIN15", "Line In Jack",
"AIN16", "Line In Jack",
"AOUT1", "Line Out Jack",
"AOUT2", "Line Out Jack",
"AOUT3", "Line Out Jack",
"AOUT4", "Line Out Jack",
"AOUT5", "Line Out Jack",
"AOUT6", "Line Out Jack",
"AOUT7", "Line Out Jack",
"AOUT8", "Line Out Jack",
"AOUT9", "Line Out Jack",
"AOUT10", "Line Out Jack",
"AOUT11", "Line Out Jack",
"AOUT12", "Line Out Jack",
"AOUT13", "Line Out Jack",
"AOUT14", "Line Out Jack",
"AOUT15", "Line Out Jack",
"AOUT16", "Line Out Jack";
testADDA:simple-audio-card,cpu {
sound-dai = <&sai1>;
dai-tdm-slot-num = <16>;
dai-tdm-slot-width = <32>;
};
simple-audio-card,codec {
sound-dai = <&adda16ch>;
};
};