i have a custom carrier board with toradex colibri imx6 CoM. i have used the CS42888 audio codec to support multiple audio channels. i had a look at NXP SABRE AI board, according to its schematic, i have designed and connected the CS42888 codec to imx6 ESAI, the Device Tree is modified as below :
sound-cs4288 {
compatible = "fsl,imx6-sabreauto-cs42888",
"fsl,imx-audio-cs42888";
model = "imx-cs42888";
esai-controller = <&esai>;
asrc-controller = <&asrc>;
audio-codec = <&codec_cs42888>;
};
&clks {
assigned-clocks = <&clks IMX6QDL_PLL4_BYPASS_SRC>,
<&clks IMX6QDL_PLL4_BYPASS>,
<&clks IMX6QDL_CLK_PLL4_POST_DIV>;
assigned-clock-parents = <&clks IMX6QDL_CLK_LVDS2_IN>,
<&clks IMX6QDL_PLL4_BYPASS_SRC>;
assigned-clock-rates = <0>, <0>, <24576000>;
fsl,ldb-di0-parent = <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
fsl,ldb-di1-parent = <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
};
&esai {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esai &pinctrl_eim_a21_input>;
assigned-clocks = <&clks IMX6QDL_CLK_ESAI_SEL>,
<&clks IMX6QDL_CLK_ESAI_EXTAL>;
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL4_AUDIO_DIV>;
assigned-clock-rates = <0>, <24576000>;
status = "okay";
};
&i2c1 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";
codec_cs42888: cs42888@48 {
compatible = "cirrus,cs42888";
reg = <0x48>;
clocks = <&codec_osc>;
clock-names = "mclk";
VA-supply = <®_audio>;
VD-supply = <®_audio>;
VLS-supply = <®_audio>;
VLC-supply = <®_audio>;
};
};
&iomuxc {
pinctrl_esai: esaigrp {
fsl,pins = <
MX6QDL_PAD_GPIO_6__ESAI_TX_CLK 0x1b030
MX6QDL_PAD_GPIO_2__ESAI_TX_FS 0x1b030
MX6QDL_PAD_GPIO_5__ESAI_TX2_RX3 0x1b030
MX6QDL_PAD_GPIO_7__ESAI_TX4_RX1 0x1b030
MX6QDL_PAD_GPIO_8__ESAI_TX5_RX0 0x1b030
MX6QDL_PAD_NANDF_CS2__ESAI_TX0 0x1b030
MX6QDL_PAD_NANDF_CS3__ESAI_TX1 0x1b030
MX6QDL_PAD_GPIO_1__ESAI_RX_CLK 0x1b030
MX6QDL_PAD_GPIO_9__ESAI_RX_FS 0x1b030
>;
};
// this pin is multiplexed with MX6QDL_PAD_GPIO_1__ESAI_RX_CLK on colibri module, so we should config it as gpio input
pinctrl_eim_a21_input: eimInput {
fsl,pins = <
MX6QDL_PAD_EIM_A21__GPIO2_IO17 PAD_CTRL_IN
>;
};
};
the codec driver, ESAI platform driver and machine driver are loaded successfully and the codec registered under ALSA, the output of 'aplay -l' and 'arecord -l' shown that the codec registered. but when i play a wav file, the bellow error shown and no signal and clocks appear on ESAI pins :
aplay -D hw:0,0 test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Warning: rate is not accurate (requested = 8000Hz, got = 32000Hz)
please, try the plug plugin
aplay: pcm_write:1947: write error: Input/output error
the kernel version is 3.14.52, has anybody no idea to solve the issue??