Having trouble debugging wm8962 on i.mx 6ull

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having trouble debugging wm8962 on i.mx 6ull

Jump to solution
266 Views
Yiang
Contributor I

I am debugging the wm8962 audio chip on the i.mx 6ull, and now I don't know why there is no sound from either the headphones or the speaker. By observing the log, it seems that there is a problem with the configuration of sai2. However, I have connected these pins of sai2 to the wm8960 audio chip and confirmed that there is no problem. Now I need to check whether there is a problem with my device tree configuration or the hardware device?

And here is my imx-fire-sound-wm8962-overlay.dts

/*
 * Copyright (C) 2019 - All Rights Reserved by 
 * filename : imx-fire-mpu6050-overlay.dts
 * brief : Device Tree overlay for EBF6ull Pro mpu6050 device
 * author : embedfire
 * date : 2019-11-26
 * version : A001
 */
#include "../imx6ul-pinfunc.h"
#include "../imx6ull-pinfunc.h"
#include "dt-bindings/clock/imx6ul-clock.h"

/dts-v1/;
/plugin/;

/ {
	fragment@1 {
         target = <&i2c1>;
         __overlay__ {
		 			clock_frequency = <100000>;
					pinctrl-names = "default";
					pinctrl-0 = <&pinctrl_i2c1>;
					status = "okay";
					#address-cells = <1>;
	    			#size-cells = <0>; 
 			
					codec: wm8962@1a {
						compatible = "wlf,wm8962";
						reg = <0x1a>;
						clocks = <&clks IMX6UL_CLK_SAI2>;
						clock-names = "mclk";
						wlf,shared-lrclk;
                        // wlf,dc-servo-disable;
                        DCVDD-supply = <&dcvdd_reg>;
                        DBVDD-supply = <&dbvdd_reg>;
                        AVDD-supply = <&avdd_reg>;
                        CPVDD-supply = <&cpvdd_reg>;
                        MICVDD-supply = <&micvdd_reg>;
                        PLLVDD-supply = <&pllvdd_reg>;
                        SPKVDD1-supply = <&spkvdd1_reg>;
                        SPKVDD2-supply = <&spkvdd2_reg>;
                        amic-mono;
					};			      
         };
     };

	fragment@2{
		target-path="/";
		__overlay__{	
		   sound {		
			compatible = "fsl,imx6ul-evk-wm8962",
					 "fsl,imx-audio-wm8962";
			model = "wm8962-audio";
			cpu-dai = <&sai2>;
			audio-codec = <&codec>;
			asrc-controller = <&asrc>;
			gpr = <&gpr 4 0x100000 0x100000>;
			/*
			 * hp-det = <hp-det-pin hp-det-polarity>;
			 * hp-det-pin: JD1 JD2  or JD3
			 * hp-det-polarity = 0: hp detect high for headphone
			 * hp-det-polarity = 1: hp detect high for speaker
			 */
			// hp-det =  1>;
			/*hp-det-gpios = <&gpio5 4 0>;
			mic-det-gpios = <&gpio5 4 0>;*/
			audio-routing =
                "Headphone Jack", "HPOUTL",
                "Headphone Jack", "HPOUTR",
                "Ext Spk", "SPKOUTL",
                "Ext Spk", "SPKOUTR",
                "AMIC", "MICBIAS",
                "DMIC", "MICBIAS",
                "DMICDAT", "DMIC",
                "Playback", "CPU-Playback",
                "CPU-Capture", "Capture";
				status = "okay";
			};		
		};
	};	


	fragment@3{
		target=<&iomuxc>;
		__overlay__ {
			 pinctrl_i2c1: i2c1grp {
				fsl,pins = <
					MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0
					MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x4001b8b0
				>;
			};
			pinctrl_sai2: sai2grp {
				fsl,pins = <
					MX6UL_PAD_JTAG_TDI__SAI2_TX_BCLK	0x17088
					MX6UL_PAD_JTAG_TDO__SAI2_TX_SYNC	0x17088
					MX6UL_PAD_JTAG_TRST_B__SAI2_TX_DATA	0x11088
					MX6UL_PAD_JTAG_TCK__SAI2_RX_DATA	0x11088
					MX6UL_PAD_JTAG_TMS__SAI2_MCLK		0x17088
				>;
			};
		};
	};
	
	fragment@4 {
		target=<&sai2>;
		__overlay__{
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_sai2>;
			/*&pinctrl_sai2_hp_det_b>;*/

			assigned-clocks = <&clks IMX6UL_CLK_SAI2_SEL>,
			<&clks IMX6UL_CLK_SAI2>;
			assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
			assigned-clock-rates = <0>, <12288000>;
			status = "okay";
		};
	};
};

The log:

loglog

The hardware connection:

hardware connectionhardware connection

If you need more details, please tell me that.
Thanks.

Labels (2)
0 Kudos
Reply
1 Solution
233 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

I suggest you use our device tree as reference:

linux-imx/arch/arm/boot/dts/nxp/imx/imx6ull-9x9-evk.dts at 37d02f4dcbbe6677dc9f5fc17f386c05d6a7bd7a ...

I see that you are not using mclk property to use it as output in SAI2 node, please check if this helps with your design.

I do not see issues in hardware connections.

Best regards.

View solution in original post

0 Kudos
Reply
2 Replies
234 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

I suggest you use our device tree as reference:

linux-imx/arch/arm/boot/dts/nxp/imx/imx6ull-9x9-evk.dts at 37d02f4dcbbe6677dc9f5fc17f386c05d6a7bd7a ...

I see that you are not using mclk property to use it as output in SAI2 node, please check if this helps with your design.

I do not see issues in hardware connections.

Best regards.

0 Kudos
Reply
195 Views
Yiang
Contributor I

Your suggestion played a substantial role in my registration failure error, and also reminded me of the alias problem. The above error no longer appears, but now there is a problem with playing music. I think it is probably a problem with my hardware. I will check the WM8962 module problem myself. Thank you for your help.
The following figure shows the changes I made to the main device tree and the device tree overlay. I hope it can be used as a reference when others encounter this problem in the future.main device treemain device tree

 

device tree overlaydevice tree overlay

 

play errorplay error

 

0 Kudos
Reply