wm8974 audio codec imx machine driver help

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

wm8974 audio codec imx machine driver help

2,620 Views
vikasgahlan
Contributor I

Hi,

I am doing bring-up of imx6qp based custom board. Last part of my bring up is audio codec.We are using wm8974 codec connected as slave device on i2c3 bus. I can see codec address on I2C bus using i2cdetect but i2cdump fails. 

I found wm-8974 codec driver is kernel and written small imx-wm8974 driver after modifying imx-sgtl5000.

# insmod /lib/modules/snd-soc-imx-wm8974.ko
imx-wm8974 sound: ASoC: CODEC DAI wm8974 not registered
imx-wm8974 sound: snd_soc_register_card failed (-517)

codec: wm8974@1a {
compatible = "wlf,wm8974";
reg = <0x1a>;
clocks = <&clks IMX6QDL_CLK_CKO>;
};

sound {
compatible = "fsl,imx6q-sabresd-wm8974",
"fsl,imx-audio-wm8974";
model = "wm8974-audio";
cpu-dai = <&ssi1>;
audio-codec = <&codec>;
audio-routing =
"Ext Spk", "SPKOUTL",
"Ext Spk", "SPKOUTR",
"Mic Jack", "Mic Bias";
mux-int-port = <1>;
mux-ext-port = <4>;
status = "okay";
};

Here is my audmux pin mappings:

MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x130b0 /* Audio MCLK */
>;
};

pinctrl_audmux: audmuxgrp {
fsl,pins = <
MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0
MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x110b0
MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
>;
};

Does external and internal port setting is correct for above pin configuration ? Will appreciate if someone already wm8974 machine driver or some good working reference that I can cross check.

Will appreciate quick help.

Thanks

Vikas

Labels (1)
0 Kudos
3 Replies

1,269 Views
vikasgahlan
Contributor I

Thanks Aravinth. Yes, I am building wm8974 codec driver and imx machine drivers as loadable modules.

root@cs_0024b10000011002:~# lsmod
Module Size Used by
snd_soc_imx_wm8974 3992 0
snd_soc_wm8974 17427 0
ctel 2871 8
root@cs_0024b10000011002:~# cat /sys/kernel/debug/asoc/
codecs dais platforms
root@cs_0024b10000011002:~# cat /sys/kernel/debug/asoc/codecs
wm8974.2-001a
snd-soc-dummy
root@cs_0024b10000011002:~# cat /sys/kernel/debug/asoc/dais
wm8974-hifi
202c000.ssi
2034000.asrc
snd-soc-dummy-dai
root@cs_0024b10000011002:~# cat /sys/kernel/debug/asoc/platforms
202c000.ssi
2034000.asrc
snd-soc-dummy

root@cs_0024b10000011002:~# i2cdetect 2
i2cdetect: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- UU -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@cs_0024b10000011002:~#
root@cs_0024b10000011002:~#
root@cs_0024b10000011002:~#
root@cs_0024b10000011002:~# i2cdump -f -r 0x0-0xff 2 0x1a
i2cdump: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
i2cdump: block read failed
root@cs_0024b10000011002:~#

As wm8974 connected as slave on my board, so I revered ext and internal port in device config and modified wm8974.c as per slave daiformat. but no luck.

0 Kudos

1,269 Views
igorpadykov
NXP Employee
NXP Employee

if it was developed from modifying imx-sgtl5000, seems

one can try to use it as Generic ASoC Sound Card, fsl-asoc-card.txt

linux-2.6-imx.git - Freescale i.MX Linux Tree 

choosing for example compatible "fsl,imx-audio-sgtl5000" 

Best regards
igor

0 Kudos

1,269 Views
aravinthkumarja
Senior Contributor II

Hi Vikas Gahlan,

Are you enabled this SND_SOC_WM8974 this config in kernel.?

Regards,

Aravinth

0 Kudos