How to specify the SAI lane in a simple audio card binding?

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

How to specify the SAI lane in a simple audio card binding?

Jump to solution
2,506 Views
moose
Contributor IV

Hello, I am using imx8mn SoC which includes 4 Tx lanes in one of its I2S instances (sai5). I'd like to specify one of these lanes (ex: lane 2) to be the source of my dai link in a simple audio card binding. Do I just add number 2 next to the dai_cpu node (see below)? I am asking this since the dtsi file for the imx8mn soc doesn't define  #sound-dai-cells as <1>. I could just add the definition but all examples I see online don't do that and I am a bit confused. If you can provide some guidance that would be appreciated. Please note this code isn't functional yet but it could be due to this or other issues. Thx!

/ {
model = "NXP i.MX8MNano DDR3L EVK board";

sound-tas5805 {
compatible = "simple-audio-card";
simple-audio-card,name = "tas5805m-amp";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink0_master>;
simple-audio-card,frame-master = <&dailink0_master>;

dailink0_master: simple-audio-card,cpu {
sound-dai = <&sai5 2>;
};
simple-audio-card,codec {
sound-dai = <&tas5805m>;
};
};
};

 

&sai5 {
#sound-dai-cells=<1>
};

};

&i2c3 {
tas5805m: tas5805m@2d {
#sound-dai-cells = <0>;
compatible = "ti,tas5805m";
reg = <0x2D>;
clocks = <&clk IMX8MN_CLK_SAI3_ROOT>;
clock-names = "mclk";
status = "okay";
};

};

 

Tags (1)
0 Kudos
Reply
1 Solution
2,444 Views
moose
Contributor IV

Yes, I did. It turns out you do need to specify the channel in a multilane sai port. In my case I had to do this inside the codec:

dailink0_master: simple-audio-card,cpu {
      sound-dai = <&sai5 0>;
};

I didn't see any documentation about this. The binding documentation and examples I found online were all referencing one lane sai. Hope this help.

 

View solution in original post

0 Kudos
Reply
6 Replies
800 Views
gigli_korg
Contributor II

Hi moose, hi divyeshmarne0,

I ask you a bit deeper detail about to specify the channel in a multilane SAI ports.
I work with iMX8MP, but as far as I see, the driver as the same. I suppose the DT sche scma too.

According the previous posts, the syntax specifing which lane is in the sound card is
sound-dai = <&sai5 0>;

So the question are the following:
1- since the SAI5 on iMX8MN has 4 TX lines + 4 RX lines, have an idea how to specify only one of the 8 line?
2- do you use, in your projects, TX lines combined with RX lines of do you use indipendent TX and RX lines (maybe in sepoarated audio-card)?

thank in advance

Stefano

0 Kudos
Reply
2,446 Views
divyeshmarne0
Contributor III

Hi Moose,

Is this issue fixed? are you able to integrate TAS with IMX8MM?

0 Kudos
Reply
2,445 Views
moose
Contributor IV

Yes, I did. It turns out you do need to specify the channel in a multilane sai port. In my case I had to do this inside the codec:

dailink0_master: simple-audio-card,cpu {
      sound-dai = <&sai5 0>;
};

I didn't see any documentation about this. The binding documentation and examples I found online were all referencing one lane sai. Hope this help.

 

0 Kudos
Reply
2,420 Views
divyeshmarne0
Contributor III

Hi Moose,

We are stuck in between the audio design.

Need your inputs to solve this.. We are first time integrating this type of digital IC with IMX8.

Thanks

Divyesh. 

0 Kudos
Reply
2,429 Views
divyeshmarne0
Contributor III

Great moose.!!

We are using the same IC with im8mm.

Could you please share all the details if possible.

Like which alsa machine driver you have used in dts.

How did you configure DSP at initial level. Please share driver details as well.

It will be helpful for my project!

Thanks

Divyesh

0 Kudos
Reply
2,417 Views
moose
Contributor IV

Hello, we used the alsa simple audio card. Here is the full devicetree node for your reference. Hope this helps.

sound-tas5805 {
compatible = "simple-audio-card";
simple-audio-card,name = "tas5805m-amp";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink0_master>;
simple-audio-card,frame-master = <&dailink0_master>;
status = "okay";

dailink0_master: simple-audio-card,cpu {
sound-dai = <&sai5 0>;
};
simple-audio-card,codec {
sound-dai = <&tas5805m>;
};
};

0 Kudos
Reply