AnsweredAssumed Answered

Integrating the CS4349 driver to fsl-asoc-card imx6

Question asked by Atilla Mete Turedi on Mar 16, 2017
Latest reply on Mar 17, 2017 by igorpadykov

Hello,

 

We have a custom board with Cirrus CS4349 Codec on it. It is connected via I2C3 and also AUDMUX4 TXD,TXC and TXFS. CS4349 is a codec which does not require an external master clock. We are having problems with the limnux integration and I would be very glad to get some help on this subject. i.MX6 is the master and it is one way data transfer from imx to codec. imx should supply both the data and bclk and frame sync

 

Here is how we set up the device tree;

 

sound {
   compatible = "fsl,imx-audio-cs4349";
   model = "imx-audio-cs4349";
   ssi-controller = <&ssi2>;
   audio-codec = <&codec>;
   audio-routing =
      "Line Out Jack", "AOUT1L",
      "Line Out Jack", "AOUT1R",
      "Line Out Jack", "AOUT2L",
      "Line Out Jack", "AOUT2R",
      "Line Out Jack", "AOUT3L",
      "Line Out Jack", "AOUT3R",
      "Line Out Jack", "AOUT4L",
      "Line Out Jack", "AOUT4R",
      "AIN1L", "Line In Jack",
      "AIN1R", "Line In Jack",
      "AIN2L", "Line In Jack",
      "AIN2R", "Line In Jack";
      mux-int-port = <1>;
      mux-ext-port = <4>;
};

 

&audmux {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_audmux>;
   status = "okay";
};

 

&i2c3 {

   clock-frequency = <50000>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_i2c3>;
   status = "okay";

   codec: cs4349@48 {
      compatible = "cirrus,cs4349";
      reg = <0x48>;
      reset-gpios = <&gpio4 27 0>;

   };
};

 

pinctrl_audmux: audmuxgrp {
   fsl,pins = <
      MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0 /*ARM-I2S-BCLK*/
      MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0 /*ARM-I2S-D0*/
      MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0 /* ARM-I2S-LRCLK */

   >;

};

 

&ssi2 {
   fsl,mode = "i2s-master";
   status = "okay";
};

 

And in fsl-asoc-card.c we added the following;

 

}else if (of_device_is_compatible(np, "fsl,imx-audio-cs4349")) {
   codec_dai_name = "cs4349_hifi";
   priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;

 

We are getting the following;

 

[ 3.113057] fsl-asoc-card sound: ASoC: CPU DAI (null) not registered
[ 3.119475] fsl-asoc-card sound: snd_soc_register_card failed (-517)

 

and also;

 

[ 3.339876] fsl-asoc-card sound: ASoC: no sink widget found for Playback
[ 3.346614] fsl-asoc-card sound: ASoC: Failed to add route CPU-Playback -> di rect -> Playback
[ 3.355167] fsl-asoc-card sound: ASoC: no source widget found for Capture
[ 3.361981] fsl-asoc-card sound: ASoC: Failed to add route Capture -> direct -> CPU-Capture
[ 3.370360] fsl-asoc-card sound: ASoC: no source widget found for AOUT1L
[ 3.377086] fsl-asoc-card sound: ASoC: Failed to add route AOUT1L -> direct - > Line Out Jack
[ 3.385546] fsl-asoc-card sound: ASoC: no source widget found for AOUT1R
[ 3.392271] fsl-asoc-card sound: ASoC: Failed to add route AOUT1R -> direct - > Line Out Jack
[ 3.400732] fsl-asoc-card sound: ASoC: no source widget found for AOUT2L
[ 3.407456] fsl-asoc-card sound: ASoC: Failed to add route AOUT2L -> direct - > Line Out Jack
[ 3.415923] fsl-asoc-card sound: ASoC: no source widget found for AOUT2R
[ 3.422648] fsl-asoc-card sound: ASoC: Failed to add route AOUT2R -> direct - > Line Out Jack
[ 3.431108] fsl-asoc-card sound: ASoC: no source widget found for AOUT3L
[ 3.437843] fsl-asoc-card sound: ASoC: Failed to add route AOUT3L -> direct - > Line Out Jack
[ 3.446302] fsl-asoc-card sound: ASoC: no source widget found for AOUT3R
[ 3.453025] fsl-asoc-card sound: ASoC: Failed to add route AOUT3R -> direct - > Line Out Jack
[ 3.461483] fsl-asoc-card sound: ASoC: no source widget found for AOUT4L
[ 3.468208] fsl-asoc-card sound: ASoC: Failed to add route AOUT4L -> direct - > Line Out Jack
[ 3.476667] fsl-asoc-card sound: ASoC: no source widget found for AOUT4R
[ 3.483391] fsl-asoc-card sound: ASoC: Failed to add route AOUT4R -> direct - > Line Out Jack
[ 3.491853] fsl-asoc-card sound: ASoC: no sink widget found for AIN1L
[ 3.498317] fsl-asoc-card sound: ASoC: Failed to add route Line In Jack -> di rect -> AIN1L
[ 3.506603] fsl-asoc-card sound: ASoC: no sink widget found for AIN1R
[ 3.513067] fsl-asoc-card sound: ASoC: Failed to add route Line In Jack -> di rect -> AIN1R
[ 3.521354] fsl-asoc-card sound: ASoC: no sink widget found for AIN2L
[ 3.527818] fsl-asoc-card sound: ASoC: Failed to add route Line In Jack -> di rect -> AIN2L
[ 3.536105] fsl-asoc-card sound: ASoC: no sink widget found for AIN2R
[ 3.542568] fsl-asoc-card sound: ASoC: Failed to add route Line In Jack -> di rect -> AIN2R

[ 3.553063] fsl-asoc-card sound: failed to set sysclk in fsl_asoc_card_late_p robe
[ 3.560573] fsl-asoc-card sound: ASoC: cs4349-audio late_probe() failed: -524
[ 3.573863] fsl-asoc-card sound: snd_soc_register_card failed (-524)

 

I understand routing errors are normal but what about the ASoC: CPU DAI (null) not registered and failed to set sysclk in fsl_asoc_card_late_p robe errors? How do we fix this? 

 

Here is the link to cs4349 driver;

Linux/sound/soc/codecs/cs4349.c - Linux Cross Reference - Free Electrons 

linux/cs4349.h at master · torvalds/linux · GitHub 

 

Please help us wtih the topic, its getting quite frustrating because we tried to change many things so far with no luck.

 

Regards,

Mete 

Outcomes