wm8962 audio codec bringup on iMX8mm Andoid 11

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

wm8962 audio codec bringup on iMX8mm Andoid 11

1,210件の閲覧回数
ram-nimmala
Contributor II

Hi NXP Team,

 

We are working on a custom build IMX8MM platform, to bring up the wm8962 codec in it.
The kernel changes are made in the dts as follows
    sound {
        compatible = "fsl,imx-audio-wm8962";
        model = "wm8962-audio";
        audio-cpu = <&sai1>;
        audio-codec = <&wm8962>;
        audio-routing =
            "Headphone Jack", "HPOUTL",
            "Headphone Jack", "HPOUTR",
            "Ext Spk", "SPKOUTL",
            "Ext Spk", "SPKOUTR",
            "AMIC", "MICBIAS",
            "IN3R", "AMIC";
    };
   
   
        wm8962: audio-codec@1a {
        compatible = "wlf,wm8962";
        reg = <0x1a>;
        clocks = <&clk IMX8MM_CLK_SAI1_ROOT>;
        clock-names = "xclk";
/*        DCVDD-supply = <&reg_audio>;
        DBVDD-supply = <&reg_audio>;
        AVDD-supply = <&reg_audio>;
        CPVDD-supply = <&reg_audio>;
        MICVDD-supply = <&reg_audio>;
        PLLVDD-supply = <&reg_audio>;
        SPKVDD1-supply = <&reg_audio>;
        SPKVDD2-supply = <&reg_audio>;*/
        gpio-cfg = <
            0x0000 /* 0:Default */
            0x0000 /* 1:Default */
            0x0013 /* 2:FN_DMICCLK */
            0x0000 /* 3:Default */
            0x8014 /* 4:FN_DMICCDAT */
            0x0000 /* 5:Default */
        >;
        status = "okay";
    };
   
   
Also, we have added the initial configurations in a JSON file via the device directory,
{
  "driver_name": "wm8962-audio",
  "bus_name": "bus1_system_sound_out",
  "supported_out_devices": ["speaker"],
  "support_lpa": 1,

  "init_ctl": [
    {"name": "Speaker Boost Volume", "type": "int", "val":7},
    {"name": "Speaker Volume", "type": "int", "val":120},
    {"name": "Speaker Boost Volume", "type": "int", "val":7},
    {"name": "Speaker Volume", "type": "int", "val":120},
    {"name": "SPKOUTL Mixer DACL Volume", "type": "int", "val":1},
    {"name": "SPKOUTL Mixer DACR Volume", "type": "int", "val":1},
    {"name": "SPKOUTR Mixer DACL Volume", "type": "int", "val":1},
    {"name": "SPKOUTR Mixer DACR Volume", "type": "int", "val":1}
  ],

  "out_volume_ctl": [
    "Digital Playback Volume"
  ]
}

We are seeing that the output from the speaker is playing as slow speed audio.

 

Please let us know what changes we need to make otherthan this to overcome this issue

 

0 件の賞賛
3 返答(返信)

1,200件の閲覧回数
jimmychan
NXP TechSupport
NXP TechSupport
0 件の賞賛

1,183件の閲覧回数
ram-nimmala
Contributor II

Hi Jimmychan

 

Thanks for your reply,

 

The same dts clock and other sai settings are working fine for wm8960 controller and the machine driver we are using is imx-wm8960.c

But for wm8962 there is no specific machine driver available so we are using fsl-asoc-card.c as machine driver.

the dts setting for sai1 and machine driver are as follows:

sound {
compatible = "fsl,imx-audio-wm8962";
model = "wm8962-audio";
audio-cpu = <&sai1>;
audio-codec = <&wm8962>;
audio-routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPOUTR",
"Ext Spk", "SPKOUTL",
"Ext Spk", "SPKOUTR",
"AMIC", "MICBIAS",
"IN3R", "AMIC";
};

sai1: sai@30010000 {
#sound-dai-cells = <0>;
compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
reg = <0x30010000 0x10000>;
interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
<&clk IMX8MM_CLK_SAI1_ROOT>,
<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
dma-names = "rx", "tx";
fsl,dataline = <0 0xff 0xff>;
status = "disabled";
};

 

I was wondering if you can let us know where i need to make changes to get proper audio output

 

Please find the attached dtsi files for the same

 

 

 

 

0 件の賞賛

1,173件の閲覧回数
jimmychan
NXP TechSupport
NXP TechSupport

FYI, this is the porting guide. Please read the Chapter 16 for the Audio porting.

https://www.nxp.com/docs/en/user-guide/IMX_PORTING_GUIDE.pdf

 

If there is no machine driver for wm8962, you could take the wm9060 as reference to create the machine driver for wm8962.

0 件の賞賛