The ConnectCore 6 Plus SBC assembles one NXP SGTL5000 low-power stereo codec with the following features:

  • Analog inputs: line, microphone

  • Analog outputs: line, headphone

  • Digital I2S input/output

  • Digital processing, bass, tone control, and equalizer control

The codec is a slave chip, which the CPU controls via the I2C3 port of the ConnectCore 6 Plus system-on-chip. The CPU drives audio data through the i.MX6 Synchronous Serial Interface (SSI) port 2 using the inter-IC sound bus standard (I2S).

The Digital Audio Mux (AUDMUX) i.MX6 system-on-chip interface is a subsystem of the CPU that routes audio data from the codec into the different ports of the CPU.

Kernel configuration

You can manage the SGTL5000 audio driver support through the following kernel configuration options:

  • SoC Audio for Freescale i.MX CPUs (CONFIG_SND_IMX_SOC)

  • SoC Audio support for i.MX boards with sgtl5000 (SND_SOC_IMX_SGTL5000)

These options are enabled as built-in on the ConnectCore 6 Plus SBC kernel configuration file.

Kernel driver

The ALSA SoC drivers are located at:

File Description

sound/soc/fsl/imx-sgtl5000.c

Machine layer for the ALSA SoC layer

sound/soc/fsl/imx-pcm-dma.c

Platform layer for the ALSA SoC layer

sound/soc/fsl/fsl_ssi.c

SSI CPU Digital-Analog Interface (DAI) driver for the ALSA SoC layer

sound/soc/codecs/sgtl5000.c

ALSA SoC codec

Device tree bindings and customization

The ALSA SoC system bindings are documented at:

File Description

Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt

Machine layer binding

Documentation/devicetree/bindings/sound/imx-audmux.txt

Digital Audio Mux (AUDMUX) device bindings

Documentation/devicetree/bindings/sound/fsl-sai.txt

Synchronous Audio Interface (SAI) bindings

Documentation/devicetree/bindings/sound/fsl,ssi.txt

Synchronous Serial Interface (SSI) device bindings

Documentation/devicetree/bindings/sound/sgtl5000.txt

SGTL5000 Stereo Codec bindings

The SGTL5000 audio interface is defined in the CPU and SBC device tree files.

Definition of the SGTL5000 interface

i.MX6QP device tree
sound {
        compatible = "fsl,imx-audio-sgtl5000";
        model = "sgtl5000-audio";
        cpu-dai = <&ssi2>;
        audio-codec = <&sgtl5000>;
        audio-routing =
                "MIC_IN", "Mic Jack",
                "Mic Jack", "Mic Bias",
                "Headphone Jack", "HP_OUT";
        mux-int-port = <2>;
        mux-ext-port = <3>;
        hp-det-gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;
        hp-det-debounce = <250>;
};

SGTL5000 codec connected to I2C3 port

i.MX6QP device tree
&i2c3 {
         sgtl5000: codec@0a {
                compatible = "fsl,sgtl5000";
                reg = <0x0a>;
                clock-frequency = <24000000>;
                clocks = <&clks 201>;
                VDDA-supply = <&codec_power>;
                VDDIO-supply = <&codec_power>;
        };
};

Definition of SSI port 2

i.MX6QP device tree
ssi2: ssi@0202c000 {
    #sound-dai-cells = <0>;
    compatible = "fsl,imx6q-ssi",
    "fsl,imx51-ssi";
    reg = <0x0202c000 0x4000>;
    interrupts = <0 47 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clks IMX6QDL_CLK_SSI2_IPG>,
    <&clks IMX6QDL_CLK_SSI2>;
    clock-names = "ipg", "baud";
    dmas = <&sdma 41 22 0>,
    <&sdma 42 22 0>;
    dma-names = "rx", "tx";
    fsl,fifo-depth = <15>;
};

Enabling SSI port 2

i.MX6QP device tree
&ssi2 {
    fsl,mode = "i2s-slave";
};
i.MX6QP variant-specific device tree
&ssi2 {
    status = "okay";
};

IOMUX configuration

Digital Audio Mux (AUDMUX) IOMUX configuration:

i.MX6QP device tree
audmux {
    pinctrl_audmux: audmux {
        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
        >;
    };
};

Power enable GPIO:

aud_pwr_en {
    pinctrl_aud_pwr_en: aud_pwr_en {
        fsl,pins = <
            MX6QDL_PAD_EIM_OE__GPIO2_IO25 0x80000000
        >;
    };
};

Known issues

Headphone jack on SBCv3

On version 3 of the ConnectCore 6 Plus SBC carrier board, headphone detection may not work.