TLV320AIC3262: Porting TLV320AIC3262 driver on TI Linux SDK 9.03

Part Number: TLV320AIC3262
Other Parts Discussed in Thread: AM5728,

Tool/software:

Hi, 

I have a custom board based on am5728 SOC running TI linux SDK 9.03 and I want to port driver for TLV320AIC3262 device.

But I don't see any driver file for this device in sound/soc/codecs/ directory.

Please guide me with the steps needed.

-Vishal 

  • Hello Vishal,

    You  can find  all the available Linux drivers for different devices in this page. 

     https://e2e.ti.com/support/audio-group/audio/f/audio-forum/773056/faq-linux-drivers-device-drivers-for-aic31xx-dac31xx-aic325x-aic320x-aic326x-aic321x 

    Regards,

    Arash

  • Hi  ,

    I downloaded the tlv320aic326x.c and tlv320aic326x.h from the link you mentioned.

    I also downloaded the dependent .c / .h files as below (from the same source tree link). 

    include/linux/mfd/tlv320aic3262-registers.h
    include/linux/mfd/tlv320aic3xxx-core.h
    sound/soc/codecs/aic3xxx/
    


    I am getting so many compilation errors when compiling with 9.03 SDK as shown below.

    make -j4
      CALL    scripts/checksyscalls.sh
      CC [M]  sound/soc/codecs/tlv320aic326x.o
      CC      sound/soc/soc-ops.o
      CC      sound/soc/soc-link.o
      CC      sound/soc/soc-card.o
    sound/soc/codecs/tlv320aic326x.c:212:10: error: 'struct snd_soc_dai_ops' has no member named 'digital_mute'
      212 |         .digital_mute = aic3262_mute,
          |          ^~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:212:25: error: initialization of 'int (*)(struct snd_pcm_substream *, struct snd_soc_dai *)' from incompatible pointer type 'int (*)(struct snd_soc_dai *, int)' [-Werror=incompatible-pointer-types]
      212 |         .digital_mute = aic3262_mute,
          |                         ^~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:212:25: note: (near initialization for 'aic3262_asi1_dai_ops.hw_free')
    sound/soc/codecs/tlv320aic326x.c:219:10: error: 'struct snd_soc_dai_ops' has no member named 'digital_mute'
      219 |         .digital_mute = aic3262_mute,
          |          ^~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:219:25: error: initialization of 'int (*)(struct snd_pcm_substream *, struct snd_soc_dai *)' from incompatible pointer type 'int (*)(struct snd_soc_dai *, int)' [-Werror=incompatible-pointer-types]
      219 |         .digital_mute = aic3262_mute,
          |                         ^~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:219:25: note: (near initialization for 'aic3262_asi2_dai_ops.hw_free')
    sound/soc/codecs/tlv320aic326x.c:226:10: error: 'struct snd_soc_dai_ops' has no member named 'digital_mute'
      226 |         .digital_mute = aic3262_mute,
          |          ^~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:226:25: error: initialization of 'int (*)(struct snd_pcm_substream *, struct snd_soc_dai *)' from incompatible pointer type 'int (*)(struct snd_soc_dai *, int)' [-Werror=incompatible-pointer-types]
      226 |         .digital_mute = aic3262_mute,
          |                         ^~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:226:25: note: (near initialization for 'aic3262_asi3_dai_ops.hw_free')
    sound/soc/codecs/tlv320aic326x.c: In function 'aic326x_hp_event':
    sound/soc/codecs/tlv320aic326x.c:647:39: error: implicit declaration of function 'snd_soc_dapm_to_codec'; did you mean 'snd_soc_dapm_to_component'? [-Werror=implicit-function-declaration]
      647 |         struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
          |                                       ^~~~~~~~~~~~~~~~~~~~~
          |                                       snd_soc_dapm_to_component
    sound/soc/codecs/tlv320aic326x.c:647:39: warning: initialization of 'struct snd_soc_codec *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    sound/soc/codecs/tlv320aic326x.c:663:25: error: implicit declaration of function 'snd_soc_update_bits'; did you mean 'snd_ac97_update_bits'? [-Werror=implicit-function-declaration]
      663 |                         snd_soc_update_bits(codec, AIC3262_CHARGE_PUMP_CNTL,
          |                         ^~~~~~~~~~~~~~~~~~~
          |                         snd_ac97_update_bits
    sound/soc/codecs/tlv320aic326x.c:666:25: error: implicit declaration of function 'snd_soc_write'; did you mean 'snd_ac97_write'? [-Werror=implicit-function-declaration]
      666 |                         snd_soc_write(codec, mute_reg, 0x80);
          |                         ^~~~~~~~~~~~~
          |                         snd_ac97_write
    sound/soc/codecs/tlv320aic326x.c:673:52: error: invalid use of undefined type 'struct snd_soc_codec'
      673 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:678:38: error: invalid use of undefined type 'struct snd_soc_codec'
      678 |                         dev_err(codec->dev, "HP POST_PMU timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:678:25: note: in expansion of macro 'dev_err'
      678 |                         dev_err(codec->dev, "HP POST_PMU timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:690:27: error: implicit declaration of function 'snd_soc_read'; did you mean 'snd_soc_cnew'? [-Werror=implicit-function-declaration]
      690 |                 hpl_hpr = snd_soc_read(codec, AIC3262_HP_AMP_CNTL_R1);
          |                           ^~~~~~~~~~~~
          |                           snd_soc_cnew
    sound/soc/codecs/tlv320aic326x.c:701:52: error: invalid use of undefined type 'struct snd_soc_codec'
      701 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:706:38: error: invalid use of undefined type 'struct snd_soc_codec'
      706 |                         dev_err(codec->dev, "HP POST_PMD timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:706:25: note: in expansion of macro 'dev_err'
      706 |                         dev_err(codec->dev, "HP POST_PMD timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic326x_dac_event':
    sound/soc/codecs/tlv320aic326x.c:732:39: warning: initialization of 'struct snd_soc_codec *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      732 |         struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
          |                                       ^~~~~~~~~~~~~~~~~~~~~
      CC      sound/soc/soc-generic-dmaengine-pcm.o
      CC      sound/soc/soc-ac97.o
    sound/soc/codecs/tlv320aic326x.c:736:40: error: implicit declaration of function 'snd_soc_codec_get_drvdata'; did you mean 'snd_soc_card_get_drvdata'? [-Werror=implicit-function-declaration]
      736 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
          |                                        snd_soc_card_get_drvdata
    sound/soc/codecs/tlv320aic326x.c:736:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    sound/soc/codecs/tlv320aic326x.c:751:52: error: invalid use of undefined type 'struct snd_soc_codec'
      751 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    sound/soc/codecs/tlv320aic326x.c:756:53: error: invalid use of undefined type 'struct snd_soc_codec'
      756 |                 sync_needed = aic3xxx_reg_read(codec->control_data,
          |                                                     ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:770:38: error: invalid use of undefined type 'struct snd_soc_codec'
      770 |                         dev_err(codec->dev, "DAC POST_PMU timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:770:25: note: in expansion of macro 'dev_err'
      770 |                         dev_err(codec->dev, "DAC POST_PMU timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:776:52: error: invalid use of undefined type 'struct snd_soc_codec'
      776 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:784:38: error: invalid use of undefined type 'struct snd_soc_codec'
      784 |                         dev_err(codec->dev, "DAC POST_PMD timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:784:25: note: in expansion of macro 'dev_err'
      784 |                         dev_err(codec->dev, "DAC POST_PMD timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_set_mode_get':
    sound/soc/codecs/tlv320aic326x.c:854:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      854 |         struct aic3262_priv *priv_ds = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_set_mode_put':
    sound/soc/codecs/tlv320aic326x.c:873:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      873 |         struct aic3262_priv *priv_ds = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:881:30: error: invalid use of undefined type 'struct snd_soc_codec'
      881 |                 dev_err(codec->dev, "failed to load firmware\n");
          |                              ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:881:17: note: in expansion of macro 'dev_err'
      881 |                 dev_err(codec->dev, "failed to load firmware\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic326x_adc_dsp_event':
    sound/soc/codecs/tlv320aic326x.c:899:39: warning: initialization of 'struct snd_soc_codec *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      899 |         struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
          |                                       ^~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:904:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      904 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:918:52: error: invalid use of undefined type 'struct snd_soc_codec'
      918 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    sound/soc/codecs/tlv320aic326x.c:922:54: error: invalid use of undefined type 'struct snd_soc_codec'
      922 |                 sync_needed =  aic3xxx_reg_read(codec->control_data,
          |                                                      ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:934:38: error: invalid use of undefined type 'struct snd_soc_codec'
      934 |                         dev_err(codec->dev, "ADC POST_PMU timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:934:25: note: in expansion of macro 'dev_err'
      934 |                         dev_err(codec->dev, "ADC POST_PMU timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:939:52: error: invalid use of undefined type 'struct snd_soc_codec'
      939 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:946:38: error: invalid use of undefined type 'struct snd_soc_codec'
      946 |                         dev_err(codec->dev, "ADC POST_PMD timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:946:25: note: in expansion of macro 'dev_err'
      946 |                         dev_err(codec->dev, "ADC POST_PMD timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_firmware_load':
    sound/soc/codecs/tlv320aic326x.c:1495:43: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     1495 |         struct aic3262_priv *private_ds = snd_soc_codec_get_drvdata(codec);
          |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:1504:30: error: invalid use of undefined type 'struct snd_soc_codec'
     1504 |                 dev_dbg(codec->dev, "Firmware binary load\n");
          |                              ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:1504:17: note: in expansion of macro 'dev_dbg'
     1504 |                 dev_dbg(codec->dev, "Firmware binary load\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:1509:38: error: invalid use of undefined type 'struct snd_soc_codec'
     1509 |                         dev_err(codec->dev, "Firmware binary load failed\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:1509:25: note: in expansion of macro 'dev_err'
     1509 |                         dev_err(codec->dev, "Firmware binary load failed\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:1519:30: error: invalid use of undefined type 'struct snd_soc_codec'
     1519 |                 dev_err(codec->dev, "request_firmware failed\n");
          |                              ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:1519:17: note: in expansion of macro 'dev_err'
     1519 |                 dev_err(codec->dev, "request_firmware failed\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_hs_jack_report':
    sound/soc/codecs/tlv320aic326x.c:1560:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     1560 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_hs_jack_detect':
    sound/soc/codecs/tlv320aic326x.c:1598:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     1598 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_audio_handler':
    sound/soc/codecs/tlv320aic326x.c:1633:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     1633 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_reg_read':
    sound/soc/codecs/tlv320aic326x.c:1660:38: error: invalid use of undefined type 'struct snd_soc_codec'
     1660 |         return aic3xxx_reg_read(codec->control_data, aic3262_ops_cfw2reg(reg));
          |                                      ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_reg_write':
    sound/soc/codecs/tlv320aic326x.c:1666:39: error: invalid use of undefined type 'struct snd_soc_codec'
     1666 |         return aic3xxx_reg_write(codec->control_data,
          |                                       ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_set_bits':
    sound/soc/codecs/tlv320aic326x.c:1673:38: error: invalid use of undefined type 'struct snd_soc_codec'
     1673 |         return aic3xxx_set_bits(codec->control_data,
          |                                      ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_bulk_read':
    sound/soc/codecs/tlv320aic326x.c:1681:39: error: invalid use of undefined type 'struct snd_soc_codec'
     1681 |         return aic3xxx_bulk_read(codec->control_data,
          |                                       ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_bulk_write':
    sound/soc/codecs/tlv320aic326x.c:1688:40: error: invalid use of undefined type 'struct snd_soc_codec'
     1688 |         return aic3xxx_bulk_write(codec->control_data,
          |                                        ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_lock':
    sound/soc/codecs/tlv320aic326x.c:1712:26: error: invalid use of undefined type 'struct snd_soc_codec'
     1712 |         mutex_lock(&codec->component.io_mutex);
          |                          ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_unlock':
    sound/soc/codecs/tlv320aic326x.c:1728:28: error: invalid use of undefined type 'struct snd_soc_codec'
     1728 |         mutex_unlock(&codec->component.io_mutex);
          |                            ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_stop':
    sound/soc/codecs/tlv320aic326x.c:1755:39: error: invalid use of undefined type 'struct snd_soc_codec'
     1755 |                 aic3xxx_set_bits(codec->control_data,
          |                                       ^~
    sound/soc/codecs/tlv320aic326x.c:1759:39: error: invalid use of undefined type 'struct snd_soc_codec'
     1759 |                 aic3xxx_set_bits(codec->control_data,
          |                                       ^~
    sound/soc/codecs/tlv320aic326x.c:1763:41: error: invalid use of undefined type 'struct snd_soc_codec'
     1763 |                 !aic3xxx_wait_bits(codec->control_data,
          |                                         ^~
    sound/soc/codecs/tlv320aic326x.c:1770:41: error: invalid use of undefined type 'struct snd_soc_codec'
     1770 |                 !aic3xxx_wait_bits(codec->control_data,
          |                                         ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:1778:22: error: invalid use of undefined type 'struct snd_soc_codec'
     1778 |         dev_err(codec->dev, "Unable to turn off ADCs or DACs at [%s:%d]",
          |                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:1778:9: note: in expansion of macro 'dev_err'
     1778 |         dev_err(codec->dev, "Unable to turn off ADCs or DACs at [%s:%d]",
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_restore':
    sound/soc/codecs/tlv320aic326x.c:1796:44: error: invalid use of undefined type 'struct snd_soc_codec'
     1796 |         sync_state = aic3xxx_reg_read(codec->control_data, AIC3262_DAC_PRB);
          |                                            ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_ops_adaptivebuffer_swap':
    sound/soc/codecs/tlv320aic326x.c:1827:47: error: invalid use of undefined type 'struct snd_soc_codec'
     1827 |                         aic3xxx_set_bits(codec->control_data, sbuf[i][1],
          |                                               ^~
    sound/soc/codecs/tlv320aic326x.c:1829:53: error: invalid use of undefined type 'struct snd_soc_codec'
     1829 |                         if (!aic3xxx_wait_bits(codec->control_data,
          |                                                     ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:1831:38: error: invalid use of undefined type 'struct snd_soc_codec'
     1831 |                         dev_err(codec->dev, "miniDSP buffer swap failure");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:1831:25: note: in expansion of macro 'dev_err'
     1831 |                         dev_err(codec->dev, "miniDSP buffer swap failure");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_get_runstate':
    sound/soc/codecs/tlv320aic326x.c:1849:37: error: invalid use of undefined type 'struct snd_soc_codec'
     1849 |         dac = aic3xxx_reg_read(codec->control_data, AIC3262_DAC_FLAG);
          |                                     ^~
    sound/soc/codecs/tlv320aic326x.c:1850:37: error: invalid use of undefined type 'struct snd_soc_codec'
     1850 |         adc = aic3xxx_reg_read(codec->control_data, AIC3262_ADC_FLAG);
          |                                     ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_dsp_pwrdwn_status':
    sound/soc/codecs/tlv320aic326x.c:1867:31: error: invalid use of undefined type 'struct snd_soc_codec'
     1867 |         aic3xxx_set_bits(codec->control_data,
          |                               ^~
    sound/soc/codecs/tlv320aic326x.c:1869:31: error: invalid use of undefined type 'struct snd_soc_codec'
     1869 |         aic3xxx_set_bits(codec->control_data,
          |                               ^~
    sound/soc/codecs/tlv320aic326x.c:1872:37: error: invalid use of undefined type 'struct snd_soc_codec'
     1872 |         if (!aic3xxx_wait_bits(codec->control_data, AIC3262_ADC_FLAG,
          |                                     ^~
    sound/soc/codecs/tlv320aic326x.c:1876:37: error: invalid use of undefined type 'struct snd_soc_codec'
     1876 |         if (!aic3xxx_wait_bits(codec->control_data, AIC3262_DAC_FLAG,
          |                                     ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:1883:22: error: invalid use of undefined type 'struct snd_soc_codec'
     1883 |         dev_err(codec->dev, "DAC/ADC Power down timedout at [%s:%d]",
          |                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:1883:9: note: in expansion of macro 'dev_err'
     1883 |         dev_err(codec->dev, "DAC/ADC Power down timedout at [%s:%d]",
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_dsp_pwrup':
    sound/soc/codecs/tlv320aic326x.c:1905:39: error: invalid use of undefined type 'struct snd_soc_codec'
     1905 |                 aic3xxx_set_bits(codec->control_data,
          |                                       ^~
    sound/soc/codecs/tlv320aic326x.c:1919:39: error: invalid use of undefined type 'struct snd_soc_codec'
     1919 |                 aic3xxx_set_bits(codec->control_data,
          |                                       ^~
    sound/soc/codecs/tlv320aic326x.c:1924:52: error: invalid use of undefined type 'struct snd_soc_codec'
     1924 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:1929:38: error: invalid use of undefined type 'struct snd_soc_codec'
     1929 |                         dev_err(codec->dev, "ADC Power down timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:1929:25: note: in expansion of macro 'dev_err'
     1929 |                         dev_err(codec->dev, "ADC Power down timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:1933:52: error: invalid use of undefined type 'struct snd_soc_codec'
     1933 |                 ret_wbits = aic3xxx_wait_bits(codec->control_data,
          |                                                    ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:1938:38: error: invalid use of undefined type 'struct snd_soc_codec'
     1938 |                         dev_err(codec->dev, "ADC Power down timedout\n");
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:1938:25: note: in expansion of macro 'dev_err'
     1938 |                         dev_err(codec->dev, "ADC Power down timedout\n");
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_codec_read':
    sound/soc/codecs/tlv320aic326x.c:1980:39: error: invalid use of undefined type 'struct snd_soc_codec'
     1980 |         value = aic3xxx_reg_read(codec->control_data, reg);
          |                                       ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:1981:22: error: invalid use of undefined type 'struct snd_soc_codec'
     1981 |         dev_dbg(codec->dev, "p %d , r 30 %x %x\n",
          |                      ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:1981:9: note: in expansion of macro 'dev_dbg'
     1981 |         dev_dbg(codec->dev, "p %d , r 30 %x %x\n",
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_codec_write':
    sound/soc/codecs/tlv320aic326x.c:1999:22: error: invalid use of undefined type 'struct snd_soc_codec'
     1999 |         dev_dbg(codec->dev, "p %d, w 30 %x %x\n",
          |                      ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:1999:9: note: in expansion of macro 'dev_dbg'
     1999 |         dev_dbg(codec->dev, "p %d, w 30 %x %x\n",
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2002:39: error: invalid use of undefined type 'struct snd_soc_codec'
     2002 |         return aic3xxx_reg_write(codec->control_data, reg, value);
          |                                       ^~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_set_interface_fmt':
    sound/soc/codecs/tlv320aic326x.c:2018:42: error: 'struct snd_soc_dai' has no member named 'codec'
     2018 |         struct snd_soc_codec *codec = dai->codec;
          |                                          ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2061:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2061 |                 dev_err(codec->dev, "Invalid DAI interface format\n");
          |                              ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:2061:17: note: in expansion of macro 'dev_err'
     2061 |                 dev_err(codec->dev, "Invalid DAI interface format\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_hw_params':
    sound/soc/codecs/tlv320aic326x.c:2088:42: error: 'struct snd_soc_pcm_runtime' has no member named 'codec'
     2088 |         struct snd_soc_codec *codec = rtd->codec;
          |                                          ^~
    sound/soc/codecs/tlv320aic326x.c:2089:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     2089 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2169:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2169 |                 dev_err(codec->dev, "failed to set hardware params for AIC3262\n");
          |                              ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:2169:17: note: in expansion of macro 'dev_err'
     2169 |                 dev_err(codec->dev, "failed to set hardware params for AIC3262\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_mute':
    sound/soc/codecs/tlv320aic326x.c:2185:42: error: 'struct snd_soc_dai' has no member named 'codec'
     2185 |         struct snd_soc_codec *codec = dai->codec;
          |                                          ^~
    sound/soc/codecs/tlv320aic326x.c:2186:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     2186 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2188:22: error: invalid use of undefined type 'struct snd_soc_codec'
     2188 |         dev_dbg(codec->dev, "codec : %s : started\n", __func__);
          |                      ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2188:9: note: in expansion of macro 'dev_dbg'
     2188 |         dev_dbg(codec->dev, "codec : %s : started\n", __func__);
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2210:22: error: invalid use of undefined type 'struct snd_soc_codec'
     2210 |         dev_dbg(codec->dev, "codec : %s : ended\n", __func__);
          |                      ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2210:9: note: in expansion of macro 'dev_dbg'
     2210 |         dev_dbg(codec->dev, "codec : %s : ended\n", __func__);
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_set_dai_fmt':
    sound/soc/codecs/tlv320aic326x.c:2228:26: error: 'struct snd_soc_dai' has no member named 'codec'
     2228 |         codec = codec_dai->codec;
          |                          ^~
    sound/soc/codecs/tlv320aic326x.c:2229:17: warning: assignment to 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     2229 |         aic3262 = snd_soc_codec_get_drvdata(codec);
          |                 ^
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2267:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2267 |                 dev_err(codec->dev, "Invalid DAI master/slave" " interface\n");
          |                              ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:2267:17: note: in expansion of macro 'dev_err'
     2267 |                 dev_err(codec->dev, "Invalid DAI master/slave" " interface\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_dai_set_pll':
    sound/soc/codecs/tlv320aic326x.c:2318:42: error: 'struct snd_soc_dai' has no member named 'codec'
     2318 |         struct snd_soc_codec *codec = dai->codec;
          |                                          ^~
    sound/soc/codecs/tlv320aic326x.c:2319:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     2319 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2321:22: error: invalid use of undefined type 'struct snd_soc_codec'
     2321 |         dev_dbg(codec->dev, "In aic3262: dai_set_pll\n");
          |                      ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2321:9: note: in expansion of macro 'dev_dbg'
     2321 |         dev_dbg(codec->dev, "In aic3262: dai_set_pll\n");
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2322:22: error: invalid use of undefined type 'struct snd_soc_codec'
     2322 |         dev_dbg(codec->dev, "%d, %s, dai->id = %d\n", __LINE__,
          |                      ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2322:9: note: in expansion of macro 'dev_dbg'
     2322 |         dev_dbg(codec->dev, "%d, %s, dai->id = %d\n", __LINE__,
          |         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_set_bias_level':
    sound/soc/codecs/tlv320aic326x.c:2352:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2352 |                 dev_dbg(codec->dev, "set_bias_on\n");
          |                              ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2352:17: note: in expansion of macro 'dev_dbg'
     2352 |                 dev_dbg(codec->dev, "set_bias_on\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2357:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2357 |                 dev_dbg(codec->dev, "set_bias_prepare\n");
          |                              ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2357:17: note: in expansion of macro 'dev_dbg'
     2357 |                 dev_dbg(codec->dev, "set_bias_prepare\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2366:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2366 |                 dev_dbg(codec->dev, "set_bias_stby\n");
          |                              ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2366:17: note: in expansion of macro 'dev_dbg'
     2366 |                 dev_dbg(codec->dev, "set_bias_stby\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2367:26: error: invalid use of undefined type 'struct snd_soc_codec'
     2367 |                 if (codec->component.dapm.bias_level == SND_SOC_BIAS_OFF) {
          |                          ^~
    sound/soc/codecs/tlv320aic326x.c:2368:50: error: invalid use of undefined type 'struct snd_soc_codec'
     2368 |                         pm_runtime_get_sync(codec->dev);
          |                                                  ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2386:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2386 |                 dev_dbg(codec->dev, "set_bias_off\n");
          |                              ^~
    ./include/linux/dev_printk.h:139:44: note: in definition of macro 'dev_no_printk'
      139 |                         _dev_printk(level, dev, fmt, ##__VA_ARGS__);    \
          |                                            ^~~
    sound/soc/codecs/tlv320aic326x.c:2386:17: note: in expansion of macro 'dev_dbg'
     2386 |                 dev_dbg(codec->dev, "set_bias_off\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2388:26: error: invalid use of undefined type 'struct snd_soc_codec'
     2388 |                 if (codec->component.dapm.bias_level == SND_SOC_BIAS_STANDBY) {
          |                          ^~
    sound/soc/codecs/tlv320aic326x.c:2396:45: error: invalid use of undefined type 'struct snd_soc_codec'
     2396 |                         pm_runtime_put(codec->dev);
          |                                             ^~
    sound/soc/codecs/tlv320aic326x.c:2401:14: error: invalid use of undefined type 'struct snd_soc_codec'
     2401 |         codec->component.dapm.bias_level = level;
          |              ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_codec_probe':
    sound/soc/codecs/tlv320aic326x.c:2445:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2445 |                 dev_err(codec->dev, "codec pointer is NULL.\n");
          |                              ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:2445:17: note: in expansion of macro 'dev_err'
     2445 |                 dev_err(codec->dev, "codec pointer is NULL.\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2447:14: error: invalid use of undefined type 'struct snd_soc_codec'
     2447 |         codec->control_data = dev_get_drvdata(codec->dev->parent);
          |              ^~
    sound/soc/codecs/tlv320aic326x.c:2447:52: error: invalid use of undefined type 'struct snd_soc_codec'
     2447 |         codec->control_data = dev_get_drvdata(codec->dev->parent);
          |                                                    ^~
    sound/soc/codecs/tlv320aic326x.c:2448:24: error: invalid use of undefined type 'struct snd_soc_codec'
     2448 |         control = codec->control_data;
          |                        ^~
    sound/soc/codecs/tlv320aic326x.c:2453:9: error: implicit declaration of function 'snd_soc_codec_set_drvdata'; did you mean 'snd_soc_card_set_drvdata'? [-Werror=implicit-function-declaration]
     2453 |         snd_soc_codec_set_drvdata(codec, aic3262);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
          |         snd_soc_card_set_drvdata
    sound/soc/codecs/tlv320aic326x.c:2454:48: error: invalid use of undefined type 'struct snd_soc_codec'
     2454 |         aic3262->pdata = dev_get_platdata(codec->dev->parent);
          |                                                ^~
    In file included from ./include/linux/seqlock.h:19,
                     from ./include/linux/mm_types.h:20,
                     from ./include/linux/buildid.h:5,
                     from ./include/linux/module.h:14,
                     from sound/soc/codecs/tlv320aic326x.c:34:
    sound/soc/codecs/tlv320aic326x.c:2467:26: error: invalid use of undefined type 'struct snd_soc_codec'
     2467 |         mutex_init(&codec->component.io_mutex);
          |                          ^~
    ./include/linux/mutex.h:108:23: note: in definition of macro 'mutex_init'
      108 |         __mutex_init((mutex), #mutex, &__key);                          \
          |                       ^~~~~
    sound/soc/codecs/tlv320aic326x.c:2469:32: error: invalid use of undefined type 'struct snd_soc_codec'
     2469 |         pm_runtime_enable(codec->dev);
          |                                ^~
    sound/soc/codecs/tlv320aic326x.c:2470:32: error: invalid use of undefined type 'struct snd_soc_codec'
     2470 |         pm_runtime_resume(codec->dev);
          |                                ^~
    sound/soc/codecs/tlv320aic326x.c:2474:48: error: invalid use of undefined type 'struct snd_soc_codec'
     2474 |                 ret = aic3xxx_request_irq(codec->control_data,
          |                                                ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2481:38: error: invalid use of undefined type 'struct snd_soc_codec'
     2481 |                         dev_err(codec->dev,
          |                                      ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:2481:25: note: in expansion of macro 'dev_err'
     2481 |                         dev_err(codec->dev,
          |                         ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2509:52: error: 'FW_ACTION_HOTPLUG' undeclared (first use in this function)
     2509 |         ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
          |                                                    ^~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2509:52: note: each undeclared identifier is reported only once for each function it appears in
    sound/soc/codecs/tlv320aic326x.c:2510:65: error: invalid use of undefined type 'struct snd_soc_codec'
     2510 |                                 "tlv320aic3262_fw_v1.bin", codec->dev,
          |                                                                 ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2513:30: error: invalid use of undefined type 'struct snd_soc_codec'
     2513 |                 dev_err(codec->dev, "Firmware request failed\n");
          |                              ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:2513:17: note: in expansion of macro 'dev_err'
     2513 |                 dev_err(codec->dev, "Firmware request failed\n");
          |                 ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_codec_remove':
    sound/soc/codecs/tlv320aic326x.c:2537:40: warning: initialization of 'struct aic3262_priv *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     2537 |         struct aic3262_priv *aic3262 = snd_soc_codec_get_drvdata(codec);
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2538:40: error: invalid use of undefined type 'struct snd_soc_codec'
     2538 |         struct aic3xxx *control = codec->control_data;
          |                                        ^~
    In file included from ./include/linux/device.h:15,
                     from ./include/linux/acpi.h:15,
                     from ./include/linux/i2c.h:13,
                     from sound/soc/codecs/tlv320aic326x.c:39:
    sound/soc/codecs/tlv320aic326x.c:2550:31: error: invalid use of undefined type 'struct snd_soc_codec'
     2550 |                 dev_info(codec->dev, "Coded is not TLV320AIC3262\n");
          |                               ^~
    ./include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
      110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
          |                         ^~~
    sound/soc/codecs/tlv320aic326x.c:2550:17: note: in expansion of macro 'dev_info'
     2550 |                 dev_info(codec->dev, "Coded is not TLV320AIC3262\n");
          |                 ^~~~~~~~
    sound/soc/codecs/tlv320aic326x.c: At top level:
    sound/soc/codecs/tlv320aic326x.c:2563:15: error: variable 'soc_codec_driver_aic326x' has initializer but incomplete type
     2563 | static struct snd_soc_codec_driver soc_codec_driver_aic326x = {
          |               ^~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2564:10: error: 'struct snd_soc_codec_driver' has no member named 'probe'
     2564 |         .probe = aic3262_codec_probe,
          |          ^~~~~
    sound/soc/codecs/tlv320aic326x.c:2564:18: warning: excess elements in struct initializer
     2564 |         .probe = aic3262_codec_probe,
          |                  ^~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2564:18: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2565:10: error: 'struct snd_soc_codec_driver' has no member named 'remove'
     2565 |         .remove = aic3262_codec_remove,
          |          ^~~~~~
    sound/soc/codecs/tlv320aic326x.c:2565:19: warning: excess elements in struct initializer
     2565 |         .remove = aic3262_codec_remove,
          |                   ^~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2565:19: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2566:10: error: 'struct snd_soc_codec_driver' has no member named 'suspend'
     2566 |         .suspend = aic3262_suspend,
          |          ^~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2566:20: warning: excess elements in struct initializer
     2566 |         .suspend = aic3262_suspend,
          |                    ^~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2566:20: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2567:10: error: 'struct snd_soc_codec_driver' has no member named 'resume'
     2567 |         .resume = aic3262_resume,
          |          ^~~~~~
    sound/soc/codecs/tlv320aic326x.c:2567:19: warning: excess elements in struct initializer
     2567 |         .resume = aic3262_resume,
          |                   ^~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2567:19: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2568:10: error: 'struct snd_soc_codec_driver' has no member named 'read'
     2568 |         .read = aic3262_codec_read,
          |          ^~~~
    sound/soc/codecs/tlv320aic326x.c:2568:17: warning: excess elements in struct initializer
     2568 |         .read = aic3262_codec_read,
          |                 ^~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2568:17: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2569:10: error: 'struct snd_soc_codec_driver' has no member named 'write'
     2569 |         .write = aic3262_codec_write,
          |          ^~~~~
    sound/soc/codecs/tlv320aic326x.c:2569:18: warning: excess elements in struct initializer
     2569 |         .write = aic3262_codec_write,
          |                  ^~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2569:18: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2570:10: error: 'struct snd_soc_codec_driver' has no member named 'controls'
     2570 |         .controls = aic3262_snd_controls,
          |          ^~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2570:21: warning: excess elements in struct initializer
     2570 |         .controls = aic3262_snd_controls,
          |                     ^~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2570:21: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2571:10: error: 'struct snd_soc_codec_driver' has no member named 'num_controls'
     2571 |         .num_controls = ARRAY_SIZE(aic3262_snd_controls),
          |          ^~~~~~~~~~~~
    In file included from ./include/linux/cpumask.h:10,
                     from ./include/linux/mm_types_task.h:14,
                     from ./include/linux/mm_types.h:5,
                     from ./include/linux/buildid.h:5,
                     from ./include/linux/module.h:14,
                     from sound/soc/codecs/tlv320aic326x.c:34:
    ./include/linux/kernel.h:55:25: warning: excess elements in struct initializer
       55 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
          |                         ^
    sound/soc/codecs/tlv320aic326x.c:2571:25: note: in expansion of macro 'ARRAY_SIZE'
     2571 |         .num_controls = ARRAY_SIZE(aic3262_snd_controls),
          |                         ^~~~~~~~~~
    ./include/linux/kernel.h:55:25: note: (near initialization for 'soc_codec_driver_aic326x')
       55 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
          |                         ^
    sound/soc/codecs/tlv320aic326x.c:2571:25: note: in expansion of macro 'ARRAY_SIZE'
     2571 |         .num_controls = ARRAY_SIZE(aic3262_snd_controls),
          |                         ^~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2572:10: error: 'struct snd_soc_codec_driver' has no member named 'dapm_widgets'
     2572 |         .dapm_widgets = aic3262_dapm_widgets,
          |          ^~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2572:25: warning: excess elements in struct initializer
     2572 |         .dapm_widgets = aic3262_dapm_widgets,
          |                         ^~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2572:25: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2573:10: error: 'struct snd_soc_codec_driver' has no member named 'num_dapm_widgets'
     2573 |         .num_dapm_widgets = ARRAY_SIZE(aic3262_dapm_widgets),
          |          ^~~~~~~~~~~~~~~~
    In file included from ./include/linux/cpumask.h:10,
                     from ./include/linux/mm_types_task.h:14,
                     from ./include/linux/mm_types.h:5,
                     from ./include/linux/buildid.h:5,
                     from ./include/linux/module.h:14,
                     from sound/soc/codecs/tlv320aic326x.c:34:
    ./include/linux/kernel.h:55:25: warning: excess elements in struct initializer
       55 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
          |                         ^
    sound/soc/codecs/tlv320aic326x.c:2573:29: note: in expansion of macro 'ARRAY_SIZE'
     2573 |         .num_dapm_widgets = ARRAY_SIZE(aic3262_dapm_widgets),
          |                             ^~~~~~~~~~
    ./include/linux/kernel.h:55:25: note: (near initialization for 'soc_codec_driver_aic326x')
       55 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
          |                         ^
    sound/soc/codecs/tlv320aic326x.c:2573:29: note: in expansion of macro 'ARRAY_SIZE'
     2573 |         .num_dapm_widgets = ARRAY_SIZE(aic3262_dapm_widgets),
          |                             ^~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2574:10: error: 'struct snd_soc_codec_driver' has no member named 'dapm_routes'
     2574 |         .dapm_routes = aic3262_dapm_routes,
          |          ^~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2574:24: warning: excess elements in struct initializer
     2574 |         .dapm_routes = aic3262_dapm_routes,
          |                        ^~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2574:24: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2575:10: error: 'struct snd_soc_codec_driver' has no member named 'num_dapm_routes'
     2575 |         .num_dapm_routes = ARRAY_SIZE(aic3262_dapm_routes),
          |          ^~~~~~~~~~~~~~~
    In file included from ./include/linux/cpumask.h:10,
                     from ./include/linux/mm_types_task.h:14,
                     from ./include/linux/mm_types.h:5,
                     from ./include/linux/buildid.h:5,
                     from ./include/linux/module.h:14,
                     from sound/soc/codecs/tlv320aic326x.c:34:
    ./include/linux/kernel.h:55:25: warning: excess elements in struct initializer
       55 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
          |                         ^
    sound/soc/codecs/tlv320aic326x.c:2575:28: note: in expansion of macro 'ARRAY_SIZE'
     2575 |         .num_dapm_routes = ARRAY_SIZE(aic3262_dapm_routes),
          |                            ^~~~~~~~~~
    ./include/linux/kernel.h:55:25: note: (near initialization for 'soc_codec_driver_aic326x')
       55 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
          |                         ^
    sound/soc/codecs/tlv320aic326x.c:2575:28: note: in expansion of macro 'ARRAY_SIZE'
     2575 |         .num_dapm_routes = ARRAY_SIZE(aic3262_dapm_routes),
          |                            ^~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2576:10: error: 'struct snd_soc_codec_driver' has no member named 'set_bias_level'
     2576 |         .set_bias_level = aic3262_set_bias_level,
          |          ^~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2576:27: warning: excess elements in struct initializer
     2576 |         .set_bias_level = aic3262_set_bias_level,
          |                           ^~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2576:27: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2577:10: error: 'struct snd_soc_codec_driver' has no member named 'reg_cache_size'
     2577 |         .reg_cache_size = 0,
          |          ^~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2577:27: warning: excess elements in struct initializer
     2577 |         .reg_cache_size = 0,
          |                           ^
    sound/soc/codecs/tlv320aic326x.c:2577:27: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2578:10: error: 'struct snd_soc_codec_driver' has no member named 'reg_word_size'
     2578 |         .reg_word_size = sizeof(u8),
          |          ^~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c:2578:26: warning: excess elements in struct initializer
     2578 |         .reg_word_size = sizeof(u8),
          |                          ^~~~~~
    sound/soc/codecs/tlv320aic326x.c:2578:26: note: (near initialization for 'soc_codec_driver_aic326x')
    sound/soc/codecs/tlv320aic326x.c:2579:10: error: 'struct snd_soc_codec_driver' has no member named 'reg_cache_default'
     2579 |         .reg_cache_default = NULL,
          |          ^~~~~~~~~~~~~~~~~
    In file included from ./include/uapi/linux/posix_types.h:5,
                     from ./include/uapi/linux/types.h:14,
                     from ./include/linux/types.h:6,
                     from ./include/linux/kasan-checks.h:5,
                     from ./include/asm-generic/rwonce.h:26,
                     from ./arch/arm/include/generated/asm/rwonce.h:1,
                     from ./include/linux/compiler.h:246,
                     from ./include/linux/build_bug.h:5,
                     from ./include/linux/container_of.h:5,
                     from ./include/linux/list.h:5,
                     from ./include/linux/module.h:12,
                     from sound/soc/codecs/tlv320aic326x.c:34:
    ./include/linux/stddef.h:8:14: warning: excess elements in struct initializer
        8 | #define NULL ((void *)0)
          |              ^
    sound/soc/codecs/tlv320aic326x.c:2579:30: note: in expansion of macro 'NULL'
     2579 |         .reg_cache_default = NULL,
          |                              ^~~~
    ./include/linux/stddef.h:8:14: note: (near initialization for 'soc_codec_driver_aic326x')
        8 | #define NULL ((void *)0)
          |              ^
    sound/soc/codecs/tlv320aic326x.c:2579:30: note: in expansion of macro 'NULL'
     2579 |         .reg_cache_default = NULL,
          |                              ^~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic326x_probe':
    sound/soc/codecs/tlv320aic326x.c:2584:16: error: implicit declaration of function 'snd_soc_register_codec'; did you mean 'snd_soc_register_dai'? [-Werror=implicit-function-declaration]
     2584 |         return snd_soc_register_codec(&pdev->dev, &soc_codec_driver_aic326x,
          |                ^~~~~~~~~~~~~~~~~~~~~~
          |                snd_soc_register_dai
    sound/soc/codecs/tlv320aic326x.c: In function 'aic326x_remove':
    sound/soc/codecs/tlv320aic326x.c:2592:9: error: implicit declaration of function 'snd_soc_unregister_codec'; did you mean 'snd_soc_unregister_dai'? [-Werror=implicit-function-declaration]
     2592 |         snd_soc_unregister_codec(&pdev->dev);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~
          |         snd_soc_unregister_dai
    sound/soc/codecs/tlv320aic326x.c: At top level:
    sound/soc/codecs/tlv320aic326x.c:2563:36: error: storage size of 'soc_codec_driver_aic326x' isn't known
     2563 | static struct snd_soc_codec_driver soc_codec_driver_aic326x = {
          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_set_interface_fmt':
    sound/soc/codecs/tlv320aic326x.c:2045:27: warning: this statement may fall through [-Wimplicit-fallthrough=]
     2045 |                 dsp_a_val = 0x1;        /* Intentionally falling through */
          |                 ~~~~~~~~~~^~~~~
    sound/soc/codecs/tlv320aic326x.c:2046:9: note: here
     2046 |         case SND_SOC_DAIFMT_DSP_B:
          |         ^~~~
    sound/soc/codecs/tlv320aic326x.c: In function 'aic3262_codec_write':
    sound/soc/codecs/tlv320aic326x.c:2003:1: error: control reaches end of non-void function [-Werror=return-type]
     2003 | }
          | ^
    cc1: some warnings being treated as errors
    make[4]: *** [scripts/Makefile.build:250: sound/soc/codecs/tlv320aic326x.o] Error 1
    make[3]: *** [scripts/Makefile.build:505: sound/soc/codecs] Error 2
    make[3]: *** Waiting for unfinished jobs....
    make[2]: *** [scripts/Makefile.build:505: sound/soc] Error 2
    make[1]: *** [scripts/Makefile.build:505: sound] Error 2
    make: *** [Makefile:2009: .] Error 2
    

    Please help me resolve the issues!

    -Vishal

  • Hello Vishal, I asked one of our software experts, Raphael,  to take a look at this as I am not the right person to help furthur.

    Regards,

    Arash

  • Hello Arash,

    Could you please provide a response at the earliest? I’m unable to proceed due to this issue.

  •   

    Sorry I accidentally removed the contents when I wanted to delete a particular old patch to avoid confusion. 

    I am attaching the patch once again and latest solution.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/v3_2D00_0001_2D00_Add_2D00_driver_2D00_for_2D00_tlv320aic3262.patch

    ----

    Latest comment from  

    After setting compatible string in dtsi file, the aic3xxx_i2c_probe function from drivers/mfd/tlv320aic3xxx-i2c.c file is getting called but still the no sound card is detected as below.

    root@am57xx-evm:~# aplay -l aplay: device_list:274: no soundcards found...

    So I added the same compatible string in sound/soc/codecs/tlv320aic326x.c driver file as well as shown below.

    static const struct of_device_id aic3262_of_match[] = {
        { .compatible = "ti,aic3262", },
        { .compatible = "ti,aic3268", },
        { .compatible = "ti,tlv320aic3262", },
        { },
    };

    And finally the sound card is getting detected.

    root@am57xx-evm:~# aplay -L
    null   Discard all samples (playback) or generate zero samples (capture) 
    default:
      CARD=BeagleBoardX15    BeagleBoard-X15, davinci-mcasp.0-aic326x-asi1 aic326x-asi1-0    Default Audio Device
    sysdefault:
      CARD=BeagleBoardX15    BeagleBoard-X15, davinci-mcasp.0-aic326x-asi1 aic326x-asi1-0    Default Audio Deviceroot@am57xx-evm:~# aplay -l**** List of PLAYBACK Hardware Devices ****card 0: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-aic326x-asi1 aic326x-asi1-0 [davinci-mcasp.0-aic326x-asi1 aic326x-asi1-0]  Subdevices: 1/1  Subdevice #0: subdevice #0
    

    Thanks a lot both of you!

    I will try to record and play sound now.

    ----

  • Hi  ,

    Add the { .compatible = "ti,tlv320aic3262", },  in sound/soc/codecs/tlv320aic326x.c in your patch.

    Without adding this the aplay -L / aplay -l didn't work on my custom board.

    Also, now that the audio device is working, I am able to capture and play sound using arecord and aplay respectively. 

    -Vishal