This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625SIP: MCASP1_AFSX的时钟始终都是88.2Khz,我们希望输出为48Khz

Part Number: AM625SIP

你好!

我们的计划是am625SIP做为主设备来提供时钟控制TAS5760通过扬声器播放声音。我们现在以在AM625SIP的MCASP0_AFSX(D20)引脚上提供了一个12.288Mhz的时钟源(TAS5760也用此时钟源),但我不知道该如何在设备树中对其配置使其可以正常使用,请帮忙告诉我该如何配置?
附件中是我配置有关MCASP的设备树和电路框图。

/ {
	clk_mcasp1_fixed: clk_mcasp1_fixed {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		//clock-frequency = <24576000>;
		clock-frequency = <12288000>;
	};

	clk_mcasp1: clk_mcasp1 {
		#clock-cells = <0>;
		//compatible = "gpio-gate-clock";
		clocks = <&clk_mcasp1_fixed>;
		//enable-gpios = <&main_gpio1 12 GPIO_ACTIVE_LOW>;; // BeagleBone Black Clk enable on GPIO1_27
	};

	codec_audio: sound {
		status = "okay";
		compatible = "simple-audio-card";
		simple-audio-card,name = "AM62x-SKEVM";

		simple-audio-card,widgets =
			//"Headphone",	"Headphone Jack",
			//"Line",		"Line In",
			//"Microphone",	"Microphone Jack";
			"Speaker", "External Speaker";

		simple-audio-card,routing =
			//"Headphone Jack",	"HPLOUT",
			//"Headphone Jack",	"HPROUT",
			//"LINE1L",		"Line In",
			//"LINE1R",		"Line In",
			//"MIC3R",		"Microphone Jack",
			//"Microphone Jack",	"Mic Bias";
			"External Speaker", "OUT";

		simple-audio-card,format = "i2s";
		//simple-audio-card,format = "dsp_b";

		//simple-audio-card,bitclock-master = <&sound_master>;
		//simple-audio-card,frame-master = <&sound_master>;
		simple-audio-card,bitclock-master = <&sound_master0>;
		simple-audio-card,frame-master = <&sound_master0>;
		//simple-audio-card,bitclock-inversion;
		//simple-audio-card,hp-det-gpio //连接耳机时发出信号的GPIO参考,用来检测耳机插入的GPIO配置。
		//simple-audio-card,mic-det-gpio //连接麦克风时触发的GPIO,用来检测GPIO连接。
		//simple-audio-card,mclk-fs = <62>;
		//simple-audio-card,mclk-fs = <256>;
		//simple-audio-card,mclk-fs = <512>;
		//simple-audio-card,mclk-fs = <2182>;
		//simple-audio-card,bit-clock-freq = <48000000>;
		//simple-audio-card,sampling-rate = <48000>;
		//simple-audio-card,bits-per-sample = <32>;
		//simple-audio-card,channels = <2>;
		//simple-audio-card,bit-clock-freq = <12288000>;
		//simple-audio-card,sampling-rate = <12288>;
		//simple-audio-card,bits-per-sample = <32>;
		//simple-audio-card,channels = <2>;

		sound_master0: simple-audio-card,cpu {
			//#sound-dai-cells = <0>; 
			sound-dai = <&mcasp1>;
			clocks = <&clk_mcasp1>;
			//bitclock-master = <3072000>;
			//frame-master = <48000>;
			//system-clock-frequency = <12288000>;
			//mclk-fs = <256>;
			//system-clock-frequency = <24000000>;
			//system-clock-frequency = <3072000>;
			//system-clock-frequency = <48000>;
			system-clock-direction-out;
		};
		
		sound_master1: simple-audio-card,codec {
			sound-dai = <&tas5720>;
			//clocks = <&tas5760_mclk>;
		};
		
	};

}

&main_pmx0 {
	main_mcasp1_pins_default: main-mcasp1-pins-default {
		pinctrl-single,pins = <
			//音频时钟输入
			//AM62X_IOPAD(0x1A8, PIN_INPUT, 2) /* (D20) MCASP0_AFSX.AUDIO_EXT_REFCLK1 */
			//MCASP发送位时钟
			//AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
			AM62X_IOPAD(0x090, PIN_OUTPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
			//MCASP发送帧同步信号或左右声道时钟
			//AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
			AM62X_IOPAD(0x098, PIN_OUTPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
			//MCASP串行输入输出接口
			//AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
			//AM62X_IOPAD(0x088, PIN_OUTPUT, 2) /* (L24) GPMC0_OEN.MCASP1_AXR1 */
			//AM62X_IOPAD(0x084, PIN_OUTPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
			AM62X_IOPAD(0x07c, PIN_OUTPUT, 2) /* (P25) GPMC0_CKL.MCASP1_AXR3 */
		>;
	};
}

&mcasp1 {
	status = "okay";
	#sound-dai-cells = <0>;

	pinctrl-names = "default";
	pinctrl-0 = <&main_mcasp1_pins_default>;

	op-mode = <0>;          /* MCASP_IIS_MODE */
	//op-mode = <1>;          /* MCASP_DIT_MODE */

	//tdm-slots = <2>;
	tdm-slots = <2>;
	//auxclk-fs-ratio = <2177>;

	/*
	serial-dir = <  // 0: INACTIVE, 1: TX, 2: RX 
	       1 1 1 1
	       0 0 0 0
	       0 0 0 0
	       0 0 0 0
	>;
	*/
	
	serial-dir = <  // 0: INACTIVE, 1: TX, 2: RX 
	       0 0 0 1
	       0 0 0 0
	       0 0 0 0
	       0 0 0 0
	>;
	
	tx-num-evt = <0>;
	rx-num-evt = <0>;
};

&main_i2c1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&main_i2c1_pins_default>;
	clock-frequency = <100000>;

	tas5720:tas5720@6c {
		#sound-dai-cells = <0>; 
		compatible = "ti,tas5720";
		reg = <0x6c>;
		dvdd-supply = <&vcc_3v3_sys>;
		pvdd-supply = <&vcc_3v3_sys>;
		//sleep = <&exp1 15 GPIO_ACTIVE_LOW>;
		//shutdown = <&main_gpio0 41 GPIO_ACTIVE_HIGH>;
		status = "okay";
	};
}