AnsweredAssumed Answered

I2S on IMX6 through SAI

Question asked by Daniel Perez on Feb 14, 2019
Latest reply on Feb 15, 2019 by igorpadykov

Hi,

I have an imx6ull and I want to connect it to and FPGA. I need 4 audio channels so I'm going to use the 3 SAI ports and the SPDIF.

I have succesfully made the SPDIF conection adding the followings to the device tree: SPDIF - Pastebin.com 

I want to do the same thing for the I2S connection, but im not having any positive results. Here is what I got so far:

 

  1. sai@02028000 {
  2.     compatible = "fsl,imx6ul-sai", "fsl,imx6sx-sai";
  3.     reg = <0x2028000 0x4000>;
  4.     interrupts = <0x0 0x61 0x4>;
  5.     clocks = <0x1 0xb3 0x1 0x0 0x1 0xb2 0x1 0x0 0x1 0x0>;
  6.     clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
  7.     dma-names = "rx", "tx";
  8.     dmas = <0x8 0x23 0x18 0x0 0x8 0x24 0x18 0x0>;
  9.     status = "okay";
  10.     pinctrl-names = "default";
  11.     pinctrl-0 = <0x47>;
  12.     assigned-clocks = <0x1 0x46 0x1 0xb2>;
  13.     assigned-clock-parents = <0x1 0x32>;
  14.     assigned-clock-rates = <0x0 0x1770000>;
  15.     fsl,mode = "i2s-master";
  16.     linux,phandle = <0x44>;
  17.     phandle = <0x44>;
  18. };
  19. sai1grp {
  20.     fsl,pins = <0x120 0x3ac 0x5e8 0x8 0x0 0x17088
  21.         0x11c 0x3a8 0x5ec 0x8 0x0 0x17088
  22.         0x128 0x3b4 0x0 0x8 0x0 0x11088
  23.         0x124 0x3b0 0x5e4 0x8 0x0 0x11088
  24.         0x118 0x3a4 0x5e0 0x8 0x1 0x17088>;
  25.     linux,phandle = <0x47>;
  26.     phandle = <0x47>;
  27. };
  28. codec_test: codec_test {
  29.     compatible = "linux,snd-soc-dummy";
  30.     #sound-dai-cells = <0>;
  31.     status="okay";
  32. };
  33. sound-sai {
  34.     status = "okay";
  35.     compatible = "simple-audio-card";
  36.     simple-audio-card,name = "sound_sai";
  37.     simple-audio-card,format = "i2s";
  38.     simple-audio-card,frame-master = <&sound_sai_cpu>;
  39.     simple-audio-card,bitclock-master = <&sound_sai_cpu>;
  40.  
  41.     ound_sai_cpu: simple-audio-card,cpu {
  42.         sound-dai = <0x44>;
  43.         system-clock-frequency = <1536000>;
  44.         dai-tdm-slot-num = <8>;
  45.         dai-tdm-slot-width = <16>;
  46.     };
  47.                
  48.     sound_sai_codec: simple-audio-card,codec {
  49.         sound-dai = <&codec_test>;
  50.     };
  51. };

 

Using aplay -l only shows the SPDIF:

root@imx6ull:~# aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 []

Subdevices: 1/1

Subdevice #0: subdevice #0

 

In the boot messages there is only information about the SPDIF. No error or anything about SAI. 

[ 2.093160] imx-spdif sound-spdif: snd-soc-dummy-dai <-> 2004000.spdif mapping ok

[ 2.310174] ALSA device list:

[ 2.311849] #0: imx-spdif

 

I have also tried applying this patch (https://patchwork.kernel.org/patch/7679391/) but the results are the same.

Outcomes