imx6 sabresd board audio problem with wm8960 on kernel 3.14

cancel
Showing results for 
Search instead for 
Did you mean: 

imx6 sabresd board audio problem with wm8960 on kernel 3.14

2,880 Views
Contributor III

We have custom board based on sabresd, with wm8960 chip connected to i2c2 and audmux3, and there is also gpio 5 muxed to be clko (MX6Q_PAD_GPIO_5__CCM_CLKO) and connected to wm8960 MCLK pin.

Audio is working with old kernel, but we can't make it work on new 3.14 with device tree.

Here is relevant code from DT:

sound {

        compatible = "ray,imx6dl-stevie-wm8960",

            "fsl,imx-audio-wm8960";

        model = "wm8960-audio";

        cpu-dai = <&ssi1>;

        audio-codec = <&codec>;

        codec-master;

        mux-int-port = <2>;

        mux-ext-port = <3>;

        // asrc-controller = <&asrc>;

        audio-routing =

            "SPK_RN", "Right Speaker Output",

            "SPK_RP", "Right Speaker Output",

            "LINPUT1", "Main MIC",

            "Main MIC", "MICB";

    };

&audmux {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_audmux>;

    status = "okay";

};

codec: wm8960@1a {

        compatible = "wlf,wm8960";

        reg = <0x1a>;

        clocks = <&clks 201>;

        clock-names = "mclk";

        wlf,shared-lrclk;

    };

pinctrl_audmux: audmuxgrp {

    fsl,pins = <

        MX6QDL_PAD_CSI0_DAT7__AUD3_RXD        0x130b0

        MX6QDL_PAD_CSI0_DAT4__AUD3_TXC        0x130b0

        MX6QDL_PAD_CSI0_DAT5__AUD3_TXD        0x110b0

        MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS        0x130b0

    >;

};

This is current behavior:

It prints the device correctly:

ALSA device list:

  #0: wm8960-audio

Driver probe function is called and it prints:

imx-wm8960 sound.22: wm8960-hifi <-> 2028000.ssi mapping ok

But then when it tries to play audio file, function imx_hifi_startup returns -EBUSY each time.

In old kernel we had this code for clock setup:

clko = clk_get(NULL, "clko_clk");

rate = clk_round_rate(clko, 24000000);

clk_set_rate(clko, rate);

wm8960_pdata.sysclk = rate;

How to define MX6Q_PAD_GPIO_5__CCM_CLKO in Device Tree and how to mux correct clock to this pin for wm8960?

Tags (1)
0 Kudos
10 Replies

145 Views
NXP TechSupport
NXP TechSupport

seems you used  imx7d-sdb board configs, it has wm8960 and sai.

Also sai does not use audmux, audmux is used only with ssi.

0 Kudos

145 Views
Contributor III

I see that WM8960 driver in FSL kernel is depending on SAI, is there any other driver for WM8960 that uses SSI?

0 Kudos

145 Views
Contributor III

No I just checked them out, but couldn't/didn't use sai.

The config in DT is set like at the begining of this thread, ssi and audmux.

0 Kudos

145 Views
NXP TechSupport
NXP TechSupport

Hi Petar

clko clock is configured in clk-imx6q.c

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

regarding dts file, one can check clko settings, like:

&iomuxc {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_hog>;

    imx6qdl-sabresd {

        pinctrl_hog: hoggrp {

            fsl,pins = <

..

                MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x130b0

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

also it may be helpful to check attached Linux Manual Chapter 29

for description of wm8960 driver.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

145 Views
Contributor III

Hi thank you for your reply, I added hog pin control to iomuxc with clko like this:

pinctrl_hog: hoggrp {

            fsl,pins = <

                MX6QDL_PAD_GPIO_5__CCM_CLKO1    0x0001b0b0

            >;

        };

but it didnt help. The error Im getting is related to stream allocation in imx_hifi_startup function. There is comparison of two fields in two structures:

struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev);

struct imx_wm8960_data *data = snd_soc_card_get_drvdata(card);

I noticed that cpu_dai in my DT is defined as <&ssi1>, not sai.

Please note Im using wm8960 not wm8962. I found that imx7d-sdb.dts for example is using wm8960 and there it defines cpu_dai as <&sai1>.

So my question is can I use ssi or sai equally, or it depends on hardware implementation?

Is wm8960 made to work only with SAI, and I have to change the driver to make it work with SSI, or do I just change DT to use sai?

0 Kudos

145 Views
NXP TechSupport
NXP TechSupport

ssi and sai are quite different interfaces and use

different drivers and configurations.

~igor

0 Kudos

145 Views
Contributor III

according to my old kernel config and hardware schematics, it seems like we were using ssi, and that is how DT is configured. so what do you think about this error in wm8960 driver related to sai? how do I go about fixing that?

0 Kudos

145 Views
Contributor I

Hi,Petar

I met the same problem , can you tell me the solution?
thank you

0 Kudos

145 Views
Contributor III

We didnt solved it.

0 Kudos

145 Views
Contributor I

This can work normally to wm8960?

0 Kudos