AnsweredAssumed Answered

i.MX8QXP: SAI MCLK frequency

Question asked by Jesper Åhman on May 19, 2020
Latest reply on May 27, 2020 by Jesper Åhman

Hi,

I'm working on a custom i.MX8QXP board with TLV320AIC3105 audio codec connected to SAI0.

 

I'm trying to use the codec simple-audio-card but I've run into some issues.

When booting Linux, I get this:

[ 2.678025] tlv320aic31xx-codec 16-0018: aic31xx_set_dai_sysclk: Unsupported frequency 12288000
[ 2.686769] tlv320aic31xx-codec 16-0018: simple-card: set_sysclk error

How can I change the frequency from 12.288MHz to say 19.2 MHz?

 

I have the following setup in my device tree:

sound {
   compatible = "simple-audio-card";
   simple-audio-card,name = "TLV320AIC3105";
   simple-audio-card,format = "i2s";
   simple-audio-card,bitclock-master = <&dailink_master>;
   simple-audio-card,frame-master = <&dailink_master>;
   simple-audio-card,widgets =
      "Line", "Line In",
      "Line", "Line Out";

   simple-audio-card,routing =
      "Line Out", "HPL",
      "Line Out", "HPR",
      "Line In", "MIC1LP",
      "Line In", "MIC1RP";

   simple-audio-card,cpu {
      sound-dai = <&sai0>;
   };

   dailink_master: simple-audio-card,codec {
      sound-dai = <&tlv320aic31xx>;
   };
};



tlv320aic31xx: tlv320aic31xx@18 {
   compatible = "ti,tlv320aic310x";
   reg = <0x18>;
   reset-gpios = <&lsio_gpio1 12 GPIO_ACTIVE_LOW>;

   power-domains = <&pd IMX_SC_R_MCLK_OUT_0>;
   clocks = <&mclkout0_lpcg 0>;
   assigned-clocks = <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_PLL>,
      <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_SLV_BUS>,
      <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_MST_BUS>,
      <&mclkout0_lpcg 0>;
   assigned-clock-rates = <786432000>, <49152000>, <12288000>, <19200000>;   // Last element here was originally 1228800, my change made no difference
   HPVDD-supply = <&reg_audio_3v3>;
   SPRVDD-supply = <&reg_audio_3v3>;
   SPLVDD-supply = <&reg_audio_3v3>;
   AVDD-supply = <&reg_audio_3v3>;
   IOVDD-supply = <&reg_audio_1v8>;
   DVDD-supply = <&reg_audio_1v8>;
};



&sai0 {
   assigned-clocks = <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_PLL>,
   <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_SLV_BUS>,
   <&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_MST_BUS>,
   <&sai0_lpcg 0>;
   assigned-clock-rates = <786432000>, <49152000>, <12288000>, <19200000>; // Last element here was originally 1228800, my change made no difference
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_sai0>;
   #sound-dai-cells = <0>;

   status = "okay";
};

Outcomes