Question
how to connect stm32mp157c-dk2 with WM8960 Audio HAT
Hello everyone, I would like to connect the stm32mp157c-dk2 card with the wm8960 audio codec,here is the device tree configuration I made.
/* sound card*/
snd_i2s2: snd_i2s2 {
compatible = "audio-graph-card";
widgets =
"Microphone", "Mic Jack",
"Line", "Line In",
"Line", "Line Out",
"Speaker", "Speaker",
"Headphone", "Headphone Jack";
routing =
"Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Speaker", "SPK_LP",
"Speaker", "SPK_LN",
"LINPUT1", "Mic Jack",
"LINPUT3", "Mic Jack",
"RINPUT1", "Mic Jack",
"RINPUT2", "Mic Jack";
dais = <&i2s3_port>;
status = "okay";
};
/* i2s3 pin definition */
&pinctrl {
i2s3_pins_a: i2s3-0 {
pins1 {
pinmux = <STM32_PINMUX('E', 12, AF5)>, /* SCK */
<STM32_PINMUX('E', 14, AF5)>; /* SDI */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 13, AF5)>; /* SDO */
bias-disable;
};
};
i2s3_pins_sleep_a:i2s3-1{
pins {
pinmux = <STM32_PINMUX('E', 12, ANALOG)>, /* SCK */
<STM32_PINMUX('E', 13, ANALOG)>, /* SDI */
<STM32_PINMUX('E', 14, ANALOG)>; /* SDO */
};
};
};
/* codec control using i2c5*/
&i2c5 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c5_pins_a>;
pinctrl-1 = <&i2c5_pins_sleep_a>;
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
status = "okay";
/delete-property/dmas;
/delete-property/dma-names;
// Device tree node for Audio Codec
wm8960: wm8960@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
AVDD-supply = <&v3v3>;
clocks = <&rcc SPI3>;
clock-names = "mclk";
wlf,shared-lrclk;
codec_port: port@0 {
codec_endpoint: endpoint {
remote-endpoint = <&i2s3_endpoint>;
};
};
};
};
/* audio dai */
&i2s3 {
clocks = <&rcc SPI3>, <&rcc SPI3_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
clock-names = "pclk", "i2sclk", "x8k", "x11k";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2s3_pins_a>;
pinctrl-1 = <&i2s3_pins_sleep_a>;
status = "okay";
i2s3_port: port {
i2s3_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
format = "i2s";
mclk-fs = <256>;
};
};
};I have the following error showing when I try to record audio.
arecord: pcm_read:2143: read error: input/output error
[ 2.215178] st,stm32-i2s 4000c000.audio-controller: No cache defaults, reading back from HW
thank you in advance
