AnsweredAssumed Answered

iMX6DL with SGTL5000 codec. ALSA doesn't find soundcard.

Question asked by Yamil Garcia on Nov 12, 2013

Currently 'm working in a custom board using an iMX6DL, the software design is based on sabrelite platform adapted to use an iMX6DL.

Kernel been used is L3.0.35_4.0.0_130424. The issue I have is that ALSA does not list any soundcards.

Everything is working fine (ENET, NAND, GPU, IPU, etc). For example I'm able to play a movie, but of course without audio.

I show my schematic and the changes been done, also I attached the kernel log.

Could someone, please, take a look to my code and hardware to give me a hint on this issue?

 

The codec driver seems to be registered successfully because does not prompt the error to be shown in case of error, as indicated in function shown below from file "sgtl5000.c"

 

static __devinit int sgtl5000_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id))

{

     ...

    dev_err(&client->dev, "Failed to register codec: %d\n", ret);

     ...

}

 

The platform device ssi seems to be added successfully because does not prompt any of the errors to be shown in case of error, as indicated in function shown below from file "imx-ssi.c"

 

static int imx_ssi_probe(struct platform_device *pdev)

{

....

      dev_err(&pdev->dev, "register DAI failed\n");

.....

     dev_err(&pdev->dev, "failed to add platform device\n");

...

}

  

The machine driver seems to be allocated successfully because does not prompt any of the errors to be shown in case of error, as indicated in
function shown below from file "imx-sgtl5000.c"

 

static int __init imx_sgtl5000_init(void)

{

....

printk(KERN_ERR "ASoC: Platform device allocation failed\n");

....

}

 

Schematics is shown below:

 

schematic.png

 

Since I'm using different pads for audio, the pad mux definition is shown below:

 

MX6DL_PAD_KEY_COL0__AUDMUX_AUD5_TXC,                   //ALT2

MX6DL_PAD_KEY_ROW0__AUDMUX_AUD5_TXD,                //ALT2

MX6DL_PAD_KEY_COL1__AUDMUX_AUD5_TXFS,                //ALT2

MX6DL_PAD_KEY_ROW1__AUDMUX_AUD5_RXD,               //ALT2

MX6DL_PAD_GPIO_0__CCM_CLKO,                                       //ALT0

 

Since I'm using I2C3, the pad mux definition is shown below:

 

MX6DL_PAD_GPIO_5__I2C3_SCL,                                         //ALT6

MX6DL_PAD_GPIO_6__I2C3_SDA,                                        //ALT3

 

Kernel config to support sgtl5000:

 

---Device drivers

       --<*> Sound card support --->

                --<*> Advanced Linux Sound Architecture--->

                         --<*>ALSA for SoC audio support--->

                                 --<*>SoC Audio for Freescale i.MX CPUs--->

                                          --<*>SoC audio support for i.mx boards with sgtl5000

 

Sinnce I'm using AUDMUX_AUD5(ext_port = 5), the audio data configuration has been changed to:

 

static struct mxc_audio_platform_data mx6_sabrelite_audio_data = {

            .ssi_num = 1,    

            .src_port = 2,

            .ext_port = 5,

            .init = mx6_sabrelite_sgtl5000_init,

            .hp_gpio = -1, 

};

 

Since sgtl5000 pin CTRL_ADR0_CS is wired to 3.3V, the I2C address for the codec change to 0x2a(0101010) instead of 0x0a.

 

static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {

            {

                         I2C_BOARD_INFO("sgtl5000", 0x2a),   

            },

};

 

Since VDDA is wired to 3.3V, VDDIO is wired to 3.3V and VDDD is wired to 1.35V the registers configuration have changed to:

 

static struct fixed_voltage_config sgtl5000_sabrelite_vdda_reg_config = {

            .supply_name                       = "VDDA",

            .microvolts                 = 3300000, 

            .gpio                           = -1, 

            .init_data                    = &sgtl5000_sabrelite_vdda_reg_initdata,

};

 

static struct fixed_voltage_config sgtl5000_sabrelite_vddio_reg_config = {

            .supply_name                       = "VDDIO",

            .microvolts                 = 3300000,

            .gpio                           = -1,

            .init_data                    = &sgtl5000_sabrelite_vddio_reg_initdata,

};

  

static struct fixed_voltage_config sgtl5000_sabrelite_vddd_reg_config = {

            .supply_name                       = "VDDD",

            .microvolts                 = 1350000,   

            .gpio                           = -1,

            .init_data                    = &sgtl5000_sabrelite_vddd_reg_initdata,

};

 

The clock signal in R44 is ahown below:

 

clock.jpg

 

The codec sgtl5000 is been found in I2C address 0x2a as shown below:

 

i2cdetect.png

Original Attachment has been moved to: kernel_log.txt.zip

Outcomes