AnsweredAssumed Answered

Dual Audio Codec configuration in imx6qpsabresd

Question asked by devika R on Nov 4, 2019
Latest reply on Nov 14, 2019 by jimmychan

Hi,


We have setup Yocto project 4.9.11_1.0.0 on a imx6qpsabresd based custom board which has two of wm8962 audio codecs.

We have customized device tree file imx6qdl-sabresd.dtsi for dual audio codec configuration as follows. With this configuration, we are seeing that only of the codec is getting registred as sound card and the other one is coming across the issue of ASRC module.


reg_audio_1: regulator@2 {
compatible = "regulator-fixed";
reg = <2>;
regulator-name = "wm8962-supply";
gpio = <&gpio4 10 0>;
enable-active-high;
};

reg_audio_2: regulator@7 {
compatible = "regulator-fixed";
reg = <7>;
regulator-name = "wm8962-supply";
gpio = <&gpio5 5 0>;
enable-active-high;
};

sound_1 {
compatible = "fsl,imx6q-sabresd-wm8962",
"fsl,imx-audio-wm8962";
model = "wm8962-audio1";
cpu-dai = <&ssi2>;
audio-codec = <&codec_1>;
asrc-controller = <&asrc>;
audio-routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPOUTR",
"Ext Spk", "SPKOUTL",
"Ext Spk", "SPKOUTR",
"AMIC", "MICBIAS",
"IN3R", "AMIC",
"DMIC", "MICBIAS",
"DMICDAT", "DMIC",
"CPU-Playback", "ASRC-Playback",
"Playback", "CPU-Playback",
"ASRC-Capture", "CPU-Capture",
"CPU-Capture", "Capture";
mux-int-port = <2>;
mux-ext-port = <3>;
codec-master;
hp-det-gpios = <&gpio7 8 1>;
mic-det-gpios = <&gpio1 9 1>;
};

sound_2 {
compatible = "fsl,imx6q-sabresd-wm8962",
"fsl,imx-audio-wm8962";
model = "wm8962-audio2";
cpu-dai = <&ssi3>;
audio-codec = <&codec_2>;
asrc-controller = <&asrc>;
audio-routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPOUTR",
"Ext Spk", "SPKOUTL",
"Ext Spk", "SPKOUTR",
"AMIC", "MICBIAS",
"IN3R", "AMIC",
"DMIC", "MICBIAS",
"DMICDAT", "DMIC",
"CPU-Playback", "ASRC-Playback",
"Playback", "CPU-Playback",
"ASRC-Capture", "CPU-Capture",
"CPU-Capture", "Capture";
mux-int-port = <3>;
mux-ext-port = <4>;
codec-master;
hp-det-gpios = <&gpio4 22 1>;
mic-det-gpios = <&gpio5 10 1>;
};

&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux1>,<&pinctrl_audmux2>;
status = "okay";
};


&i2c1 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";

codec_1: wm8962@1a {
compatible = "wlf,wm8962";
reg = <0x1a>;
clocks = <&clks IMX6QDL_CLK_CKO>;
DCVDD-supply = <&reg_audio_1>;
DBVDD-supply = <&reg_audio_1>;
AVDD-supply = <&reg_audio_1>;
CPVDD-supply = <&reg_audio_1>;
MICVDD-supply = <&reg_audio_1>;
PLLVDD-supply = <&reg_audio_1>;
SPKVDD1-supply = <&reg_audio_1>;
SPKVDD2-supply = <&reg_audio_1>;
gpio-cfg = <
0x0000 /* 0:Default */
0x0000 /* 1:Default */
0x0013 /* 2:FN_DMICCLK */
0x0000 /* 3:Default */
0x8014 /* 4:FN_DMICCDAT */
0x0000 /* 5:Default */
>;
amic-mono;
};
};

&i2c3 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";

codec_2: wm8962@1a {
compatible = "wlf,wm8962";
reg = <0x1a>;
clocks = <&clks IMX6QDL_CLK_CKO>;
DCVDD-supply = <&reg_audio_2>;
DBVDD-supply = <&reg_audio_2>;
AVDD-supply = <&reg_audio_2>;
CPVDD-supply = <&reg_audio_2>;
MICVDD-supply = <&reg_audio_2>;
PLLVDD-supply = <&reg_audio_2>;
SPKVDD1-supply = <&reg_audio_2>;
SPKVDD2-supply = <&reg_audio_2>;
gpio-cfg = <
0x0000 /* 0:Default */
0x0000 /* 1:Default */
0x0013 /* 2:FN_DMICCLK */
0x0000 /* 3:Default */
0x8014 /* 4:FN_DMICCDAT */
0x0000 /* 5:Default */
>;
amic-mono;
};
};

&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog>;

imx6qdl-sabresd {
pinctrl_audmux1: audmux1grp {
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
>;
};

pinctrl_audmux2: audmux2grp {
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
>;
};

};

&ssi2 {
assigned-clocks = <&clks IMX6QDL_CLK_PLL4>,
<&clks IMX6QDL_PLL4_BYPASS>,
<&clks IMX6QDL_CLK_SSI2_SEL>;
assigned-clock-parents = <&clks IMX6QDL_CLK_OSC>,
<&clks IMX6QDL_CLK_PLL4>,
<&clks IMX6QDL_CLK_PLL4_AUDIO_DIV>;
assigned-clock-rates = <1179648000>, <0>, <0>;
status = "okay";
};

&ssi3 {
assigned-clocks = <&clks IMX6QDL_CLK_PLL4>,
<&clks IMX6QDL_PLL4_BYPASS>,
<&clks IMX6QDL_CLK_SSI3_SEL>;
assigned-clock-parents = <&clks IMX6QDL_CLK_OSC>,
<&clks IMX6QDL_CLK_PLL4>,
<&clks IMX6QDL_CLK_PLL4_AUDIO_DIV>;
assigned-clock-rates = <1179648000>, <0>, <0>;
status = "okay";
};

Errors we are getting are mentioned in the log file
Can you please let us know about if there is something wrong with this dts?

 

Thanks,

Devika

Attachments

Outcomes