iMX6 and CS42888

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6 and CS42888

1,606 Views
leilazolfaghari
Contributor I

i have designed a custom carrier board based on Toradex Colibri iMX6 module.

it has the CS42888 as an audio codec connected to iMX6 ESAI, the schematic is based on NXP Sabre AI board.

the device tree modifications are shown bellow, according to Sabre AI board Device Tree. the kernel version is 3.14.52.

        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 = <&reg_audio>;

                       VD-supply = <&reg_audio>;

                       VLS-supply = <&reg_audio>;

                       VLC-supply = <&reg_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

               >;

        };

};

 

codec driver, ESAI platform driver and machine driver are loaded successfully, but when i play a wav file, no signal and clock appear on iMX6 ESAI pins, and the bellow error shown:

root@colibri-imx6:~# 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

has anybody any idea to solve this problem??

0 Kudos
Reply
1 Reply

962 Views
igorpadykov
NXP Employee
NXP Employee

Hi leila

please check that asrc driver was correctly set and included in image, it is

described in Chapter 29 Asynchronous Sample Rate Converter (ASRC) Driver

attached Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply