AnsweredAssumed Answered

imx6 sabresd board audio problem with wm8960 on kernel 3.14

Question asked by Petar Bajic on May 5, 2016
Latest reply on Jun 20, 2016 by HongBo Liu

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",


        model = "wm8960-audio";

        cpu-dai = <&ssi1>;

        audio-codec = <&codec>;


        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";




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?