How to add adau7002 as rpmsg-audio - imx8ulp-evk9

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to add adau7002 as rpmsg-audio - imx8ulp-evk9

567 次查看
dhruvinrajpura
Contributor III

I am using imx8ulp-evk9, in M core I flashed sai_low_power_audio image and after booting A core I am getting wm8960 as sound card I can record and play in that,

Now on the same SAI(SAI0), I want to use adau7002 instead of wm8960, currently in A core dts file below is configured,

wm8960: wm8960@1a {
		compatible = "wlf,wm8960,lpa";
		reg = <0x1a>;
		wlf,shared-lrclk;
		clocks = <&wm8960_mclk>;
		clock-names = "mclk";
	};
	
rpmsg_audio: rpmsg-audio {
		compatible = "fsl,imx8ulp-rpmsg-audio";
		model = "wm8960-audio";
		fsl,rpmsg-out;
		fsl,rpmsg-in;
		audio-codec = <&wm8960>;
		memory-region = <&audio_reserved>;
		audio-routing =
			"LINPUT1", "MICB",
			"LINPUT3", "MICB";
		status = "okay";
	};

 

this is under i2c_rpbus_0, because wm8960 has i2c in it, in adau7002 no i2c is there so if I want to replace it with adau7002 what changes I required to do?

标签 (1)
0 项奖励
回复
5 回复数

488 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @dhruvinrajpura 

If you want to change the sound card, the core modification point should be the M33 SDK side, because the M33 SDK drives the sound card wm8960. You should let adau7002 work under M33 firstly, then check the "fsl,imx8ulp-rpmsg-audio" ,make sure the rpmsg is working.

Best Regards,
Zhiming

0 项奖励
回复

471 次查看
dhruvinrajpura
Contributor III

I am using adau7002 instead of wm8960 but for adau7002 is using same I2S0 pins which wm8960 is using than, Do I need to change anything in M core SDK?

0 项奖励
回复

459 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @dhruvinrajpura 

How do you control adau7002? Does it need i2c to write or read registers?

Best Regards,
Zhiming

0 项奖励
回复

445 次查看
dhruvinrajpura
Contributor III

@Zhiming_Liu 

No adau7002 doesn't have i2c to write, we can directly use I2S pins

    IOMUXC_SetPinMux(IOMUXC_PTA0_I2S0_RX_BCLK, 0U);
    IOMUXC_SetPinConfig(IOMUXC_PTA0_I2S0_RX_BCLK,
                        IOMUXC_PCR_DSE_MASK);
    IOMUXC_SetPinMux(IOMUXC_PTA1_I2S0_RX_FS, 0U);
    IOMUXC_SetPinConfig(IOMUXC_PTA1_I2S0_RX_FS,
                        IOMUXC_PCR_DSE_MASK);
    IOMUXC_SetPinMux(IOMUXC_PTA2_I2S0_RXD0, 0U);
    IOMUXC_SetPinMux(IOMUXC_PTA4_I2S0_MCLK, 0U);
    IOMUXC_SetPinConfig(IOMUXC_PTA4_I2S0_MCLK,
                        IOMUXC_PCR_OBE_MASK |
                        IOMUXC_PCR_DSE_MASK);
    IOMUXC_SetPinMux(IOMUXC_PTA7_I2S0_TXD0, 0U);
    IOMUXC_SetPinConfig(IOMUXC_PTA7_I2S0_TXD0,
                        IOMUXC_PCR_DSE_MASK);

 

with this we can record with SAI_ReadData(DEMO_SAI, DEMO_SAI_CHANNEL); function and I confirmed by taking it out and playing on audacity as well,

But this is on M core I want to control adau7002 mic in A core like wm8960 is working so , if I am just replace wm8960 with adau7002 in A core dts will it work and what will be that change?

0 项奖励
回复

432 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @dhruvinrajpura 

The modification should like below:

1. modify dts compatible name

	wm8960: wm8960@1a {
		compatible = "wlf,wm8960,lpa";
		reg = <0x1a>;
		wlf,shared-lrclk;
		clocks = <&wm8960_mclk>;
		clock-names = "mclk";
	};

2. add adau7002 support in sound/soc/fsl/imx-rpmsg.c


Best Regards,
Zhiming

0 项奖励
回复