2030921_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2030921_en-US

2030921_en-US

i.MX8QM audio mclk not enabled

Hello,

I have a custom board with i.MX8QM and I'm noticing that the mclk0 output is not enabled.  This worked fine on Linux 5.15, but now that I've upgraded to Linux 6.1 the mclk0 is no longer working.  Please see clock summary below... the frequency of the clock is correct, but it is not enabled.  How do I get the mclk to be enabled?



cat /sys/kernel/debug/clk/clk_summary   
                                 enable  prepare  protect                                duty  hardware
   clock                          count    count    count        rate   accuracy phase  cycle    enable
-------------------------------------------------------------------------------------------------------
 audio_rec_clk0_clk                   0        0        0    24576000          0     0  50000         Y
    aud_rec_clk0_lpcg_clk             0        0        0    24576000          0     0  50000         ?
       acm_aud_clk0_sel               0        0        0    24576000          0     0  50000         Y
       acm_aud_clk1_sel               0        0        0    24576000          0     0  50000         Y
       acm_mclkout0_sel               0        0        0    24576000          0     0  50000         Y
          mclkout0_lpcg_clk           0        0        0    24576000          0     0  50000         ?
       acm_mclkout1_sel               0        0        0    24576000          0     0  50000         Y
          mclkout1_lpcg_clk           0        0        0    24576000          0     0  50000         ?



Device tree:



sound_card: sound-card {
	compatible = "simple-audio-card";
	simple-audio-card,name = "PCM3168A";
	simple-audio-card,aux-devs = <&>;
	simple-audio-card,widgets =
			"Speaker", "Channel1out",
			"Speaker", "Channel2out",
			"Speaker", "Channel3out",
			"Speaker", "Channel4out",
			"Speaker", "Channel5out",
			"Speaker", "Channel6out",
			"Speaker", "Channel7out",
			"Speaker", "Channel8out",
			"Microphone", "Channel1in",
			"Microphone", "Channel2in",
			"Line", "Channel3in",
			"Line", "Channel4in",
			"Microphone", "Channel5in",
			"Microphone", "Channel6in";
	simple-audio-card,routing =
			"Channel1out", "AOUT1L",
			"Channel2out", "AOUT1R",
			"Channel3out", "AOUT2L",
			"Channel4out", "AOUT2R",
			"Channel5out", "AOUT3L",
			"Channel6out", "AOUT3R",
			"Channel7out", "AOUT4L",
			"Channel8out", "AOUT4R",
			"Channel1in", "AIN1L",
			"Channel2in", "AIN1R",
			"Channel3in", "AIN2L",
			"Channel4in", "AIN2R",
			"Channel5in", "AIN3L",
			"Channel6in", "AIN3R";

	simple-audio-card,dai-link@0 {
			format = "left_j";
			bitclock-master = <&snd_cpu>;
			frame-master = <&snd_cpu>;
			mclk-fs = <512>;

			snd_cpu: cpu {
					sound-dai = <&sai0>;
					clocks = <&mclkout0_lpcg 0>;
					dai-tdm-slot-num = <8>;
					dai-tdm-slot-width = <32>;
			};

			pcm3168_dac: codec {
					sound-dai = <&pcm3168a 0>;
					dai-tdm-slot-num = <8>;
					dai-tdm-slot-width = <32>;
			};
	};

	simple-audio-card,dai-link@2 {
			format = "left_j";
			bitclock-master = <&mic_cpu>;
			frame-master = <&mic_cpu>;
			mclk-fs = <512>;

			mic_cpu: cpu {
					sound-dai = <&sai0>;
					clocks = <&mclkout0_lpcg 0>;
					dai-tdm-slot-num = <8>;
					dai-tdm-slot-width = <32>;
			};

			pcm3168_adc: codec {
					sound-dai = <&pcm3168a 1>;
					dai-tdm-slot-num = <8>;
					dai-tdm-slot-width = <32>;
			};
	};
};

&sai0 {
	#sound-dai-cells = <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>,
			<&sai0_lpcg 0>;
	assigned-clock-rates = <786432000>, <49152000>, <12288000>, <49152000>;
	clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai0>;
	status = "okay";
};

&i2c0 {
	#address-cells = <1>;
	#size-cells = <0>;
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c0>;
	status = "okay";

	// Audio Codec (8-channel output, 6-channel input)
	pcm3168a: audio-codec@44 {
		compatible = "ti,pcm3168a";
		reg = <0x44>;
		reset-gpios = <&lsio_gpio4 24 GPIO_ACTIVE_LOW>;
		clocks = <&mclkout0_lpcg 0>;
		clock-names = "scki";
		clock-frequency = <24576000>;
		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>, <24576000>, <49152000>;
		#sound-dai-cells = <1>;
		VDD1-supply = <&reg_3v3>;
		VDD2-supply = <&reg_3v3>;
		VCCAD1-supply = <&reg_5v0>;
		VCCAD2-supply = <&reg_5v0>;
		VCCDA1-supply = <&reg_5v0>;
		VCCDA2-supply = <&reg_5v0>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_codec_clk &pinctrl_audio_reset>;
	};
};

pinctrl_codec_clk: codec_clk {
	fsl,pins = <
		IMX8QM_MCLK_OUT0_AUD_ACM_MCLK_OUT0		0xc0000020
	>;
};





Re: i.MX8QM audio mclk not enabled

I figured out the problem.  In the audio amplifier node I had an incorrect setting in the 6.1 kernel which caused this to not work.  Strange that there wasn't an error in the dmesg, but after fixing this incorrect configuration the mclk started working.  Thank you for your help!

Re: i.MX8QM audio mclk not enabled

Hi @joanxie,

Here is the output of the clock and dmesg from 5.15:


root@neuralplex:~# cat /sys/kernel/debug/clk/clk_summary 
                                 enable  prepare  protect                                duty  hardware
   clock                          count    count    count        rate   accuracy phase  cycle    enable
-------------------------------------------------------------------------------------------------------
 audio_rec_clk0_clk                   1        1        0    24576000          0     0  50000         Y
    aud_rec_clk0_lpcg_clk             1        1        0    24576000          0     0  50000         ?
       acm_aud_clk0_sel               0        0        0    24576000          0     0  50000         Y
       acm_aud_clk1_sel               0        0        0    24576000          0     0  50000         Y
       acm_mclkout0_sel               1        1        0    24576000          0     0  50000         Y
          mclkout0_lpcg_clk           1        1        0    24576000          0     0  50000         ?
       acm_mclkout1_sel               0        0        0    24576000          0     0  50000         Y
          mclkout1_lpcg_clk           0        0        0    24576000          0     0  50000         ?


Re: i.MX8QM audio mclk not enabled

thanks for your information, do you mind sharing the dump clock and logfile for 5.15 bsp? let me double check it?

Re: i.MX8QM audio mclk not enabled

Hi @joanxie,

That's correct.  The same device tree that works on 5.15 does not work on 6.1.  There are minor changes in the 6.1 device tree due to compatibility (mainly the pcie), but otherwise largely the same device tree.  I've attached the output from dmesg.



Re: i.MX8QM audio mclk not enabled

the same device tree works on 5.15, but failed on 6.1? do you mind sharing your logfile? 

タグ(1)
評価なし
バージョン履歴
最終更新日:
‎11-21-2025 11:38 AM
更新者: