How to enable TLV320 on IMX6Q SD

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

How to enable TLV320 on IMX6Q SD

Jump to solution
3,466 Views
何继鑫
Contributor I

Hi everybody,I have a board with audio chip TLV320AIC23BPW.My CPU is IMX6Q. And with the connection like this

connection of the codec:

i.mx6q  <-->  tlv320aic23b(pin)

AUD3_TXFS    LRCIN(5), LRCOUT(7)

AUD3_TXD    DIN(4)

AUD3_RXD    DOUT(6)

AUD3_TXC    BCLK(3)

CCM_CLKO    XTI(25)

I2C2_SDA    SDIN(23)

I2C2_SCL    SCLK(24)

I used ubuntu12.04  ltib  L3.0.35_4.1.0_130816_source.tar.gz for compile

I followed How to enable TLV320 on IMX6Q?,but still not work.

always appera 

ALSA  devices list:

     no sound cards found

in the bootmessage.

What should I do for this?

I have my /arch/arm/mach-mx6/board-mx6q-serbesd.c and /sound/soc/imx/imx-sgtl5000.c below.

Original Attachment has been moved to: board-mx6q_sabresd.c.txt.zip

Original Attachment has been moved to: imx-sgtl5000.c.txt.zip

Labels (3)
Tags (2)
0 Kudos
Reply
1 Solution
2,384 Views
Sasamy
Contributor IV

Hello, I think you need to remove unnecessary code

static int __init imx_sgtl5000_init(void)

{

    int ret;

    ret = platform_driver_register(&imx_sgtl5000_audio_driver);

    if (ret)

        return -ENOMEM;

--    if (cpu_is_mx6q())

--        imx_sgtl5000_dai[0].codec_name = "tlv320aic23-codec.0-001a";

--    else

        imx_sgtl5000_dai[0].codec_name = "tlv320aic23-codec.1-001a";

because in your case, the codec is always on the same i2c bus

static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {

/***************************************************************/

    {

        I2C_BOARD_INFO("tlv320aic23", 0x1a),

    },

/****************************************************************/

Alexander

View solution in original post

0 Kudos
Reply
12 Replies
2,384 Views
jimmychan
NXP TechSupport
NXP TechSupport

Seems you didn't follow the changing mentioned in How to enable TLV320 on IMX6Q?

At least, the IOMUX setting and the I2C2 setting for your TLV320 cannot be found in your code.

0 Kudos
Reply
2,384 Views
何继鑫
Contributor I

Thank you for your reply.

but the IOMUX is in the board-mx6q_sabresd.h,which I have not changed.

it's a little difference between sabresd and sabrelite

0 Kudos
Reply
2,384 Views
jimmychan
NXP TechSupport
NXP TechSupport

can you show me your board-mx6q_sabresd.h?

0 Kudos
Reply
2,384 Views
何继鑫
Contributor I

OK !

0 Kudos
Reply
2,384 Views
jimmychan
NXP TechSupport
NXP TechSupport

so, on your board, is the pins you used like this?

CSI0_DAT4  -> AUD3_TXFS

CSI0_DAT5  -> AUD3_TXD

CSI0_DAT6  -> AUD3_RXD

CSI0_DAT7  -> AUD3_TXC

GPIO_0  -> CCM_CLKO

KEY_COL3  -> I2C2_SDA

KEY_ROW3 -> I2C2_SCL

0 Kudos
Reply
2,384 Views
何继鑫
Contributor I

No,it's like this

CSI0_DAT4  -> AUD3_TXC

CSI0_DAT5  -> AUD3_TXD

CSI0_DAT6  -> AUD3_TXFS

CSI0_DAT7  -> AUD3_RXD

GPIO_0  -> CCM_CLKO

KEY_COL3  -> I2C2_SCL

KEY_ROW3 -> I2C2_SDA

0 Kudos
Reply
2,384 Views
jimmychan
NXP TechSupport
NXP TechSupport

Seems you all settings are correct.

Did you select the SND_SOC_IMX_SGTL5000 in the kernel?

According to Alex's answer from How to enable TLV320 on IMX6Q?

===================================================

To achieve all this, ASoC basically splits an embedded audio system into 3 components:

  • Codec driver: The codec driver is platform independent and contains audio controls, audio interface capabilities, codec dapm definition and codec IO functions.

already in the Linux kernel, selected by "select SND_SOC_TLV320AIC23" in sound/soc/imx/Kconfig

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/sound/soc/codecs/tlv320aic23.c?h=im...

  • Platform driver: The platform driver contains the audio dma engine and audio interface drivers (e.g. I2S, AC97, PCM) for that platform.

already in the Linux kernel, selected by "select SND_MXC_SOC_MX2" in sound/soc/imx/Kconfig

  • Machine driver: The machine driver handles any machine specific controls and audio events. i.e. turing on an amp at start of playback.

finally, we need a small portion of the initialization (arch/arm/mach-mx6/board-mx6q_xxx.c) and the "glue" (sound/soc/imx/imx-xxx.c), I gave an example of how we did it

0 Kudos
Reply
2,384 Views
何继鑫
Contributor I

Of caurse I have selected SND_SOC_IMX_SGTL5000 in the kernel.and I have changed the /sound/soc/imx/Kconfig ,I have select SND_MXC_SOC_MX2 in the Kconfig

0 Kudos
Reply
2,384 Views
jimmychan
NXP TechSupport
NXP TechSupport

have you try to type dmesg to check whether the driver can probe successful or not?

0 Kudos
Reply
2,384 Views
何继鑫
Contributor I

I have insert some printk in the sound/soc/codecs/tlv320aic23.c ,it seems like the tlv320aic23_modinit and tlv320aic23_codec_probe is probe successful ,but the tlv320aic23_probe has not probed.

I have insert these in the tlv320aic23.c

ln 623   printk("tlv320aic23 controls!\n");

ln 719   printk("tlv320aic23 probe!ret=%d\n",ret);

ln 754   printk("tlv320aic23 init!\n");

but in my dmesg  I cannot find the "tlv320aic23 controls!"

is there any where I have not set well?

0 Kudos
Reply
2,385 Views
Sasamy
Contributor IV

Hello, I think you need to remove unnecessary code

static int __init imx_sgtl5000_init(void)

{

    int ret;

    ret = platform_driver_register(&imx_sgtl5000_audio_driver);

    if (ret)

        return -ENOMEM;

--    if (cpu_is_mx6q())

--        imx_sgtl5000_dai[0].codec_name = "tlv320aic23-codec.0-001a";

--    else

        imx_sgtl5000_dai[0].codec_name = "tlv320aic23-codec.1-001a";

because in your case, the codec is always on the same i2c bus

static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {

/***************************************************************/

    {

        I2C_BOARD_INFO("tlv320aic23", 0x1a),

    },

/****************************************************************/

Alexander

0 Kudos
Reply
2,384 Views
何继鑫
Contributor I

Thank you ,Alexander,you are right.

I changed the file as you said,and now I can find the sound card in my dmesg.

0 Kudos
Reply