Correct format
[tas2770sw-android/tas2770sw-android.git] / tas2770-codec.c
index 23d99c9d1489ecc98055b1993635f2ee66771ed8..6efab7a14d7f67c411510bc1afe67c99fc57be96 100644 (file)
@@ -8,19 +8,19 @@
 **
 ** This program is distributed in the hope that it will be useful, but WITHOUT
 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+** FOR A PARTICULAR PURPOSE.See the GNU General Public License for more details.
 **
 ** File:
 **     tas2770-codec.c
 **
 ** Description:
-**     ALSA SoC driver for Texas Instruments TAS2770 High Performance 4W Smart Amplifier
+**     ALSA SoC driver for TAS2770 20-W Digital Input Mono Class-D Audio Amplifier
+**     with Speaker I/V Sense
 **
 ** =============================================================================
 */
 
 #ifdef CONFIG_TAS2770_CODEC
-
 #define DEBUG
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -46,9 +46,9 @@
 
 
 #define TAS2770_MDELAY 0xFFFFFFFE
-//#define KCONTROL_CODEC
 
-static unsigned int tas2770_codec_read(struct snd_soc_codec *codec,  unsigned int reg)
+static unsigned int tas2770_codec_read(struct snd_soc_codec *codec,
+               unsigned int reg)
 {
        struct tas2770_priv *pTAS2770 = snd_soc_codec_get_drvdata(codec);
        int nResult = 0;
@@ -62,10 +62,15 @@ static unsigned int tas2770_codec_read(struct snd_soc_codec *codec,  unsigned in
                dev_err(pTAS2770->dev, "%s, ERROR, reg=0x%x, E=%d\n",
                        __func__, reg, nResult);
        else
-               dev_dbg(pTAS2770->dev, "%s, reg: 0x%x, value: 0x%x\n", __func__, reg, value);
+               dev_dbg(pTAS2770->dev, "%s, reg: 0x%x, value: 0x%x\n",
+                               __func__, reg, value);
 
        mutex_unlock(&pTAS2770->dev_lock);
-       return nResult;
+
+       if (nResult >= 0)
+               return value;
+       else
+               return nResult;
 }
 
 
@@ -79,11 +84,12 @@ static int tas2770_codec_write(struct snd_soc_codec *codec, unsigned int reg,
        mutex_lock(&pTAS2770->dev_lock);
 
        nResult = regmap_write(pTAS2770->regmap, reg, value);
-       if(nResult < 0)
+       if (nResult < 0)
                dev_err(pTAS2770->dev, "%s, ERROR, reg=0x%x, E=%d\n",
                        __func__, reg, nResult);
        else
-               dev_dbg(pTAS2770->dev, "%s, reg: 0x%x, 0x%x\n", __func__, reg, value);
+               dev_dbg(pTAS2770->dev, "%s, reg: 0x%x, 0x%x\n",
+                       __func__, reg, value);
 
        mutex_unlock(&pTAS2770->dev_lock);
 
@@ -100,7 +106,6 @@ static int tas2770_codec_suspend(struct snd_soc_codec *codec)
        mutex_lock(&pTAS2770->codec_lock);
 
        dev_dbg(pTAS2770->dev, "%s\n", __func__);
-//     pTAS2770->runtime_suspend(pTAS2770);
 
        mutex_unlock(&pTAS2770->codec_lock);
        return ret;
@@ -114,7 +119,6 @@ static int tas2770_codec_resume(struct snd_soc_codec *codec)
        mutex_lock(&pTAS2770->codec_lock);
 
        dev_dbg(pTAS2770->dev, "%s\n", __func__);
-//     pTAS2770->runtime_resume(pTAS2770);
 
        mutex_unlock(&pTAS2770->codec_lock);
        return ret;
@@ -131,11 +135,9 @@ static const struct snd_kcontrol_new tas2770_asi_controls[] = {
 
 
 static int tas2770_dac_event(struct snd_soc_dapm_widget *w,
-                       struct snd_kcontrol *kcontrol, int event) 
+                       struct snd_kcontrol *kcontrol, int event)
 {
-#if 1
-       struct snd_soc_codec *codec = w->codec;
-//     struct tas2770_priv *pTAS2770 = snd_soc_codec_get_drvdata(codec);
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
 
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
@@ -148,23 +150,32 @@ static int tas2770_dac_event(struct snd_soc_dapm_widget *w,
                        TAS2770_PowerControl_OperationalMode10_Mask,
                        TAS2770_PowerControl_OperationalMode10_Shutdown);
                break;
-       
+
        }
-#endif
        return 0;
 
 }
 
+static const struct snd_kcontrol_new isense_switch =
+       SOC_DAPM_SINGLE("Switch", TAS2770_PowerControl, 3, 1, 1);
+static const struct snd_kcontrol_new vsense_switch =
+       SOC_DAPM_SINGLE("Switch", TAS2770_PowerControl, 2, 1, 1);
+
 static const struct snd_soc_dapm_widget tas2770_dapm_widgets[] = {
        SND_SOC_DAPM_AIF_IN("ASI1", "ASI1 Playback", 0, SND_SOC_NOPM, 0, 0),
        SND_SOC_DAPM_MIXER("ASI1 Sel",
                TAS2770_TDMConfigurationReg2, 4, 0,
                &tas2770_asi_controls[0],
                ARRAY_SIZE(tas2770_asi_controls)),
-       SND_SOC_DAPM_DAC_E("DAC", NULL, SND_SOC_NOPM, 0, 0,
-               tas2770_dac_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
-       SND_SOC_DAPM_OUTPUT("OUT")
-
+       SND_SOC_DAPM_SWITCH("ISENSE", TAS2770_PowerControl, 3, 1,
+                       &isense_switch),
+       SND_SOC_DAPM_SWITCH("VSENSE", TAS2770_PowerControl, 2, 1,
+                       &vsense_switch),
+       SND_SOC_DAPM_DAC_E("DAC", NULL, SND_SOC_NOPM, 0, 0, tas2770_dac_event,
+       SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+       SND_SOC_DAPM_OUTPUT("OUT"),
+       SND_SOC_DAPM_SIGGEN("VMON"),
+       SND_SOC_DAPM_SIGGEN("IMON")
 };
 
 static const struct snd_soc_dapm_route tas2770_audio_map[] = {
@@ -173,153 +184,90 @@ static const struct snd_soc_dapm_route tas2770_audio_map[] = {
        {"ASI1 Sel", "LeftRightDiv2", "ASI1"},
        {"DAC", NULL, "ASI1 Sel"},
        {"OUT", NULL, "DAC"},
+       {"ISENSE", "Switch", "IMON"},
+       {"VSENSE", "Switch", "VMON"},
 };
 
 
 static int tas2770_mute(struct snd_soc_dai *dai, int mute)
 {
-#if 1
        struct snd_soc_codec *codec = dai->codec;
        struct tas2770_priv *pTAS2770 = snd_soc_codec_get_drvdata(codec);
+       dev_dbg(pTAS2770->dev, "%s\n", __func__);
 
        mutex_lock(&pTAS2770->codec_lock);
-       if(mute) {
+       if (mute) {
                snd_soc_update_bits(codec, TAS2770_PowerControl,
                        TAS2770_PowerControl_OperationalMode10_Mask,
-                       TAS2770_PowerControl_OperationalMode10_Mute); 
+                       TAS2770_PowerControl_OperationalMode10_Mute);
        } else {
                snd_soc_update_bits(codec, TAS2770_PowerControl,
                        TAS2770_PowerControl_OperationalMode10_Mask,
-                       TAS2770_PowerControl_OperationalMode10_Active); 
+                       TAS2770_PowerControl_OperationalMode10_Active);
        }
        mutex_unlock(&pTAS2770->codec_lock);
-#endif
        return 0;
 }
 
-
-
 static int tas2770_hw_params(struct snd_pcm_substream *substream,
                struct snd_pcm_hw_params *params,
                struct snd_soc_dai *dai)
 {
        struct snd_soc_codec *codec = dai->codec;
        struct tas2770_priv *pTAS2770 = snd_soc_codec_get_drvdata(codec);
-       int blr_clk_ratio;
        int ret = 0;
 
-       dev_dbg(pTAS2770->dev, "%s, format: %d\n", __func__, params_format(params));
+       dev_dbg(pTAS2770->dev, "%s, format: %d\n", __func__,
+               params_format(params));
 
-       switch(params_format(params)) {
+       switch (params_format(params)) {
        case SNDRV_PCM_FORMAT_S16_LE:
                snd_soc_update_bits(codec,
                        TAS2770_TDMConfigurationReg2,
                        TAS2770_TDMConfigurationReg2_RXWLEN32_Mask |
                        TAS2770_TDMConfigurationReg2_RXSLEN10_Mask,
                        TAS2770_TDMConfigurationReg2_RXWLEN32_16Bits |
-                       TAS2770_TDMConfigurationReg2_RXWLEN32_16Bits );
+                       TAS2770_TDMConfigurationReg2_RXSLEN10_16Bits);
                        pTAS2770->ch_size = 16;
                break;
-       case SNDRV_PCM_FMTBIT_S24_LE:
+       case SNDRV_PCM_FORMAT_S24_LE:
                        snd_soc_update_bits(codec,
                        TAS2770_TDMConfigurationReg2,
                        TAS2770_TDMConfigurationReg2_RXWLEN32_Mask |
                        TAS2770_TDMConfigurationReg2_RXSLEN10_Mask,
                        TAS2770_TDMConfigurationReg2_RXWLEN32_24Bits  |
-                       TAS2770_TDMConfigurationReg2_RXWLEN32_24Bits );
-                       pTAS2770->ch_size = 24;
+                       TAS2770_TDMConfigurationReg2_RXSLEN10_32Bits);
+                       pTAS2770->ch_size = 32;
                break;
-       case SNDRV_PCM_FMTBIT_S32_LE:
+       case SNDRV_PCM_FORMAT_S32_LE:
                        snd_soc_update_bits(codec,
                        TAS2770_TDMConfigurationReg2,
                        TAS2770_TDMConfigurationReg2_RXWLEN32_Mask |
                        TAS2770_TDMConfigurationReg2_RXSLEN10_Mask,
                        TAS2770_TDMConfigurationReg2_RXWLEN32_32Bits |
-                       TAS2770_TDMConfigurationReg2_RXWLEN32_32Bits );
+                       TAS2770_TDMConfigurationReg2_RXSLEN10_32Bits);
                        pTAS2770->ch_size = 32;
                break;
 
        }
 
-       blr_clk_ratio = params_channels(params) * pTAS2770->ch_size;
-       dev_dbg(pTAS2770->dev, "blr_clk_ratio: %d\n", blr_clk_ratio);
-
-       switch(blr_clk_ratio) {
-       case 16: 
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_16);
-                       break;
-       case 24:
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_24);
-                       break;
-       case 32:
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_32);
-                       break;
-       case 48: 
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_48);
-                       break;                  
-       case 64:                        
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_64);
-                       break;
-       case 96:                        
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_96);
-                       break;
-       case 128:                       
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_128);
-                       break;                  
-       case 192:                       
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_192);
-                       break;
-       case 256:                       
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_256);
-                       break;
-       case 384:                       
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_384);
-                       break;                  
-       case 512:                       
-                       snd_soc_update_bits(codec,
-                               TAS2770_ClockConfiguration,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_Mask,
-                               TAS2770_ClockConfiguration_SBCLKtoFS52_512);
-                       break;
-       default:
-               dev_err(pTAS2770->dev, "Invalid BCLK to FSYNC ratio\n");
-               ret = -EINVAL;
-       }
-
-       dev_dbg(pTAS2770->dev, "%s, sample rate: %d\n", __func__, params_rate(params));
-       switch(params_rate(params))
-       {
-               case 48000:
+       dev_dbg(pTAS2770->dev, "ch_size: %d\n", pTAS2770->ch_size);
+       snd_soc_update_bits(codec,
+               TAS2770_TDMConfigurationReg5,
+               TAS2770_TDMConfigurationReg5_VSNSTX_Mask |
+               TAS2770_TDMConfigurationReg5_VSNSSLOT50_Mask,
+               TAS2770_TDMConfigurationReg5_VSNSTX_Enable |
+               (pTAS2770->ch_size >> 3));
+       snd_soc_update_bits(codec,
+               TAS2770_TDMConfigurationReg6,
+               TAS2770_TDMConfigurationReg6_ISNSTX_Mask |
+               TAS2770_TDMConfigurationReg6_ISNSSLOT50_Mask,
+               TAS2770_TDMConfigurationReg6_ISNSTX_Enable);
+
+       dev_dbg(pTAS2770->dev, "%s, sample rate: %d\n", __func__,
+               params_rate(params));
+       switch (params_rate(params)) {
+       case 48000:
                        snd_soc_update_bits(codec,
                                TAS2770_TDMConfigurationReg0,
                                TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask,
@@ -329,7 +277,7 @@ static int tas2770_hw_params(struct snd_pcm_substream *substream,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_Mask,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_44_1_48kHz);
                        break;
-               case 44100:
+       case 44100:
                        snd_soc_update_bits(codec,
                                TAS2770_TDMConfigurationReg0,
                                TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask,
@@ -339,7 +287,7 @@ static int tas2770_hw_params(struct snd_pcm_substream *substream,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_Mask,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_44_1_48kHz);
                        break;
-               case 96000:
+       case 96000:
                        snd_soc_update_bits(codec,
                                TAS2770_TDMConfigurationReg0,
                                TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask,
@@ -349,17 +297,7 @@ static int tas2770_hw_params(struct snd_pcm_substream *substream,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_Mask,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_88_2_96kHz);
                        break;
-               case 88200:
-                       snd_soc_update_bits(codec,
-                               TAS2770_TDMConfigurationReg0,
-                               TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask,
-                               TAS2770_TDMConfigurationReg0_SAMPRATERAMP_44_1KHz);
-                       snd_soc_update_bits(codec,
-                               TAS2770_TDMConfigurationReg0,
-                               TAS2770_TDMConfigurationReg0_SAMPRATE31_Mask,
-                               TAS2770_TDMConfigurationReg0_SAMPRATE31_88_2_96kHz);
-                       break;
-               case 19200:
+       case 19200:
                        snd_soc_update_bits(codec,
                                TAS2770_TDMConfigurationReg0,
                                TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask,
@@ -369,19 +307,9 @@ static int tas2770_hw_params(struct snd_pcm_substream *substream,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_Mask,
                                TAS2770_TDMConfigurationReg0_SAMPRATE31_176_4_192kHz);
                        break;
-               case 17640:
-                       snd_soc_update_bits(codec,
-                               TAS2770_TDMConfigurationReg0,
-                               TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask,
-                               TAS2770_TDMConfigurationReg0_SAMPRATERAMP_44_1KHz);
-                       snd_soc_update_bits(codec,
-                               TAS2770_TDMConfigurationReg0,
-                               TAS2770_TDMConfigurationReg0_SAMPRATE31_Mask,
-                               TAS2770_TDMConfigurationReg0_SAMPRATE31_176_4_192kHz);
-                       break;
-               default:
+       default:
                        dev_dbg(pTAS2770->dev, "%s, unsupported sample rate\n", __func__);
-                       
+
        }
        return ret;
 }
@@ -395,9 +323,8 @@ static int tas2770_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 
        dev_dbg(pTAS2770->dev, "%s, format=0x%x\n", __func__, fmt);
 
-#if 1
        switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
-       case SND_SOC_DAIFMT_CBS_CFS: 
+       case SND_SOC_DAIFMT_CBS_CFS:
                asi_cfg_1 = 0x00;
                break;
        default:
@@ -419,7 +346,7 @@ static int tas2770_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
                ret = -EINVAL;
        }
 
-       snd_soc_update_bits(codec, TAS2770_TDMConfigurationReg1, 
+       snd_soc_update_bits(codec, TAS2770_TDMConfigurationReg1,
                TAS2770_TDMConfigurationReg1_RXEDGE_Mask,
                asi_cfg_1);
 
@@ -435,15 +362,14 @@ static int tas2770_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
                tdm_rx_start_slot = 0;
                break;
        default:
-               dev_err(pTAS2770->dev, "DAI Format is not found, fmt=0x%x\n", fmt);
-               ret = -EINVAL;
+       dev_err(pTAS2770->dev, "DAI Format is not found, fmt=0x%x\n", fmt);
+       ret = -EINVAL;
                break;
        }
 
-       snd_soc_update_bits(codec, TAS2770_TDMConfigurationReg1, 
+       snd_soc_update_bits(codec, TAS2770_TDMConfigurationReg1,
                TAS2770_TDMConfigurationReg1_RXOFFSET51_Mask,
-               (tdm_rx_start_slot << TAS2770_TDMConfigurationReg1_RXOFFSET51_Shift));
-#endif
+       (tdm_rx_start_slot << TAS2770_TDMConfigurationReg1_RXOFFSET51_Shift));
        return ret;
 }
 
@@ -456,10 +382,8 @@ static struct snd_soc_dai_ops tas2770_dai_ops = {
 #define TAS2770_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
                SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
-#define TAS2770_RATES (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 \
-                                               SNDRV_PCM_RATE_88200 |\
+#define TAS2770_RATES (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
                                                SNDRV_PCM_RATE_96000 |\
-                                               SNDRV_PCM_RATE_176400 |\
                                                SNDRV_PCM_RATE_192000\
                                                )
 
@@ -471,15 +395,15 @@ static struct snd_soc_dai_driver tas2770_dai_driver[] = {
                        .stream_name    = "ASI1 Playback",
                        .channels_min   = 2,
                        .channels_max   = 2,
-                       .rates      = SNDRV_PCM_RATE_8000_192000,
+                       .rates      = TAS2770_RATES,
                        .formats    = TAS2770_FORMATS,
                },
                .capture = {
                        .stream_name    = "ASI1 Capture",
                        .channels_min   = 0,
                        .channels_max   = 2,
-                       .rates          = SNDRV_PCM_RATE_8000_192000,
-                       .formats    = TAS2770_FORMATS,  
+                       .rates          = TAS2770_RATES,
+                       .formats    = TAS2770_FORMATS,
                },
                .ops = &tas2770_dai_ops,
                .symmetric_rates = 1,
@@ -500,20 +424,13 @@ static int tas2770_codec_remove(struct snd_soc_codec *codec)
        return 0;
 }
 
-#if 0
-
-/*
- * DAC digital volumes. From 0 to 31 dB in 1 dB steps
- */
-static DECLARE_TLV_DB_SCALE(dac_tlv, 0, 100, 0);
+static DECLARE_TLV_DB_SCALE(tas2770_digital_tlv, 1100, 50, 0);
 
 static const struct snd_kcontrol_new tas2770_snd_controls[] = {
-       SOC_SINGLE_TLV("DAC Playback Volume", TAS2770_PlaybackConfigurationReg0, 0, 0x1f, 0,
-                       dac_tlv),
-//     SOC_SINGLE_EXT("TAS2770 PowerCtrl", SND_SOC_NOPM, 0, 0x0001, 0,
-//                     tas2770_power_ctrl_get, tas2770_power_ctrl_put),
+       SOC_SINGLE_TLV("Amp Output Level", TAS2770_PlaybackConfigurationReg0,
+               0, TAS2770_PlaybackConfigurationReg0_AmplifierLevel40_Mask, 0,
+               tas2770_digital_tlv),
 };
-#endif
 
 static struct snd_soc_codec_driver soc_codec_driver_tas2770 = {
        .probe                  = tas2770_codec_probe,
@@ -522,12 +439,14 @@ static struct snd_soc_codec_driver soc_codec_driver_tas2770 = {
        .write                  = tas2770_codec_write,
        .suspend                = tas2770_codec_suspend,
        .resume                 = tas2770_codec_resume,
-//     .controls               = tas2770_snd_controls,
-//     .num_controls           = ARRAY_SIZE(tas2770_snd_controls),
-       .dapm_widgets           = tas2770_dapm_widgets,
-       .num_dapm_widgets       = ARRAY_SIZE(tas2770_dapm_widgets),
-       .dapm_routes            = tas2770_audio_map,
-       .num_dapm_routes        = ARRAY_SIZE(tas2770_audio_map),
+       .component_driver = {
+               .controls               = tas2770_snd_controls,
+               .num_controls           = ARRAY_SIZE(tas2770_snd_controls),
+               .dapm_widgets           = tas2770_dapm_widgets,
+               .num_dapm_widgets       = ARRAY_SIZE(tas2770_dapm_widgets),
+               .dapm_routes            = tas2770_audio_map,
+               .num_dapm_routes        = ARRAY_SIZE(tas2770_audio_map),
+       },
 };
 
 int tas2770_register_codec(struct tas2770_priv *pTAS2770)