WM8904 audio codec dts configuration for imx6ull

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

WM8904 audio codec dts configuration for imx6ull

2,758 Views
francesco_cenci
Contributor I
Hello All,
I'm working with a MYS-6ULX-IOT board from MyirTech. The board is equipped with a i.mx6ull processor.
I'm trying to use the WM8904 audio codec available with the productor expansion board  "MYB-6ULX Expansion Board"
root@hst:/home/hst# aplay -l
aplay: device_list:268: no soundcards found...
I'm using a custom Debian filesystem ( Debian 8) with the official MyirTech's U-Boot and kernel (linux 4.1.15).
I've recompiled kernel with
cd /home/xubuntu/MYS6ULx-devel/kernel-4.1.15
export DEV_ROOT=~/MYS6ULx-devel
export PATH=$DEV_ROOT/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin:$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
make distclean
make mys_imx6_defconfig
make menuconfig
Throug menuconfig, i've loaded the .config file created with "make mys_imx6_defconfig" and theese flags are checked:
          "Device Drivers > Sound card support > Advanced Linux Sound Architecture > ALSA for SoC audio support > SoC Audio for Freescale CPUs > Symbol: SND_SOC_IMX_WM8904 [=y]  "
           Device Drivers > I2C support > I2C device interface     
           Device Drivers > I2C support > I2C bus multiplexing support     
I also edited the file "imx6ull-14x14-evk.dts" by adding the following lines:
&i2c2 {
clock_frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
       codec: wm8904@1a {
       compatible = "wlf,wm8904";
       reg = <0x1a>;
       clocks = <&clks IMX6UL_CLK_SAI2>;
        clock-names = "mclk";
        };
 

};
make zImage dtbs modules
I can use i2sedetect -y 1 to find the audio device at address <0x1a>:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:  -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
 
root@hst:/home/hst# dmesg | grep i2c
[    0.280365] i2c i2c-1: IMX I2C adapter registered
[    0.280406] i2c i2c-1: can't use DMA
[    1.365824] msg ft5x0x_i2c_rxdata i2c read error: -5
[    1.402050] i2c /dev entries driver
 
root@hst:/home/hst# dmesg | grep wm8904
[    1.796089] wm8904 1-001a: revision A
What am I missing?
The complete .dts file and the boot sequence is in the attachment
Thank you very much in advice,
Francesco
0 Kudos
Reply
1 Reply

2,467 Views
igorpadykov
NXP Employee
NXP Employee

Hi Francesco

one can check sect.7.1.4.1 ASoC Driver Source Architecture

attached Linux Manual and try to debug it starting with codec driver described in

Table 7-1. Stereo Codec SoC Driver Files, create something like imx-wm8904.c

driver and debug it starting from probe function. Check i2c communication with oscilloscope.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply