This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV320AIC3100: Use case implementation for TLV320AIC3100

Part Number: TLV320AIC3100
Other Parts Discussed in Thread: TLV320AIC3104, , TAS2563

Hi team,

We are integrating two codecs with IMX8MM in android 11 code base.

As per the requirement, We have two audio codec in our design 1)TLV320AIC3104 and 2) TLV320AIC3100 .

Both the codecs are up and running individually. If I integrate wo codecs together, I'm getting output from only one TLV320AIC3104 audio codec.

As per the design, second codec which TLV320AIC3100 > 0.8W codec is going to use for only ALARM and notification.

Need your help implement above feature so that imx8mm can support both the codec at a same time. but second should work for only Alarm.

What are changes need to be done ?

Thanks

Divyesh.

  • Hi Divyesh,

    Can you share a schematic of the system, as well as register dumps for both codecs?

    Thank you,

    Jeff

  • You need to be able to differentiate the 2 codecs as both are of the same slave address 0011000.

  • Yes pdjaundi.

    Both the codecs are connected to different I2C bus

    TLV320AIC3104 - I2C4

    TLVL320AIC3100 - I2C2

    HI JEFF,

    you want dump when audio is playing right? If I do that audio will be played from only Codec spkr, hence only for that specific codec dump will get updated right?

  • Hi jeff,

    We have two codecs connected to IMX8MM with 2 different SAI node. We are giving separate SAI interface to both the codec.

    IMX8MM <<---->>> SAI3 & I2C4 <<---->> TLV320AIC3104

     

    IMX8MM <<---->>> SAI1 & I2C2 <<---->> TLV320AIC3100

    As per the requirement, Both the codec should work at the same time.

    Thanks

    Divyesh.

  • Hi,

    So have you confirmed the WCLK, BCLK etc. of both codecs are correct when playing together? What's not working on the AIC3100?

    You mentioned when it's run separately each codec works correctly, are the 2 codecs driving separate output?  

    Regards.

  • When both the codecs integrated together-

    1. Only 3104 is working. We can see all clocks

    2. No output from speaker. But if I play using tinyplay xyz.wav -D 1 command means specifically telling 3100 coDec to play xyz.wav file to play then 3100 codec ia giving an output. But if i play from vlc player, media sound then 3104 spkr ia only working

    If i keep code for only one codec ,then they arr working fine.

  • This shows that configurations for both devices are correct and since all clocks are present for both devices when integrated together I think this is on the player side, can you confirm when integrated together there's really input (sound) to the AIC3100 input from the player side?

  • Hi @pdjaundi,

    We are not able to probe the i2s line to confirm input (sound) to the AIC3100 input from the player side.

    But I2C dump data is not updating when I try to play something.

    It is updating only for 3104 codec. 

  • It seems like the host can configure both devices but not playing both at the same time.

  • Hi @pjuandi, 

    Could you please review our changes?

           sound-tlv320aic3x {
                    compatible = "simple-audio-card";
                    simple-audio-card,name = "tlv320aic3x-Codec";
                    simple-audio-card,format = "i2s";
                    simple-audio-card,frame-master = <&cpudai1>;
                    simple-audio-card,bitclock-master = <&cpudai1>;
    
                   simple-audio-card,widgets =
                           "Microphone", "Mic Jack",
                           "Line", "Line Out",
                           "Line", "Line In",
                           "Headphone", "Headphone Jack",
                           "Speaker", "speaker";
                   simple-audio-card,routing =
                           "Line Out", "HPLCOM",
                           "Line Out", "HPRCOM",
                           "LINE1L", "Line In",
                           "LINE1R", "Line In",
                           "Headphone Jack", "HPLOUT",
                           "Headphone Jack", "HPROUT",
                           "MIC2L", "Mic Jack",
                           "MIC2R", "Mic Jack",
                           "Mic Jack", "Mic Bias",
                           "speaker", "LLOUT",
                           "speaker", "RLOUT";
    
                    cpudai1: simple-audio-card,cpu {
                            sound-dai = <&sai3>;
                    };
    
                    simple-audio-card,codec {
                            sound-dai = <&tlv320aic3x>;
                            clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
                    };
            };
    
           sound-tlv320aic31xx {
                   compatible = "simple-audio-card";
                   simple-audio-card,name = "tlv320aic31xx-Codec";
                   simple-audio-card,format = "i2s";
                   simple-audio-card,frame-master = <&cpudai2>;
                   simple-audio-card,bitclock-master = <&cpudai2>;
    
                   simple-audio-card,widgets =
                           "Speaker", "Speaker Jack";
                   simple-audio-card,routing =
                           "Speaker Jack", "SPK";
    
                   cpudai2: simple-audio-card,cpu {
                           sound-dai = <&sai1>;
                   };
    
                   simple-audio-card,codec {
                           sound-dai = <&tlv320aic31xx>;
                           system-clock-frequency = <12288000>;
                   };
           };
    	   
    	I2C2 ----   
    	   
            tlv320aic3x: codec@18 {
                    compatible = "ti,tlv320aic3104";
                    reg = <0x18>;
                    pinctrl-0 = <&pinctrl_audio_reset>;
                    reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
                    ai3x-micbias-vg = <3>;
                    #sound-dai-cells = <0>;
                    ai3x-ocmv = <0>;
                    DRVDD-supply = <&reg_3p3v>;
                    AVDD-supply = <&reg_3p3v>;
                    IOVDD-supply = <&reg_3p3v>;
                    DVDD-supply = <&reg_1p8v>;
            };
    		
    	
    	I2C4 ---
    	
            tlv320aic31xx: codec@18 {
                    compatible = "ti,tlv320aic3100";
                    reg = <0x18>;
                    pinctrl-0 = <&pinctrl_audio_reset_31xx>;
                    reset-gpios = <&gpio4 1 GPIO_ACTIVE_LOW>;
                    #sound-dai-cells = <0>;
                    ai31xx-micbias-vg = <MICBIAS_2_0V>;
                    HPVDD-supply = <&reg_3p3v>;
                    SPRVDD-supply = <&reg_3p3v>;
                    SPLVDD-supply = <&reg_3p3v>;
                    AVDD-supply = <&reg_3p3v>;
                    IOVDD-supply = <&reg_3p3v>;
                    DVDD-supply = <&reg_1p8v>;
            };
    		
    		
    	SAI nodes :
    	
    &sai1 {
            pinctrl-names = "default", "dsd";
            pinctrl-0 = <&pinctrl_sai1>;
            pinctrl-1 = <&pinctrl_sai1_dsd>;
            assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
            assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
            assigned-clock-rates = <12288000>;
            status = "okay";
    };
    
    &sai3 {
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_sai3>;
            pinctrl-1 = <&pinctrl_sai3_dsd>;
            assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
            assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
            assigned-clock-rates = <24576000>;
            status = "okay";
    };

    Thanks.

  • I will ask our Linux expert to help crosscheck the dts.

  • Thanks pjuandi,

    If he needs anything else please let me know

  • Hi Divyesh

    In order to meet your requirement, there's two ways

    Way 1:

    Workload is in the driver coding and hardware connection

    1) both codec should be register as one sound card. and both should be connect to the same i2c bus, which make the driver simple.

    2) merge the two codec driver code as one code. reference code is tas256xsw-android/tas2563-android-driver - Software for TAS256x on Android Platforms - TAS2563 Android Driver (ti.com), this code is a stereo application, use two tas2563, and register as one sound card.

    Way 2:

    Workload is in the framework and hal code, you will rewrite the audio handle creation and audio data dispatch. code must open two pcm handles,

    as to pcm_write, in my view, pcm_write to one handle is enough. because both codecs are connect to the same i2s (not i2c)

    .

    BR

    Shenghao Ding

  • Hi Shen,

    HW changes are not possible right now.

    We have designed board already. 

    We have two audio codecs in our design:

    1. TLV320AIC3104 - Audio External Codec for 20W x 2 Speaker - IMX8MM <<---->>> SAI3 & I2C4 <<---->> TLV320AIC3104
    2. TLV320AIC3100 - Audio Internal Codec 0.8W Speaker- IMX8MM <<---->>> SAI1 & I2C2 <<---->> TLV320AIC3100

    Both the codecs up and running individually/Separately i.e if we integrate one codec driver in the code at a time, it works.

    Facing below issue :

    After integrating both the codecs in same code, audio data (system sound, Media sound) is coming out only on the External codec (TLV320AIC3104). We Tested using VLC player.

     

    But if I play any wav file using tinyplay filename.wav -D 1 command, then we can hear audio from Internal codec.

    Where, -D 1 – Specifically telling Device 1 (Which is Internal codec 3100) to play wav file.

     

    As per our requirement, Internal codec should be used for only notification and alarm ringtone and External codec for other media sound.

    Main Node: 
     
           sound-tlv320aic3x {
                    compatible = "simple-audio-card";
                    simple-audio-card,name = "tlv320aic3x-Codec";
                    simple-audio-card,format = "i2s";
                    simple-audio-card,frame-master = <&cpudai1>;
                    simple-audio-card,bitclock-master = <&cpudai1>;
    
                   simple-audio-card,widgets =
                           "Microphone", "Mic Jack",
                           "Line", "Line Out",
                           "Line", "Line In",
                           "Headphone", "Headphone Jack",
                           "Speaker", "speaker";
                   simple-audio-card,routing =
                           "Line Out", "HPLCOM",
                           "Line Out", "HPRCOM",
                           "LINE1L", "Line In",
                           "LINE1R", "Line In",
                           "Headphone Jack", "HPLOUT",
                           "Headphone Jack", "HPROUT",
                           "MIC2L", "Mic Jack",
                           "MIC2R", "Mic Jack",
                           "Mic Jack", "Mic Bias",
                           "speaker", "LLOUT",
                           "speaker", "RLOUT";
    
                    cpudai1: simple-audio-card,cpu {
                            sound-dai = <&sai3>;
                    };
    
                    simple-audio-card,codec {
                            sound-dai = <&tlv320aic3x>;
                            clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
                    };
            };
     
           sound-tlv320aic31xx {
                   compatible = "simple-audio-card";
                   simple-audio-card,name = "tlv320aic31xx-Codec";
                   simple-audio-card,format = "i2s";
                   simple-audio-card,frame-master = <&cpudai2>;
                   simple-audio-card,bitclock-master = <&cpudai2>;
    
                   simple-audio-card,widgets =
                           "Speaker", "Speaker Jack";
                   simple-audio-card,routing =
                           "Speaker Jack", "SPK";
    
                   cpudai2: simple-audio-card,cpu {
                           sound-dai = <&sai1>;
                   };
    
                   simple-audio-card,codec {
                           sound-dai = <&tlv320aic31xx>;
                           system-clock-frequency = <12288000>;
                   };
           };
    
            reg_3p3v: regulator-3p3v {
                    compatible = "regulator-fixed";
                    regulator-name = "3P3V";
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                    startup-delay-us = <300000>;
                    regulator-always-on;
            };
    
            reg_1p8v: regulator-1p8v {
                    compatible = "regulator-fixed";
                    regulator-name = "1P8V";
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-always-on;
            };
    		
    		
    		
    SAI NODE: 
    
    &sai1 {
            pinctrl-names = "default", "dsd";
            pinctrl-0 = <&pinctrl_sai1>;
            pinctrl-1 = <&pinctrl_sai1_dsd>;
            assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
            assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
            assigned-clock-rates = <12288000>;
            status = "okay";
    };
    
            pinctrl_sai1: sai1grp {
                    fsl,pins = <
                           MX8MM_IOMUXC_SAI1_MCLK_SAI1_MCLK        0xd6 /*MCLK*/
                           MX8MM_IOMUXC_SAI1_TXFS_SAI1_TX_SYNC     0xd6 /*WCLK*/
                           MX8MM_IOMUXC_SAI1_TXC_SAI1_TX_BCLK      0xd6 /*BCLK*/
                           MX8MM_IOMUXC_SAI1_TXD0_SAI1_TX_DATA0    0xd6 /*DIN*/
                           MX8MM_IOMUXC_SAI1_RXD0_SAI1_RX_DATA0    0xd6 /*DOUT*/
                    >;
            };
    
            pinctrl_sai1_dsd: sai1grp_dsd {
                    fsl,pins = <
                           MX8MM_IOMUXC_SAI1_MCLK_SAI1_MCLK        0xd6 /*MCLK*/
                           MX8MM_IOMUXC_SAI1_TXFS_SAI1_TX_SYNC     0xd6 /*WCLK*/
                           MX8MM_IOMUXC_SAI1_TXC_SAI1_TX_BCLK      0xd6 /*BCLK*/
                           MX8MM_IOMUXC_SAI1_TXD0_SAI1_TX_DATA0    0xd6 /*DIN*/
                           MX8MM_IOMUXC_SAI1_RXD0_SAI1_RX_DATA0    0xd6 /*DOUT*/
                    >;
            };
    
    &sai3 {
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_sai3>;
            pinctrl-1 = <&pinctrl_sai3_dsd>;
            assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
            assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
            assigned-clock-rates = <24576000>;
            status = "okay";
    };
    
            pinctrl_sai3: sai3grp {
                    fsl,pins = <
                            MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6 /*WCLK*/
                            MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK      0xd6 /*BCLK*/
                            MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK        0xd6 /*MCLK*/
                            MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0     0xd6 /*DIN*/
                            MX8MM_IOMUXC_SAI3_RXD_SAI3_RX_DATA0     0xd6 /*DOUT*/
                    >;
            };
    
           pinctrl_sai3_dsd: sai3grp_dsd {
                    fsl,pins = <
                            MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6 /*WCLK*/
                            MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK      0xd6 /*BCLK*/
                            MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK        0xd6 /*MCLK*/
                            MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0     0xd6 /*DIN*/
                            MX8MM_IOMUXC_SAI3_RXD_SAI3_RX_DATA0     0xd6 /*DOUT*/
                    >;
            };
    		
    
    I2C2 Node:
    
            tlv320aic31xx: codec@18 {
                    compatible = "ti,tlv320aic3100";
                    reg = <0x18>;
                    pinctrl-0 = <&pinctrl_audio_reset_31xx>;
                    reset-gpios = <&gpio4 1 GPIO_ACTIVE_LOW>;
                    #sound-dai-cells = <0>;
                    ai31xx-micbias-vg = <MICBIAS_2_0V>;
                    HPVDD-supply = <&reg_3p3v>;
                    SPRVDD-supply = <&reg_3p3v>;
                    SPLVDD-supply = <&reg_3p3v>;
                    AVDD-supply = <&reg_3p3v>;
                    IOVDD-supply = <&reg_3p3v>;
                    DVDD-supply = <&reg_1p8v>;
            };
    		
    		
           pinctrl_audio_reset_31xx: pinctrl_audio_reset_31xx {
                   fsl,pins = <
                           MX8MM_IOMUXC_SAI1_RXC_GPIO4_IO1         0x16
                   >;
           };
    	   
    I2C4 Node:
    
            tlv320aic3x: codec@18 {
                    compatible = "ti,tlv320aic3104";
                    reg = <0x18>;
                    pinctrl-0 = <&pinctrl_audio_reset>;
                    reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
                    ai3x-micbias-vg = <3>;
                    #sound-dai-cells = <0>;
                    ai3x-ocmv = <0>;
                    DRVDD-supply = <&reg_3p3v>;
                    AVDD-supply = <&reg_3p3v>;
                    IOVDD-supply = <&reg_3p3v>;
                    DVDD-supply = <&reg_1p8v>;
            };
    
    
           pinctrl_audio_reset: pinctrl_audio_reset {
                   fsl,pins = <
                           MX8MM_IOMUXC_SAI3_RXFS_GPIO4_IO28         0x16
                   >;
           };		
    	   
    	   

    Could you please help with some suggestions to implement above use case.

  • Shenghao is in China, maybe take this issue offline.

  • Hi Divyesh

    As I mentioned previously, audio route and policy in the framework/hal need rewriting.

    In default audio framework/hal, VLC playback only select default audio card.

    In audio framework, following audio route should be added to meet your requirement. 

    for exampe:

    #define CODEC3100_CARD (1)

    #define CODEC3104_CARD (0)

    switch (audio_case) {

    case :MUSIC_PLAYBACK:

    out_pcm_handle = pcm_open(CODEC3100_CARD, OUT_DEVICE, PCM_OUT, &ff_config);

    break;

    default:

    out_pcm_handle = pcm_open(CODEC3104_CARD, OUT_DEVICE, PCM_OUT, &ff_config);

    break;

    }

  • Could you please tell file specific change. As we Audio has no end in android code. It is difficult to to find out.

    I coudnt see any out_pcm_handle  sring/API in hal.

    I have to make one change for alarm tone and notification. Help here.

  • Kindly grep the key word pcm_open in framework or audio_hal code. And share the file with me.

  • Ok.

    HAL:

    PATH: /vendor/nxp-opensource/imx/alsa$ grep -rsi pcm_open
    tinyalsa_hal.cpp: ALOGE("%s: pcm_open: card: %d, pcm_device_id: %d, rate: %d, channel: %d, format: %d, period_size: 0x%x, flag: %x",
    tinyalsa_hal.cpp: out->pcm = pcm_open(card, pcm_device_id, flags, config);
    tinyalsa_hal.cpp: ALOGE("%s: pcm_open error: %s", __func__, pcm_get_error(out->pcm));
    tinyalsa_hal.cpp: out->pcm = pcm_open(adev->card_list[out->card_index]->card, 0, pcm_flags, &out->config);
    tinyalsa_hal.cpp: in->pcm = pcm_open(card, port, PCM_IN, &in->config);
    tinyalsa_hal.cpp: adev->pcm_sco_rx = pcm_open(card, port, PCM_IN, &pcm_config_sco_in);
    tinyalsa_hal.cpp: adev->pcm_sco_tx = pcm_open(card, port, PCM_OUT, &pcm_config_sco_out);
    tinyalsa_hal.cpp: adev->pcm_cap = pcm_open(card, port, PCM_IN, &adev->cap_config);

    There is no string pcm_open in fw.

  • you can do this

    switch (audio_case) {

    case :MUSIC_PLAYBACK:

    card = 1;

    break;

    default:

    card = 0;

    break;

    }

    out_pcm_handle = pcm_open(card, port, PCM_OUT, &ff_config);

    Does tinyalsa_hal get the audio_case from framework?

  • No Thats the issue.. Im not getting where fw is sending music playback case to HAL.

    If I get it. then I can add the snippet suggested by you.

  • I think you can rewrite the code from  "tinyalsa_hal.cpp: out->pcm = pcm_open(card, pcm_device_id, flags, config);" .

    Maybe you will add an interface in audip policy, and audio_hal can query what the audio route will be via this interface.

  • I just want to make it for ALARM ringtone and notification.

  • In my view, no matter how simple this requirement is. The newly-added code should have deliberate consideration and  comply with the Android audio system, or it introduced other issues.

  • Hi Team,

    As  you know we have two codecs:

    1. TLV320AIC3104

    2. TLV320AIC3100

    As per requirement, We need to disable one codec for sometimes Means we can see , we need to shutdown one codec .

    What can be done. We need to do it using software chnages. could you please suggest Which pin we can use to achieve above requirment.

    Thanks

    Divyehs

  • Shutdown can mean several things, so I'm not sure your definition of shutting it down.

    You can remove the codec power to shut it down or disable the audio path of interest.

    For audio path, there's a register to power down for example for left DC.

    So go to register settings and find which module you want to shut it down and execute that.

  • As we are using 2 codecs. I need to disable entire audio codec when not is use through GPIO. since we dont have any PDN gpio, can we use reset gpio to shutdown codec? 

  • The reset pin in codec allows you to reset the device configuration to its default which basically disabling all the modules.

    You can set the pin to low to achieve that.

  • Hi pdjaundi,

    Yes , I did set pin to low for 10minuts and Codec stops working as per the requirement .

    But when I make it to high so that audio codec start working again, but it is not working and register write also not working. After rebooting device it start working.

    So to achieve runtime enabling and disabling, what other changes need to be done?

    Thanks

  • Pulling low the reset pin will set every register to default value and when you release it you will need to write all your registers to enable it.

    Maybe your reset signal is also connected somewhere which disable the power thus your I2C transaction is also not working.

    Have you tried by writing 0x01 to register 1 for software reset instead of using the hardware reset pin?

  • Have you tried by writing 0x01 to register 1 for software reset instead of using the hardware reset pin?

    >>>> no I have not tried. The requirement is, Need to disable this codec from application. When we press button DISABLE ... Codec should get disabled until we turn it on again from application. For that we have created sysfs node which is linked with reset GPIO through HAL. So basically we are toggling reset gpio from upper layer. 

    Maybe your reset signal is also connected somewhere which disable the power thus your I2C transaction is also not working.

    >>>>Attaching Schematic for review :

    Need your inputs here.

    Thanks

    Divyesh

  • Adding more inputs to above comment:

    When reset pin is low:

    evk_8mm:/sys/bus/platform/devices/gpio-reset/reset-disable_ext # i2cdetect -y 3
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- UU -- -- -- UU -- -- -- -- -- -- --
    20: UU -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    evk_8mm:/sys/bus/platform/devices/gpio-reset/reset-disable_ext # i2cdump -y -f 3 0x18
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    i2cdump: i2c_read_byte: No such device or address

    OUTPUT : CODEC is disabled. No output from speaker. I2C is not working

    Making reset pin HIGH:

    evk_8mm:/sys/bus/platform/devices/gpio-reset/reset-disable_ext # i2cdetect -y 3
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- UU -- -- -- UU -- -- -- -- -- -- --
    20: UU -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    evk_8mm:/sys/bus/platform/devices/gpio-reset/reset-disable_ext # i2cdump -y -f 3 0x18
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 80 ...??......?...?
    10: 80 ff ff 78 78 78 78 78 78 06 00 fe 00 00 fe 00 ???xxxxxx?.?..?.
    20: 05 a0 00 00 00 00 00 00 00 00 00 80 80 00 00 00 ??.........??...
    30: 00 00 00 04 00 00 00 00 00 00 04 00 00 00 00 00 ...?......?.....
    40: 00 04 00 00 00 00 00 00 04 00 00 00 00 00 00 00 .?......?.......
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 ......?.........
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    80: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 80 ...??......?...?
    90: 80 ff ff 78 78 78 78 78 78 06 00 fe 00 00 fe 00 ???xxxxxx?.?..?.
    a0: 05 a0 00 00 00 00 00 00 00 00 00 80 80 00 00 00 ??.........??...
    b0: 00 00 00 04 00 00 00 00 00 00 04 00 00 00 00 00 ...?......?.....
    c0: 00 04 00 00 00 00 00 00 04 00 00 00 00 00 00 00 .?......?.......
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 ......?.........
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

    OUTPUT : CODEC is disabled. No output from speaker. I2C is working but Codec is still disabled


    LOGS:

    [ 61.027476] tlv320aic3x-codec 3-0018: Unable to sync registers 0x3-0x3. -6
    [ 61.035834] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_write_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 61.048073] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_write_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 61.103090] pn54x_dev_write : i2c_master_send returned -6
    [ 61.113141] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 61.123905] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 61.134785] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 61.145817] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 61.156640] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 61.167709] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 61.178522] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 61.193413] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_write_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 61.204013] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_write_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 72.667422] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_read_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 72.677897] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_read_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 72.688319] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_write_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 72.698811] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_write_no_lock on tlv320aic3x-codec.3-0018: -6
    [ 74.506385] healthd: battery l=85 v=3 t=35.0 h=2 st=2 c=400000 fc=4000000 cc=32 chg=a
    [ 77.866959] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 77.877635] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 77.888306] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 77.898980] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 77.909638] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 77.920310] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 77.930970] tlv320aic3x-codec 3-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic3x-codec.3-0018: -6
    [ 77.941680] tlv320aic3x-codec 3-0018: ASoC: error at soc_component_write_no_lock on tlv320aic3x-codec.3-0018: -6

  • When reset is low, the codec is not ready that's the reason I2C is not working.

    You will release the reset pin (set to high) once all the powers to codec are powered and stable then codec is ready and you can reconfigure the codec.

  • Yes right.

    Once reset high, We need to reconfigure Codec. But how to do that? What changes need to be done? Do we need to make changes in codec driver file?

  • The registers were reset so whatever you do to configure the codec you need to redo that.

    I'm not the driver expert, but I don't think you need to make changes since it was working before.