AnsweredAssumed Answered

Two SGTL5000 codecs on iMX6 DualLite

Question asked by Jos Bijma on Dec 7, 2015
Latest reply on Dec 8, 2015 by Jos Bijma

Hi,

 

For one of our project we need to use two SGTL5000 audio codecs using an iMX6DL module (Toradex Colibri iMX6)

 

The Colibri iMX6 module has an SGTL5000 codec intergrated in ssi slave mode and we use an KITSGTL5000EVBE to connect the 2nd SGTL5000 to the iMX6 module, also in ssi slave mode.

When I use the Colibri iMX6 module + KITSGTL5000EVBE, the kernel could just attach one SGTL5000.

 

When I disable the onboard codec (by removing it from the device tree) there is no problem connecting the KITSGTL5000EVBE SGTL5000 codec. So interfacing with the external codec itself is no problem!

 

 

What could be wrong when we try to configure two SGTL5000 codecs and only one is attached?

 

 

Using 2 SGTL codecs:

dmesg | grep sgtl

[    3.204362] sgtl5000 1-000a: sgtl5000 revision 0x11

[    3.236201] sgtl5000 1-002a: sgtl5000 revision 0x11

[    3.278675] sgtl5000 1-000a: Using internal LDO instead of VDDD

[    3.297823] imx-sgtl5000 sound.20: sgtl5000 <-> 2028000.ssi mapping ok     SGTL5000 on iMX6 Colibri module

[    3.310161] sgtl5000 1-002a: Failed to set supply VDDD_LDO

[    3.315788] sgtl5000 1-002a: failed to register regulator

[    3.321211] sgtl5000 1-002a: Failed to register vddd internal supplies: -16

[    3.328211] sgtl5000 1-002a: ASoC: failed to probe CODEC -16

[    3.333950] imx-sgtl5000 sound_sgtl2nd.21: ASoC: failed to instantiate card -16

[    3.341327] imx-sgtl5000 sound_sgtl2nd.21: snd_soc_register_card failed (-16)

[    3.348546] imx-sgtl5000: probe of sound_sgtl2nd.21 failed with error -16

[    3.541702]   #0: imx6-colibri-sgtl5000

 

 

 

Using external codec (KITSGTL5000EVBE) and disabled colibri-sgtl5000

# dmesg | grep sgtl

[    3.204957] sgtl5000 1-002a: sgtl5000 revision 0x11

[    3.243553] imx-sgtl5000 sound.20: ASoC: CODEC (null) not registered

[    3.250021] imx-sgtl5000 sound.20: snd_soc_register_card failed (-517)

[    3.256622] platform sound.20: Driver imx-sgtl5000 requests probe deferral

[    3.267474] sgtl5000 1-002a: Using internal LDO instead of VDDD

[    3.286128] imx-sgtl5000 sound_sgtl2nd.21: sgtl5000 <-> 202c000.ssi mapping ok SGTL5000 using eval kit

[    3.441692] imx-sgtl5000 sound.20: ASoC: CODEC (null) not registered

[    3.448122] imx-sgtl5000 sound.20: snd_soc_register_card failed (-517)

[    3.454726] platform sound.20: Driver imx-sgtl5000 requests probe deferral

[    3.476591] imx-sgtl5000 sound.20: ASoC: CODEC (null) not registered

[    3.476619] imx-sgtl5000 sound.20: snd_soc_register_card failed (-517)

[    3.476636] platform sound.20: Driver imx-sgtl5000 requests probe deferral

[    3.521513]   #0: imx6-evalkit-sgtl5000

[    3.534153] imx-sgtl5000 sound.20: ASoC: CODEC (null) not registered

[    3.540561] imx-sgtl5000 sound.20: snd_soc_register_card failed (-517)

[    3.547252] platform sound.20: Driver imx-sgtl5000 requests probe deferral

 

 

 

 

Devicetree settings:

onboard sgtl5000:

     sound {

            compatible = "fsl,imx6-colibri-sgtl5000",

                                    "fsl,imx-audio-sgtl5000";

            model = "imx6-colibri-sgtl5000";

            cpu-dai = <&ssi1>;

            audio-codec = <&codec>;

            audio-routing =

                      "LINE_IN", "Line In Jack",

                      "MIC_IN", "Mic Jack",

                      "Mic Jack", "Mic Bias",

                      "Headphone Jack", "HP_OUT";

            mux-int-port = <1>;

            mux-ext-port = <5>;

       };

 

external sgtl dev board:

       sound_sgtl2nd {

            compatible = "fsl,imx6-colibri-sgtl5000",

                                    "fsl,imx-audio-sgtl5000";

            model = "imx6-evalkit-sgtl5000";

            cpu-dai = <&ssi2>;

            audio-codec = <&evalkit_codec>;

            audio-routing =

                     "LINE_IN", "Line In Jack",

                      "MIC_IN", "Mic Jack",

                      "Mic Jack", "Mic Bias",

                      "Headphone Jack", "HP_OUT";

            mux-int-port = <2>;

            mux-ext-port = <6>;

       };

 

 

&i2c2 {

  clock-frequency = <100000>;

  pinctrl-names = "default";

  pinctrl-0 = <&pinctrl_i2c2>;

  status = "okay";

 

  codec: sgtl5000@0a {

            compatible = "fsl,sgtl5000";

            reg = <0x0a>;

            clocks = <&clks 201>;

            VDDA-supply = <&reg_2p5v>;

            VDDIO-supply = <&reg_3p3v>;

  };

  evalkit_codec: sgtl5000@2a {

            compatible = "fsl,sgtl5000";

            reg = <0x2a>;

            clocks = <&clks 201>;

            VDDA-supply = <&reg_2p5v>;

            VDDIO-supply = <&reg_3p3v>;

  };

};

 

&ssi1 {

  fsl,mode = "i2s-slave";

  status = "okay";

};

 

 

&ssi2 {

  fsl,mode = "i2s-slave";

  status = "okay";

};

 

  pinctrl_audmux_1: audmuxgrp1 {

       fsl,pins = <

            MX6QDL_PAD_KEY_COL0__AUD5_TXC  0x130b0

            MX6QDL_PAD_KEY_ROW0__AUD5_TXD  0x130b0

            MX6QDL_PAD_KEY_COL1__AUD5_TXFS 0x130b0

            MX6QDL_PAD_KEY_ROW1__AUD5_RXD  0x130b0

       >;

  };

 

 

  pinctrl_audmux_2: audmuxgrp2 {

       fsl,pins = <

            MX6QDL_PAD_DI0_PIN15__AUD6_TXC  0x130b0

            MX6QDL_PAD_DI0_PIN2__AUD6_TXD  0x130b0

            MX6QDL_PAD_DI0_PIN3__AUD6_TXFS 0x130b0

            MX6QDL_PAD_DI0_PIN4__AUD6_RXD  0x130b0

       >;

  };

 

 

  pinctrl_cam_mclk: camgrp_mclk { /* used as clk for evalkit-sgtl5000 */

       fsl,pins = <

            MX6QDL_PAD_NANDF_CS2__CCM_CLKO2         0x00b0 /* CAM sys_mclk */

  >;

  };

 

 

 

I2C settings:

0x0a = sgtl5000 on module

0x2a = sgtl5000 on external devboard

# i2cdetect 1

WARNING! This program can confuse your I2C bus, cause data loss and worse!

I will probe file /dev/i2c-1.

I will probe address range 0x03-0x77.

Continue? [Y/n] y

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- UU -- UU -- -- -- -- --

10:  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20:  -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

 

Simular question has been asked before, but is not answered:

https://community.freescale.com/thread/377866

Outcomes