Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/sta32x', 'asoc/topic...
authorMark Brown <broonie@kernel.org>
Mon, 9 Feb 2015 07:10:29 +0000 (15:10 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 9 Feb 2015 07:10:29 +0000 (15:10 +0800)
1  2  3  4  5  6 
sound/soc/codecs/Kconfig
sound/soc/codecs/tlv320aic3x.c
sound/soc/fsl/eukrea-tlv320.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/wm1133-ev1.c
sound/soc/generic/simple-card.c
sound/soc/soc-core.c

diff --combined sound/soc/codecs/Kconfig
@@@@@@@ -69,7 -69,6 -69,6 -69,6 -69,6 -69,6 +69,7 @@@@@@@ config SND_SOC_ALL_CODEC
        select SND_SOC_MAX98088 if I2C
        select SND_SOC_MAX98090 if I2C
        select SND_SOC_MAX98095 if I2C
 +++++  select SND_SOC_MAX98357A
        select SND_SOC_MAX9850 if I2C
        select SND_SOC_MAX9768 if I2C
        select SND_SOC_MAX9877 if I2C
@@@@@@@ -457,9 -456,6 -456,6 -456,6 -456,6 -456,6 +457,9 @@@@@@@ config SND_SOC_MAX9809
      config SND_SOC_MAX98095
             tristate
      
 +++++config SND_SOC_MAX98357A
 +++++       tristate
 +++++
      config SND_SOC_MAX9850
        tristate
      
@@@@@@@ -529,7 -525,7 -525,7 -525,7 -525,7 -525,7 +529,7 @@@@@@@ config SND_SOC_RT567
      
      config SND_SOC_RT5677_SPI
        tristate
 -----  default SND_SOC_RT5677
 +++++  default SND_SOC_RT5677 && SPI
      
      #Freescale sgtl5000 codec
      config SND_SOC_SGTL5000
@@@@@@@ -584,7 -580,7 -580,9 -580,7 -580,7 -580,7 +584,9 @@@@@@@ config SND_SOC_SSM456
        depends on I2C
      
      config SND_SOC_STA32X
-- ---  tristate
++ +++  tristate "STA326, STA328 and STA329 speaker amplifier"
++ +++  depends on I2C
++ +++  select REGMAP_I2C
      
      config SND_SOC_STA350
        tristate "STA350 speaker amplifier"
@@@@@@@ -87,6 -87,6 -87,6 -87,6 -87,6 -87,7 +87,7 @@@@@@@ struct aic3x_priv 
      #define AIC3X_MODEL_3X 0
      #define AIC3X_MODEL_33 1
      #define AIC3X_MODEL_3007 2
+++++ #define AIC3X_MODEL_3104 3
        u16 model;
      
        /* Selects the micbias voltage */
@@@@@@@ -197,7 -197,7 -197,7 -197,7 -197,7 -198,7 +198,7 @@@@@@@ static int snd_soc_dapm_put_volsw_aic3x
      static int mic_bias_event(struct snd_soc_dapm_widget *w,
        struct snd_kcontrol *kcontrol, int event)
      {
 -----  struct snd_soc_codec *codec = w->codec;
 +++++  struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
        struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
      
        switch (event) {
@@@@@@@ -316,52 -316,52 -316,52 -316,52 -316,52 -317,37 +317,37 @@@@@@@ static const struct snd_kcontrol_new ai
         * only for swapped L-to-R and R-to-L routes. See below stereo controls
         * for direct L-to-L and R-to-R routes.
         */
-----   SOC_SINGLE_TLV("Left Line Mixer Line2R Bypass Volume",
-----                  LINE2R_2_LLOPM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Left Line Mixer PGAR Bypass Volume",
                       PGAR_2_LLOPM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Left Line Mixer DACR1 Playback Volume",
                       DACR1_2_LLOPM_VOL, 0, 118, 1, output_stage_tlv),
      
-----   SOC_SINGLE_TLV("Right Line Mixer Line2L Bypass Volume",
-----                  LINE2L_2_RLOPM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Right Line Mixer PGAL Bypass Volume",
                       PGAL_2_RLOPM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Right Line Mixer DACL1 Playback Volume",
                       DACL1_2_RLOPM_VOL, 0, 118, 1, output_stage_tlv),
      
-----   SOC_SINGLE_TLV("Left HP Mixer Line2R Bypass Volume",
-----                  LINE2R_2_HPLOUT_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Left HP Mixer PGAR Bypass Volume",
                       PGAR_2_HPLOUT_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Left HP Mixer DACR1 Playback Volume",
                       DACR1_2_HPLOUT_VOL, 0, 118, 1, output_stage_tlv),
      
-----   SOC_SINGLE_TLV("Right HP Mixer Line2L Bypass Volume",
-----                  LINE2L_2_HPROUT_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Right HP Mixer PGAL Bypass Volume",
                       PGAL_2_HPROUT_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Right HP Mixer DACL1 Playback Volume",
                       DACL1_2_HPROUT_VOL, 0, 118, 1, output_stage_tlv),
      
-----   SOC_SINGLE_TLV("Left HPCOM Mixer Line2R Bypass Volume",
-----                  LINE2R_2_HPLCOM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Left HPCOM Mixer PGAR Bypass Volume",
                       PGAR_2_HPLCOM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Left HPCOM Mixer DACR1 Playback Volume",
                       DACR1_2_HPLCOM_VOL, 0, 118, 1, output_stage_tlv),
      
-----   SOC_SINGLE_TLV("Right HPCOM Mixer Line2L Bypass Volume",
-----                  LINE2L_2_HPRCOM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Right HPCOM Mixer PGAL Bypass Volume",
                       PGAL_2_HPRCOM_VOL, 0, 118, 1, output_stage_tlv),
        SOC_SINGLE_TLV("Right HPCOM Mixer DACL1 Playback Volume",
                       DACL1_2_HPRCOM_VOL, 0, 118, 1, output_stage_tlv),
      
        /* Stereo output controls for direct L-to-L and R-to-R routes */
-----   SOC_DOUBLE_R_TLV("Line Line2 Bypass Volume",
-----                    LINE2L_2_LLOPM_VOL, LINE2R_2_RLOPM_VOL,
-----                    0, 118, 1, output_stage_tlv),
        SOC_DOUBLE_R_TLV("Line PGA Bypass Volume",
                         PGAL_2_LLOPM_VOL, PGAR_2_RLOPM_VOL,
                         0, 118, 1, output_stage_tlv),
                         DACL1_2_LLOPM_VOL, DACR1_2_RLOPM_VOL,
                         0, 118, 1, output_stage_tlv),
      
-----   SOC_DOUBLE_R_TLV("HP Line2 Bypass Volume",
-----                    LINE2L_2_HPLOUT_VOL, LINE2R_2_HPROUT_VOL,
-----                    0, 118, 1, output_stage_tlv),
        SOC_DOUBLE_R_TLV("HP PGA Bypass Volume",
                         PGAL_2_HPLOUT_VOL, PGAR_2_HPROUT_VOL,
                         0, 118, 1, output_stage_tlv),
                         DACL1_2_HPLOUT_VOL, DACR1_2_HPROUT_VOL,
                         0, 118, 1, output_stage_tlv),
      
-----   SOC_DOUBLE_R_TLV("HPCOM Line2 Bypass Volume",
-----                    LINE2L_2_HPLCOM_VOL, LINE2R_2_HPRCOM_VOL,
-----                    0, 118, 1, output_stage_tlv),
        SOC_DOUBLE_R_TLV("HPCOM PGA Bypass Volume",
                         PGAL_2_HPLCOM_VOL, PGAR_2_HPRCOM_VOL,
                         0, 118, 1, output_stage_tlv),
        SOC_ENUM("Output Driver Ramp-up step", aic3x_rampup_step_enum),
      };
      
+++++ /* For other than tlv320aic3104 */
+++++ static const struct snd_kcontrol_new aic3x_extra_snd_controls[] = {
+++++   /*
+++++    * Output controls that map to output mixer switches. Note these are
+++++    * only for swapped L-to-R and R-to-L routes. See below stereo controls
+++++    * for direct L-to-L and R-to-R routes.
+++++    */
+++++   SOC_SINGLE_TLV("Left Line Mixer Line2R Bypass Volume",
+++++                  LINE2R_2_LLOPM_VOL, 0, 118, 1, output_stage_tlv),
+++++ 
+++++   SOC_SINGLE_TLV("Right Line Mixer Line2L Bypass Volume",
+++++                  LINE2L_2_RLOPM_VOL, 0, 118, 1, output_stage_tlv),
+++++ 
+++++   SOC_SINGLE_TLV("Left HP Mixer Line2R Bypass Volume",
+++++                  LINE2R_2_HPLOUT_VOL, 0, 118, 1, output_stage_tlv),
+++++ 
+++++   SOC_SINGLE_TLV("Right HP Mixer Line2L Bypass Volume",
+++++                  LINE2L_2_HPROUT_VOL, 0, 118, 1, output_stage_tlv),
+++++ 
+++++   SOC_SINGLE_TLV("Left HPCOM Mixer Line2R Bypass Volume",
+++++                  LINE2R_2_HPLCOM_VOL, 0, 118, 1, output_stage_tlv),
+++++ 
+++++   SOC_SINGLE_TLV("Right HPCOM Mixer Line2L Bypass Volume",
+++++                  LINE2L_2_HPRCOM_VOL, 0, 118, 1, output_stage_tlv),
+++++ 
+++++   /* Stereo output controls for direct L-to-L and R-to-R routes */
+++++   SOC_DOUBLE_R_TLV("Line Line2 Bypass Volume",
+++++                    LINE2L_2_LLOPM_VOL, LINE2R_2_RLOPM_VOL,
+++++                    0, 118, 1, output_stage_tlv),
+++++ 
+++++   SOC_DOUBLE_R_TLV("HP Line2 Bypass Volume",
+++++                    LINE2L_2_HPLOUT_VOL, LINE2R_2_HPROUT_VOL,
+++++                    0, 118, 1, output_stage_tlv),
+++++ 
+++++   SOC_DOUBLE_R_TLV("HPCOM Line2 Bypass Volume",
+++++                    LINE2L_2_HPLCOM_VOL, LINE2R_2_HPRCOM_VOL,
+++++                    0, 118, 1, output_stage_tlv),
+++++ };
+++++ 
      static const struct snd_kcontrol_new aic3x_mono_controls[] = {
        SOC_DOUBLE_R_TLV("Mono Line2 Bypass Volume",
                         LINE2L_2_MONOLOPM_VOL, LINE2R_2_MONOLOPM_VOL,
@@@@@@@ -464,22 -464,22 -464,22 -464,22 -464,22 -483,24 +483,24 @@@@@@@ SOC_DAPM_ENUM("Route", aic3x_right_hpco
      
      /* Left Line Mixer */
      static const struct snd_kcontrol_new aic3x_left_line_mixer_controls[] = {
-----   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_LLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAL Bypass Switch", PGAL_2_LLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACL1 Switch", DACL1_2_LLOPM_VOL, 7, 1, 0),
-----   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_LLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAR Bypass Switch", PGAR_2_LLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACR1 Switch", DACR1_2_LLOPM_VOL, 7, 1, 0),
+++++   /* Not on tlv320aic3104 */
+++++   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_LLOPM_VOL, 7, 1, 0),
+++++   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_LLOPM_VOL, 7, 1, 0),
      };
      
      /* Right Line Mixer */
      static const struct snd_kcontrol_new aic3x_right_line_mixer_controls[] = {
-----   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAL Bypass Switch", PGAL_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACL1 Switch", DACL1_2_RLOPM_VOL, 7, 1, 0),
-----   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAR Bypass Switch", PGAR_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACR1 Switch", DACR1_2_RLOPM_VOL, 7, 1, 0),
+++++   /* Not on tlv320aic3104 */
+++++   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_RLOPM_VOL, 7, 1, 0),
+++++   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_RLOPM_VOL, 7, 1, 0),
      };
      
      /* Mono Mixer */
@@@@@@@ -494,42 -494,42 -494,42 -494,42 -494,42 -515,46 +515,46 @@@@@@@ static const struct snd_kcontrol_new ai
      
      /* Left HP Mixer */
      static const struct snd_kcontrol_new aic3x_left_hp_mixer_controls[] = {
-----   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPLOUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAL Bypass Switch", PGAL_2_HPLOUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACL1 Switch", DACL1_2_HPLOUT_VOL, 7, 1, 0),
-----   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPLOUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAR Bypass Switch", PGAR_2_HPLOUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACR1 Switch", DACR1_2_HPLOUT_VOL, 7, 1, 0),
+++++   /* Not on tlv320aic3104 */
+++++   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPLOUT_VOL, 7, 1, 0),
+++++   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPLOUT_VOL, 7, 1, 0),
      };
      
      /* Right HP Mixer */
      static const struct snd_kcontrol_new aic3x_right_hp_mixer_controls[] = {
-----   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPROUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAL Bypass Switch", PGAL_2_HPROUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACL1 Switch", DACL1_2_HPROUT_VOL, 7, 1, 0),
-----   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPROUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAR Bypass Switch", PGAR_2_HPROUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACR1 Switch", DACR1_2_HPROUT_VOL, 7, 1, 0),
+++++   /* Not on tlv320aic3104 */
+++++   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPROUT_VOL, 7, 1, 0),
+++++   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPROUT_VOL, 7, 1, 0),
      };
      
      /* Left HPCOM Mixer */
      static const struct snd_kcontrol_new aic3x_left_hpcom_mixer_controls[] = {
-----   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPLCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAL Bypass Switch", PGAL_2_HPLCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACL1 Switch", DACL1_2_HPLCOM_VOL, 7, 1, 0),
-----   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPLCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAR Bypass Switch", PGAR_2_HPLCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACR1 Switch", DACR1_2_HPLCOM_VOL, 7, 1, 0),
+++++   /* Not on tlv320aic3104 */
+++++   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPLCOM_VOL, 7, 1, 0),
+++++   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPLCOM_VOL, 7, 1, 0),
      };
      
      /* Right HPCOM Mixer */
      static const struct snd_kcontrol_new aic3x_right_hpcom_mixer_controls[] = {
-----   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPRCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAL Bypass Switch", PGAL_2_HPRCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACL1 Switch", DACL1_2_HPRCOM_VOL, 7, 1, 0),
-----   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPRCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("PGAR Bypass Switch", PGAR_2_HPRCOM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("DACR1 Switch", DACR1_2_HPRCOM_VOL, 7, 1, 0),
+++++   /* Not on tlv320aic3104 */
+++++   SOC_DAPM_SINGLE("Line2L Bypass Switch", LINE2L_2_HPRCOM_VOL, 7, 1, 0),
+++++   SOC_DAPM_SINGLE("Line2R Bypass Switch", LINE2R_2_HPRCOM_VOL, 7, 1, 0),
      };
      
      /* Left PGA Mixer */
@@@@@@@ -550,6 -550,6 -550,6 -550,6 -550,6 -575,22 +575,22 @@@@@@@ static const struct snd_kcontrol_new ai
        SOC_DAPM_SINGLE_AIC3X("Mic3R Switch", MIC3LR_2_RADC_CTRL, 0, 1, 1),
      };
      
+++++ /* Left PGA Mixer for tlv320aic3104 */
+++++ static const struct snd_kcontrol_new aic3104_left_pga_mixer_controls[] = {
+++++   SOC_DAPM_SINGLE_AIC3X("Line1L Switch", LINE1L_2_LADC_CTRL, 3, 1, 1),
+++++   SOC_DAPM_SINGLE_AIC3X("Line1R Switch", LINE1R_2_LADC_CTRL, 3, 1, 1),
+++++   SOC_DAPM_SINGLE_AIC3X("Mic2L Switch", MIC3LR_2_LADC_CTRL, 4, 1, 1),
+++++   SOC_DAPM_SINGLE_AIC3X("Mic2R Switch", MIC3LR_2_LADC_CTRL, 0, 1, 1),
+++++ };
+++++ 
+++++ /* Right PGA Mixer for tlv320aic3104 */
+++++ static const struct snd_kcontrol_new aic3104_right_pga_mixer_controls[] = {
+++++   SOC_DAPM_SINGLE_AIC3X("Line1R Switch", LINE1R_2_RADC_CTRL, 3, 1, 1),
+++++   SOC_DAPM_SINGLE_AIC3X("Line1L Switch", LINE1L_2_RADC_CTRL, 3, 1, 1),
+++++   SOC_DAPM_SINGLE_AIC3X("Mic2L Switch", MIC3LR_2_RADC_CTRL, 4, 1, 1),
+++++   SOC_DAPM_SINGLE_AIC3X("Mic2R Switch", MIC3LR_2_RADC_CTRL, 0, 1, 1),
+++++ };
+++++ 
      /* Left Line1 Mux */
      static const struct snd_kcontrol_new aic3x_left_line1l_mux_controls =
      SOC_DAPM_ENUM("Route", aic3x_line1l_2_l_enum);
@@@@@@@ -593,26 -593,26 -593,26 -593,26 -593,26 -634,56 +634,56 @@@@@@@ static const struct snd_soc_dapm_widge
      
        /* Inputs to Left ADC */
        SND_SOC_DAPM_ADC("Left ADC", "Left Capture", LINE1L_2_LADC_CTRL, 2, 0),
-----   SND_SOC_DAPM_MIXER("Left PGA Mixer", SND_SOC_NOPM, 0, 0,
-----                      &aic3x_left_pga_mixer_controls[0],
-----                      ARRAY_SIZE(aic3x_left_pga_mixer_controls)),
        SND_SOC_DAPM_MUX("Left Line1L Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_left_line1l_mux_controls),
        SND_SOC_DAPM_MUX("Left Line1R Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_left_line1r_mux_controls),
-----   SND_SOC_DAPM_MUX("Left Line2L Mux", SND_SOC_NOPM, 0, 0,
-----                    &aic3x_left_line2_mux_controls),
      
        /* Inputs to Right ADC */
        SND_SOC_DAPM_ADC("Right ADC", "Right Capture",
                         LINE1R_2_RADC_CTRL, 2, 0),
-----   SND_SOC_DAPM_MIXER("Right PGA Mixer", SND_SOC_NOPM, 0, 0,
-----                      &aic3x_right_pga_mixer_controls[0],
-----                      ARRAY_SIZE(aic3x_right_pga_mixer_controls)),
        SND_SOC_DAPM_MUX("Right Line1L Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_right_line1l_mux_controls),
        SND_SOC_DAPM_MUX("Right Line1R Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_right_line1r_mux_controls),
+++++ 
+++++   /* Mic Bias */
+++++   SND_SOC_DAPM_SUPPLY("Mic Bias", MICBIAS_CTRL, 6, 0,
+++++                    mic_bias_event,
+++++                    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+++++ 
+++++   SND_SOC_DAPM_OUTPUT("LLOUT"),
+++++   SND_SOC_DAPM_OUTPUT("RLOUT"),
+++++   SND_SOC_DAPM_OUTPUT("HPLOUT"),
+++++   SND_SOC_DAPM_OUTPUT("HPROUT"),
+++++   SND_SOC_DAPM_OUTPUT("HPLCOM"),
+++++   SND_SOC_DAPM_OUTPUT("HPRCOM"),
+++++ 
+++++   SND_SOC_DAPM_INPUT("LINE1L"),
+++++   SND_SOC_DAPM_INPUT("LINE1R"),
+++++ 
+++++   /*
+++++    * Virtual output pin to detection block inside codec. This can be
+++++    * used to keep codec bias on if gpio or detection features are needed.
+++++    * Force pin on or construct a path with an input jack and mic bias
+++++    * widgets.
+++++    */
+++++   SND_SOC_DAPM_OUTPUT("Detection"),
+++++ };
+++++ 
+++++ /* For other than tlv320aic3104 */
+++++ static const struct snd_soc_dapm_widget aic3x_extra_dapm_widgets[] = {
+++++   /* Inputs to Left ADC */
+++++   SND_SOC_DAPM_MIXER("Left PGA Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_left_pga_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_left_pga_mixer_controls)),
+++++   SND_SOC_DAPM_MUX("Left Line2L Mux", SND_SOC_NOPM, 0, 0,
+++++                    &aic3x_left_line2_mux_controls),
+++++ 
+++++   /* Inputs to Right ADC */
+++++   SND_SOC_DAPM_MIXER("Right PGA Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_right_pga_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_right_pga_mixer_controls)),
        SND_SOC_DAPM_MUX("Right Line2R Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_right_line2_mux_controls),
      
        SND_SOC_DAPM_REG(snd_soc_dapm_micbias, "DMic Rate 32",
                         AIC3X_ASD_INTF_CTRLA, 0, 3, 3, 0),
      
-----   /* Mic Bias */
-----   SND_SOC_DAPM_SUPPLY("Mic Bias", MICBIAS_CTRL, 6, 0,
-----                    mic_bias_event,
-----                    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
----- 
        /* Output mixers */
        SND_SOC_DAPM_MIXER("Left Line Mixer", SND_SOC_NOPM, 0, 0,
                           &aic3x_left_line_mixer_controls[0],
                           &aic3x_right_hpcom_mixer_controls[0],
                           ARRAY_SIZE(aic3x_right_hpcom_mixer_controls)),
      
-----   SND_SOC_DAPM_OUTPUT("LLOUT"),
-----   SND_SOC_DAPM_OUTPUT("RLOUT"),
-----   SND_SOC_DAPM_OUTPUT("HPLOUT"),
-----   SND_SOC_DAPM_OUTPUT("HPROUT"),
-----   SND_SOC_DAPM_OUTPUT("HPLCOM"),
-----   SND_SOC_DAPM_OUTPUT("HPRCOM"),
----- 
        SND_SOC_DAPM_INPUT("MIC3L"),
        SND_SOC_DAPM_INPUT("MIC3R"),
-----   SND_SOC_DAPM_INPUT("LINE1L"),
-----   SND_SOC_DAPM_INPUT("LINE1R"),
        SND_SOC_DAPM_INPUT("LINE2L"),
        SND_SOC_DAPM_INPUT("LINE2R"),
+++++ };
      
-----   /*
-----    * Virtual output pin to detection block inside codec. This can be
-----    * used to keep codec bias on if gpio or detection features are needed.
-----    * Force pin on or construct a path with an input jack and mic bias
-----    * widgets.
-----    */
-----   SND_SOC_DAPM_OUTPUT("Detection"),
+++++ /* For tlv320aic3104 */
+++++ static const struct snd_soc_dapm_widget aic3104_extra_dapm_widgets[] = {
+++++   /* Inputs to Left ADC */
+++++   SND_SOC_DAPM_MIXER("Left PGA Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3104_left_pga_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3104_left_pga_mixer_controls)),
+++++ 
+++++   /* Inputs to Right ADC */
+++++   SND_SOC_DAPM_MIXER("Right PGA Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3104_right_pga_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3104_right_pga_mixer_controls)),
+++++ 
+++++   /* Output mixers */
+++++   SND_SOC_DAPM_MIXER("Left Line Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_left_line_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_left_line_mixer_controls) - 2),
+++++   SND_SOC_DAPM_MIXER("Right Line Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_right_line_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_right_line_mixer_controls) - 2),
+++++   SND_SOC_DAPM_MIXER("Left HP Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_left_hp_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_left_hp_mixer_controls) - 2),
+++++   SND_SOC_DAPM_MIXER("Right HP Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_right_hp_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_right_hp_mixer_controls) - 2),
+++++   SND_SOC_DAPM_MIXER("Left HPCOM Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_left_hpcom_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_left_hpcom_mixer_controls) - 2),
+++++   SND_SOC_DAPM_MIXER("Right HPCOM Mixer", SND_SOC_NOPM, 0, 0,
+++++                      &aic3x_right_hpcom_mixer_controls[0],
+++++                      ARRAY_SIZE(aic3x_right_hpcom_mixer_controls) - 2),
+++++ 
+++++   SND_SOC_DAPM_INPUT("MIC2L"),
+++++   SND_SOC_DAPM_INPUT("MIC2R"),
      };
      
      static const struct snd_soc_dapm_widget aic3x_dapm_mono_widgets[] = {
@@@@@@@ -712,17 -712,17 -712,17 -712,17 -712,17 -797,10 +797,10 @@@@@@@ static const struct snd_soc_dapm_route 
        {"Left Line1R Mux", "single-ended", "LINE1R"},
        {"Left Line1R Mux", "differential", "LINE1R"},
      
-----   {"Left Line2L Mux", "single-ended", "LINE2L"},
-----   {"Left Line2L Mux", "differential", "LINE2L"},
----- 
        {"Left PGA Mixer", "Line1L Switch", "Left Line1L Mux"},
        {"Left PGA Mixer", "Line1R Switch", "Left Line1R Mux"},
-----   {"Left PGA Mixer", "Line2L Switch", "Left Line2L Mux"},
-----   {"Left PGA Mixer", "Mic3L Switch", "MIC3L"},
-----   {"Left PGA Mixer", "Mic3R Switch", "MIC3R"},
      
        {"Left ADC", NULL, "Left PGA Mixer"},
-----   {"Left ADC", NULL, "GPIO1 dmic modclk"},
      
        /* Right Input */
        {"Right Line1R Mux", "single-ended", "LINE1R"},
        {"Right Line1L Mux", "single-ended", "LINE1L"},
        {"Right Line1L Mux", "differential", "LINE1L"},
      
-----   {"Right Line2R Mux", "single-ended", "LINE2R"},
-----   {"Right Line2R Mux", "differential", "LINE2R"},
----- 
        {"Right PGA Mixer", "Line1L Switch", "Right Line1L Mux"},
        {"Right PGA Mixer", "Line1R Switch", "Right Line1R Mux"},
-----   {"Right PGA Mixer", "Line2R Switch", "Right Line2R Mux"},
-----   {"Right PGA Mixer", "Mic3L Switch", "MIC3L"},
-----   {"Right PGA Mixer", "Mic3R Switch", "MIC3R"},
      
        {"Right ADC", NULL, "Right PGA Mixer"},
-----   {"Right ADC", NULL, "GPIO1 dmic modclk"},
----- 
-----   /*
-----    * Logical path between digital mic enable and GPIO1 modulator clock
-----    * output function
-----    */
-----   {"GPIO1 dmic modclk", NULL, "DMic Rate 128"},
-----   {"GPIO1 dmic modclk", NULL, "DMic Rate 64"},
-----   {"GPIO1 dmic modclk", NULL, "DMic Rate 32"},
      
        /* Left DAC Output */
        {"Left DAC Mux", "DAC_L1", "Left DAC"},
        {"Right DAC Mux", "DAC_R3", "Right DAC"},
      
        /* Left Line Output */
-----   {"Left Line Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
        {"Left Line Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
        {"Left Line Mixer", "DACL1 Switch", "Left DAC Mux"},
-----   {"Left Line Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
        {"Left Line Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
        {"Left Line Mixer", "DACR1 Switch", "Right DAC Mux"},
      
        {"LLOUT", NULL, "Left Line Out"},
      
        /* Right Line Output */
-----   {"Right Line Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
        {"Right Line Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
        {"Right Line Mixer", "DACL1 Switch", "Left DAC Mux"},
-----   {"Right Line Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
        {"Right Line Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
        {"Right Line Mixer", "DACR1 Switch", "Right DAC Mux"},
      
        {"RLOUT", NULL, "Right Line Out"},
      
        /* Left HP Output */
-----   {"Left HP Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
        {"Left HP Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
        {"Left HP Mixer", "DACL1 Switch", "Left DAC Mux"},
-----   {"Left HP Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
        {"Left HP Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
        {"Left HP Mixer", "DACR1 Switch", "Right DAC Mux"},
      
        {"HPLOUT", NULL, "Left HP Out"},
      
        /* Right HP Output */
-----   {"Right HP Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
        {"Right HP Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
        {"Right HP Mixer", "DACL1 Switch", "Left DAC Mux"},
-----   {"Right HP Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
        {"Right HP Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
        {"Right HP Mixer", "DACR1 Switch", "Right DAC Mux"},
      
        {"HPROUT", NULL, "Right HP Out"},
      
        /* Left HPCOM Output */
-----   {"Left HPCOM Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
        {"Left HPCOM Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
        {"Left HPCOM Mixer", "DACL1 Switch", "Left DAC Mux"},
-----   {"Left HPCOM Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
        {"Left HPCOM Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
        {"Left HPCOM Mixer", "DACR1 Switch", "Right DAC Mux"},
      
        {"HPLCOM", NULL, "Left HP Com"},
      
        /* Right HPCOM Output */
-----   {"Right HPCOM Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
        {"Right HPCOM Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
        {"Right HPCOM Mixer", "DACL1 Switch", "Left DAC Mux"},
-----   {"Right HPCOM Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
        {"Right HPCOM Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
        {"Right HPCOM Mixer", "DACR1 Switch", "Right DAC Mux"},
      
        {"HPRCOM", NULL, "Right HP Com"},
      };
      
+++++ /* For other than tlv320aic3104 */
+++++ static const struct snd_soc_dapm_route intercon_extra[] = {
+++++   /* Left Input */
+++++   {"Left Line2L Mux", "single-ended", "LINE2L"},
+++++   {"Left Line2L Mux", "differential", "LINE2L"},
+++++ 
+++++   {"Left PGA Mixer", "Line2L Switch", "Left Line2L Mux"},
+++++   {"Left PGA Mixer", "Mic3L Switch", "MIC3L"},
+++++   {"Left PGA Mixer", "Mic3R Switch", "MIC3R"},
+++++ 
+++++   {"Left ADC", NULL, "GPIO1 dmic modclk"},
+++++ 
+++++   /* Right Input */
+++++   {"Right Line2R Mux", "single-ended", "LINE2R"},
+++++   {"Right Line2R Mux", "differential", "LINE2R"},
+++++ 
+++++   {"Right PGA Mixer", "Line2R Switch", "Right Line2R Mux"},
+++++   {"Right PGA Mixer", "Mic3L Switch", "MIC3L"},
+++++   {"Right PGA Mixer", "Mic3R Switch", "MIC3R"},
+++++ 
+++++   {"Right ADC", NULL, "GPIO1 dmic modclk"},
+++++ 
+++++   /*
+++++    * Logical path between digital mic enable and GPIO1 modulator clock
+++++    * output function
+++++    */
+++++   {"GPIO1 dmic modclk", NULL, "DMic Rate 128"},
+++++   {"GPIO1 dmic modclk", NULL, "DMic Rate 64"},
+++++   {"GPIO1 dmic modclk", NULL, "DMic Rate 32"},
+++++ 
+++++   /* Left Line Output */
+++++   {"Left Line Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
+++++   {"Left Line Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
+++++ 
+++++   /* Right Line Output */
+++++   {"Right Line Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
+++++   {"Right Line Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
+++++ 
+++++   /* Left HP Output */
+++++   {"Left HP Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
+++++   {"Left HP Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
+++++ 
+++++   /* Right HP Output */
+++++   {"Right HP Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
+++++   {"Right HP Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
+++++ 
+++++   /* Left HPCOM Output */
+++++   {"Left HPCOM Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
+++++   {"Left HPCOM Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
+++++ 
+++++   /* Right HPCOM Output */
+++++   {"Right HPCOM Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
+++++   {"Right HPCOM Mixer", "Line2R Bypass Switch", "Right Line2R Mux"},
+++++ };
+++++ 
+++++ /* For tlv320aic3104 */
+++++ static const struct snd_soc_dapm_route intercon_extra_3104[] = {
+++++   /* Left Input */
+++++   {"Left PGA Mixer", "Mic2L Switch", "MIC2L"},
+++++   {"Left PGA Mixer", "Mic2R Switch", "MIC2R"},
+++++ 
+++++   /* Right Input */
+++++   {"Right PGA Mixer", "Mic2L Switch", "MIC2L"},
+++++   {"Right PGA Mixer", "Mic2R Switch", "MIC2R"},
+++++ };
+++++ 
      static const struct snd_soc_dapm_route intercon_mono[] = {
        /* Mono Output */
        {"Mono Mixer", "Line2L Bypass Switch", "Left Line2L Mux"},
@@@@@@@ -867,17 -867,17 -867,17 -867,17 -867,17 -984,31 +984,31 @@@@@@@ static int aic3x_add_widgets(struct snd
        switch (aic3x->model) {
        case AIC3X_MODEL_3X:
        case AIC3X_MODEL_33:
+++++           snd_soc_dapm_new_controls(dapm, aic3x_extra_dapm_widgets,
+++++                                     ARRAY_SIZE(aic3x_extra_dapm_widgets));
+++++           snd_soc_dapm_add_routes(dapm, intercon_extra,
+++++                                   ARRAY_SIZE(intercon_extra));
                snd_soc_dapm_new_controls(dapm, aic3x_dapm_mono_widgets,
                        ARRAY_SIZE(aic3x_dapm_mono_widgets));
                snd_soc_dapm_add_routes(dapm, intercon_mono,
                                        ARRAY_SIZE(intercon_mono));
                break;
        case AIC3X_MODEL_3007:
+++++           snd_soc_dapm_new_controls(dapm, aic3x_extra_dapm_widgets,
+++++                                     ARRAY_SIZE(aic3x_extra_dapm_widgets));
+++++           snd_soc_dapm_add_routes(dapm, intercon_extra,
+++++                                   ARRAY_SIZE(intercon_extra));
                snd_soc_dapm_new_controls(dapm, aic3007_dapm_widgets,
                        ARRAY_SIZE(aic3007_dapm_widgets));
                snd_soc_dapm_add_routes(dapm, intercon_3007,
                                        ARRAY_SIZE(intercon_3007));
                break;
+++++   case AIC3X_MODEL_3104:
+++++           snd_soc_dapm_new_controls(dapm, aic3104_extra_dapm_widgets,
+++++                           ARRAY_SIZE(aic3104_extra_dapm_widgets));
+++++           snd_soc_dapm_add_routes(dapm, intercon_extra_3104,
+++++                           ARRAY_SIZE(intercon_extra_3104));
+++++           break;
        }
      
        return 0;
@@@@@@@ -1046,7 -1046,7 -1046,7 -1046,7 -1046,7 -1177,7 +1177,7 @@@@@@@ static int aic3x_prepare(struct snd_pcm
                delay += aic3x->tdm_delay;
      
        /* Configure data delay */
 -----  snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, aic3x->tdm_delay);
 +++++  snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, delay);
      
        return 0;
      }
@@@@@@@ -1438,23 -1438,23 -1438,23 -1438,23 -1438,23 -1569,33 +1569,33 @@@@@@@ static int aic3x_probe(struct snd_soc_c
        aic3x_init(codec);
      
        if (aic3x->setup) {
-----           /* setup GPIO functions */
-----           snd_soc_write(codec, AIC3X_GPIO1_REG,
-----                         (aic3x->setup->gpio_func[0] & 0xf) << 4);
-----           snd_soc_write(codec, AIC3X_GPIO2_REG,
-----                         (aic3x->setup->gpio_func[1] & 0xf) << 4);
+++++           if (aic3x->model != AIC3X_MODEL_3104) {
+++++                   /* setup GPIO functions */
+++++                   snd_soc_write(codec, AIC3X_GPIO1_REG,
+++++                                 (aic3x->setup->gpio_func[0] & 0xf) << 4);
+++++                   snd_soc_write(codec, AIC3X_GPIO2_REG,
+++++                                 (aic3x->setup->gpio_func[1] & 0xf) << 4);
+++++           } else {
+++++                   dev_warn(codec->dev, "GPIO functionality is not supported on tlv320aic3104\n");
+++++           }
        }
      
        switch (aic3x->model) {
        case AIC3X_MODEL_3X:
        case AIC3X_MODEL_33:
+++++           snd_soc_add_codec_controls(codec, aic3x_extra_snd_controls,
+++++                           ARRAY_SIZE(aic3x_extra_snd_controls));
                snd_soc_add_codec_controls(codec, aic3x_mono_controls,
                                ARRAY_SIZE(aic3x_mono_controls));
                break;
        case AIC3X_MODEL_3007:
+++++           snd_soc_add_codec_controls(codec, aic3x_extra_snd_controls,
+++++                           ARRAY_SIZE(aic3x_extra_snd_controls));
                snd_soc_add_codec_controls(codec,
                                &aic3x_classd_amp_gain_ctrl, 1);
                break;
+++++   case AIC3X_MODEL_3104:
+++++           break;
        }
      
        /* set mic bias voltage */
@@@@@@@ -1522,6 -1522,6 -1522,6 -1522,6 -1522,6 -1663,7 +1663,7 @@@@@@@ static const struct i2c_device_id aic3x
        { "tlv320aic33", AIC3X_MODEL_33 },
        { "tlv320aic3007", AIC3X_MODEL_3007 },
        { "tlv320aic3106", AIC3X_MODEL_3X },
+++++   { "tlv320aic3104", AIC3X_MODEL_3104 },
        { }
      };
      MODULE_DEVICE_TABLE(i2c, aic3x_i2c_id);
@@@@@@@ -1673,6 -1673,6 -1673,6 -1673,6 -1673,6 -1815,7 +1815,7 @@@@@@@ static const struct of_device_id tlv320
        { .compatible = "ti,tlv320aic33" },
        { .compatible = "ti,tlv320aic3007" },
        { .compatible = "ti,tlv320aic3106" },
+++++   { .compatible = "ti,tlv320aic3104" },
        {},
      };
      MODULE_DEVICE_TABLE(of, tlv320aic3x_of_match);
@@@@@@@ -42,6 -42,25 -42,25 -42,25 -42,25 -42,25 +42,6 @@@@@@@ static int eukrea_tlv320_hw_params(stru
        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
        int ret;
      
 -----  ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
 -----                            SND_SOC_DAIFMT_NB_NF |
 -----                            SND_SOC_DAIFMT_CBM_CFM);
 -----  /* fsl_ssi lacks the set_fmt ops. */
 -----  if (ret && ret != -ENOTSUPP) {
 -----          dev_err(cpu_dai->dev,
 -----                  "Failed to set the cpu dai format.\n");
 -----          return ret;
 -----  }
 -----
 -----  ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
 -----                            SND_SOC_DAIFMT_NB_NF |
 -----                            SND_SOC_DAIFMT_CBM_CFM);
 -----  if (ret) {
 -----          dev_err(cpu_dai->dev,
 -----                  "Failed to set the codec format.\n");
 -----          return ret;
 -----  }
 -----
        ret = snd_soc_dai_set_sysclk(codec_dai, 0,
                                     CODEC_CLOCK, SND_SOC_CLOCK_OUT);
        if (ret) {
                return ret;
        }
      
--- --  snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffc, 0xffffffc, 2, 0);
+++ ++  snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 0);
      
        ret = snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0,
                                SND_SOC_CLOCK_IN);
@@@@@@@ -72,8 -91,6 -91,6 -91,6 -91,6 -91,6 +72,8 @@@@@@@ static struct snd_soc_dai_link eukrea_t
        .name           = "tlv320aic23",
        .stream_name    = "TLV320AIC23",
        .codec_dai_name = "tlv320aic23-hifi",
 +++++  .dai_fmt        = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 +++++                    SND_SOC_DAIFMT_CBM_CFM,
        .ops            = &eukrea_tlv320_snd_ops,
      };
      
diff --combined sound/soc/fsl/fsl_ssi.c
@@@@@@@ -160,7 -160,7 -160,7 -160,7 -160,7 -160,7 +160,7 @@@@@@@ struct fsl_ssi_soc_data 
       */
      struct fsl_ssi_private {
        struct regmap *regs;
 -----  unsigned int irq;
 +++++  int irq;
        struct snd_soc_dai_driver cpu_dai_drv;
      
        unsigned int dai_fmt;
@@@@@@@ -992,8 -992,8 -992,8 -992,8 -992,8 -992,8 +992,8 @@@@@@@ static int fsl_ssi_set_dai_tdm_slot(str
        regmap_update_bits(regs, CCSR_SSI_SCR, CCSR_SSI_SCR_SSIEN,
                        CCSR_SSI_SCR_SSIEN);
      
--- --  regmap_write(regs, CCSR_SSI_STMSK, tx_mask);
--- --  regmap_write(regs, CCSR_SSI_SRMSK, rx_mask);
+++ ++  regmap_write(regs, CCSR_SSI_STMSK, ~tx_mask);
+++ ++  regmap_write(regs, CCSR_SSI_SRMSK, ~rx_mask);
      
        regmap_update_bits(regs, CCSR_SSI_SCR, CCSR_SSI_SCR_SSIEN, val);
      
@@@@@@@ -1363,8 -1363,8 -1363,8 -1363,8 -1363,8 -1363,8 +1363,8 @@@@@@@ static int fsl_ssi_probe(struct platfor
      
        ssi_private->irq = platform_get_irq(pdev, 0);
        if (!ssi_private->irq) {
 -----          dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
 -----          return -ENXIO;
 +++++          dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
 +++++          return ssi_private->irq;
        }
      
        /* Are the RX and the TX clocks locked? */
@@@@@@@ -87,6 -87,7 -87,7 -87,7 -87,7 -87,7 +87,6 @@@@@@@ static int wm1133_ev1_hw_params(struct 
        snd_pcm_format_t format = params_format(params);
        unsigned int rate = params_rate(params);
        unsigned int channels = params_channels(params);
 -----  u32 dai_format;
      
        /* find the correct audio parameters */
        for (i = 0; i < ARRAY_SIZE(wm8350_audio); i++) {
        /* codec FLL input is 14.75 MHz from MCLK */
        snd_soc_dai_set_pll(codec_dai, 0, 0, 14750000, wm8350_audio[i].sysclk);
      
 -----  dai_format = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 -----          SND_SOC_DAIFMT_CBM_CFM;
 -----
 -----  /* set codec DAI configuration */
 -----  snd_soc_dai_set_fmt(codec_dai, dai_format);
 -----
 -----  /* set cpu DAI configuration */
 -----  snd_soc_dai_set_fmt(cpu_dai, dai_format);
 -----
        /* TODO: The SSI driver should figure this out for us */
        switch (channels) {
        case 2:
--- --          snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffc, 0xffffffc, 2, 0);
+++ ++          snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 0);
                break;
        case 1:
--- --          snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffe, 0xffffffe, 1, 0);
+++ ++          snd_soc_dai_set_tdm_slot(cpu_dai, 0x1, 0x1, 1, 0);
                break;
        default:
                return -EINVAL;
@@@@@@@ -234,8 -244,6 -244,6 -244,6 -244,6 -244,6 +234,8 @@@@@@@ static struct snd_soc_dai_link wm1133_e
        .init = wm1133_ev1_init,
        .ops = &wm1133_ev1_ops,
        .symmetric_rates = 1,
 +++++  .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 +++++             SND_SOC_DAIFMT_CBM_CFM,
      };
      
      static struct snd_soc_card wm1133_ev1 = {
@@@@@@@ -39,6 -39,37 -39,6 -39,6 -39,6 -39,6 +39,37 @@@@@@@ struct simple_card_data 
      #define simple_priv_to_link(priv, i) ((priv)->snd_card.dai_link + i)
      #define simple_priv_to_props(priv, i) ((priv)->dai_props + i)
      
+ ++++static int asoc_simple_card_startup(struct snd_pcm_substream *substream)
+ ++++{
+ ++++  struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ ++++  struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
+ ++++  struct simple_dai_props *dai_props =
+ ++++          &priv->dai_props[rtd - rtd->card->rtd];
+ ++++  int ret;
+ ++++
+ ++++  ret = clk_prepare_enable(dai_props->cpu_dai.clk);
+ ++++  if (ret)
+ ++++          return ret;
+ ++++  
+ ++++  ret = clk_prepare_enable(dai_props->codec_dai.clk);
+ ++++  if (ret)
+ ++++          clk_disable_unprepare(dai_props->cpu_dai.clk);
+ ++++
+ ++++  return ret;
+ ++++}
+ ++++
+ ++++static void asoc_simple_card_shutdown(struct snd_pcm_substream *substream)
+ ++++{
+ ++++  struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ ++++  struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
+ ++++  struct simple_dai_props *dai_props =
+ ++++          &priv->dai_props[rtd - rtd->card->rtd];
+ ++++
+ ++++  clk_disable_unprepare(dai_props->cpu_dai.clk);
+ ++++
+ ++++  clk_disable_unprepare(dai_props->codec_dai.clk);
+ ++++}
+ ++++
      static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream,
                                      struct snd_pcm_hw_params *params)
      {
      }
      
      static struct snd_soc_ops asoc_simple_card_ops = {
+ ++++  .startup = asoc_simple_card_startup,
+ ++++  .shutdown = asoc_simple_card_shutdown,
        .hw_params = asoc_simple_card_hw_params,
      };
      
@@@@@@@ -219,6 -252,7 -219,6 -219,6 -219,6 -219,6 +252,7 @@@@@@@ asoc_simple_card_sub_parse_of(struct de
                }
      
                dai->sysclk = clk_get_rate(clk);
+ ++++          dai->clk = clk;
        } else if (!of_property_read_u32(np, "system-clock-frequency", &val)) {
                dai->sysclk = val;
        } else {
@@@@@@@ -452,8 -486,9 -452,9 -452,9 -452,9 -452,9 +486,8 @@@@@@@ static int asoc_simple_card_parse_of(st
      }
      
      /* Decrease the reference count of the device nodes */
 -----static int asoc_simple_card_unref(struct platform_device *pdev)
 +++++static int asoc_simple_card_unref(struct snd_soc_card *card)
      {
 -----  struct snd_soc_card *card = platform_get_drvdata(pdev);
        struct snd_soc_dai_link *dai_link;
        int num_links;
      
@@@@@@@ -555,7 -590,7 -556,7 -556,7 -556,7 -556,7 +589,7 @@@@@@@ static int asoc_simple_card_probe(struc
                return ret;
      
      err:
 -----  asoc_simple_card_unref(pdev);
 +++++  asoc_simple_card_unref(&priv->snd_card);
        return ret;
      }
      
@@@@@@@ -571,7 -606,7 -572,7 -572,7 -572,7 -572,7 +605,7 @@@@@@@ static int asoc_simple_card_remove(stru
                snd_soc_jack_free_gpios(&simple_card_mic_jack, 1,
                                        &simple_card_mic_jack_gpio);
      
 -----  return asoc_simple_card_unref(pdev);
 +++++  return asoc_simple_card_unref(card);
      }
      
      static const struct of_device_id asoc_simple_of_match[] = {
diff --combined sound/soc/soc-core.c
@@@@@@@ -191,39 -191,6 -191,6 -191,6 -191,6 -191,6 +191,39 @@@@@@@ static ssize_t pmdown_time_set(struct d
      
      static DEVICE_ATTR(pmdown_time, 0644, pmdown_time_show, pmdown_time_set);
      
 +++++static struct attribute *soc_dev_attrs[] = {
 +++++  &dev_attr_codec_reg.attr,
 +++++  &dev_attr_pmdown_time.attr,
 +++++  NULL
 +++++};
 +++++
 +++++static umode_t soc_dev_attr_is_visible(struct kobject *kobj,
 +++++                                 struct attribute *attr, int idx)
 +++++{
 +++++  struct device *dev = kobj_to_dev(kobj);
 +++++  struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev);
 +++++
 +++++  if (attr == &dev_attr_pmdown_time.attr)
 +++++          return attr->mode; /* always visible */
 +++++  return rtd->codec ? attr->mode : 0; /* enabled only with codec */
 +++++}
 +++++
 +++++static const struct attribute_group soc_dapm_dev_group = {
 +++++  .attrs = soc_dapm_dev_attrs,
 +++++  .is_visible = soc_dev_attr_is_visible,
 +++++};
 +++++
 +++++static const struct attribute_group soc_dev_roup = {
 +++++  .attrs = soc_dev_attrs,
 +++++  .is_visible = soc_dev_attr_is_visible,
 +++++};
 +++++
 +++++static const struct attribute_group *soc_dev_attr_groups[] = {
 +++++  &soc_dapm_dev_group,
 +++++  &soc_dev_roup,
 +++++  NULL
 +++++};
 +++++
      #ifdef CONFIG_DEBUG_FS
      static ssize_t codec_reg_read_file(struct file *file, char __user *user_buf,
                                   size_t count, loff_t *ppos)
@@@@@@@ -982,6 -949,8 -949,8 -949,8 -949,8 -949,8 +982,6 @@@@@@@ static void soc_remove_link_dais(struc
      
        /* unregister the rtd device */
        if (rtd->dev_registered) {
 -----          device_remove_file(rtd->dev, &dev_attr_pmdown_time);
 -----          device_remove_file(rtd->dev, &dev_attr_codec_reg);
                device_unregister(rtd->dev);
                rtd->dev_registered = 0;
        }
@@@@@@@ -1151,7 -1120,6 -1120,6 -1120,6 -1120,6 -1120,6 +1151,7 @@@@@@@ static int soc_post_component_init(stru
        device_initialize(rtd->dev);
        rtd->dev->parent = rtd->card->dev;
        rtd->dev->release = rtd_release;
 +++++  rtd->dev->groups = soc_dev_attr_groups;
        dev_set_name(rtd->dev, "%s", name);
        dev_set_drvdata(rtd->dev, rtd);
        mutex_init(&rtd->pcm_mutex);
                return ret;
        }
        rtd->dev_registered = 1;
 -----
 -----  if (rtd->codec) {
 -----          /* add DAPM sysfs entries for this codec */
 -----          ret = snd_soc_dapm_sys_add(rtd->dev);
 -----          if (ret < 0)
 -----                  dev_err(rtd->dev,
 -----                          "ASoC: failed to add codec dapm sysfs entries: %d\n",
 -----                          ret);
 -----
 -----          /* add codec sysfs entries */
 -----          ret = device_create_file(rtd->dev, &dev_attr_codec_reg);
 -----          if (ret < 0)
 -----                  dev_err(rtd->dev,
 -----                          "ASoC: failed to add codec sysfs files: %d\n",
 -----                          ret);
 -----  }
 -----
        return 0;
      }
      
@@@@@@@ -1323,6 -1308,11 -1308,11 -1308,11 -1308,11 -1308,11 +1323,6 @@@@@@@ static int soc_probe_link_dais(struct s
        }
      #endif
      
 -----  ret = device_create_file(rtd->dev, &dev_attr_pmdown_time);
 -----  if (ret < 0)
 -----          dev_warn(rtd->dev, "ASoC: failed to add pmdown_time sysfs: %d\n",
 -----                  ret);
 -----
        if (cpu_dai->driver->compress_dai) {
                /*create compress_device"*/
                ret = soc_new_compress(rtd, num);
@@@@@@@ -1437,76 -1427,11 -1427,11 -1427,11 -1427,11 -1427,11 +1437,76 @@@@@@@ static int snd_soc_init_codec_cache(str
        return 0;
      }
      
 +++++/**
 +++++ * snd_soc_runtime_set_dai_fmt() - Change DAI link format for a ASoC runtime
 +++++ * @rtd: The runtime for which the DAI link format should be changed
 +++++ * @dai_fmt: The new DAI link format
 +++++ *
 +++++ * This function updates the DAI link format for all DAIs connected to the DAI
 +++++ * link for the specified runtime.
 +++++ *
 +++++ * Note: For setups with a static format set the dai_fmt field in the
 +++++ * corresponding snd_dai_link struct instead of using this function.
 +++++ *
 +++++ * Returns 0 on success, otherwise a negative error code.
 +++++ */
 +++++int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
 +++++  unsigned int dai_fmt)
 +++++{
 +++++  struct snd_soc_dai **codec_dais = rtd->codec_dais;
 +++++  struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 +++++  unsigned int i;
 +++++  int ret;
 +++++
 +++++  for (i = 0; i < rtd->num_codecs; i++) {
 +++++          struct snd_soc_dai *codec_dai = codec_dais[i];
 +++++
 +++++          ret = snd_soc_dai_set_fmt(codec_dai, dai_fmt);
 +++++          if (ret != 0 && ret != -ENOTSUPP) {
 +++++                  dev_warn(codec_dai->dev,
 +++++                           "ASoC: Failed to set DAI format: %d\n", ret);
 +++++                  return ret;
 +++++          }
 +++++  }
 +++++
 +++++  /* Flip the polarity for the "CPU" end of a CODEC<->CODEC link */
 +++++  if (cpu_dai->codec) {
 +++++          unsigned int inv_dai_fmt;
 +++++
 +++++          inv_dai_fmt = dai_fmt & ~SND_SOC_DAIFMT_MASTER_MASK;
 +++++          switch (dai_fmt & SND_SOC_DAIFMT_MASTER_MASK) {
 +++++          case SND_SOC_DAIFMT_CBM_CFM:
 +++++                  inv_dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
 +++++                  break;
 +++++          case SND_SOC_DAIFMT_CBM_CFS:
 +++++                  inv_dai_fmt |= SND_SOC_DAIFMT_CBS_CFM;
 +++++                  break;
 +++++          case SND_SOC_DAIFMT_CBS_CFM:
 +++++                  inv_dai_fmt |= SND_SOC_DAIFMT_CBM_CFS;
 +++++                  break;
 +++++          case SND_SOC_DAIFMT_CBS_CFS:
 +++++                  inv_dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
 +++++                  break;
 +++++          }
 +++++
 +++++          dai_fmt = inv_dai_fmt;
 +++++  }
 +++++
 +++++  ret = snd_soc_dai_set_fmt(cpu_dai, dai_fmt);
 +++++  if (ret != 0 && ret != -ENOTSUPP) {
 +++++          dev_warn(cpu_dai->dev,
 +++++                   "ASoC: Failed to set DAI format: %d\n", ret);
 +++++          return ret;
 +++++  }
 +++++
 +++++  return 0;
 +++++}
 +++++EXPORT_SYMBOL_GPL(snd_soc_runtime_set_dai_fmt);
 +++++
      static int snd_soc_instantiate_card(struct snd_soc_card *card)
      {
        struct snd_soc_codec *codec;
 -----  struct snd_soc_dai_link *dai_link;
 -----  int ret, i, order, dai_fmt;
 +++++  int ret, i, order;
      
        mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_INIT);
      
                                        card->num_dapm_routes);
      
        for (i = 0; i < card->num_links; i++) {
 -----          struct snd_soc_pcm_runtime *rtd = &card->rtd[i];
 -----          dai_link = &card->dai_link[i];
 -----          dai_fmt = dai_link->dai_fmt;
 -----
 -----          if (dai_fmt) {
 -----                  struct snd_soc_dai **codec_dais = rtd->codec_dais;
 -----                  int j;
 -----
 -----                  for (j = 0; j < rtd->num_codecs; j++) {
 -----                          struct snd_soc_dai *codec_dai = codec_dais[j];
 -----
 -----                          ret = snd_soc_dai_set_fmt(codec_dai, dai_fmt);
 -----                          if (ret != 0 && ret != -ENOTSUPP)
 -----                                  dev_warn(codec_dai->dev,
 -----                                           "ASoC: Failed to set DAI format: %d\n",
 -----                                           ret);
 -----                  }
 -----          }
 -----
 -----          /* If this is a regular CPU link there will be a platform */
 -----          if (dai_fmt &&
 -----              (dai_link->platform_name || dai_link->platform_of_node)) {
 -----                  ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai,
 -----                                            dai_fmt);
 -----                  if (ret != 0 && ret != -ENOTSUPP)
 -----                          dev_warn(card->rtd[i].cpu_dai->dev,
 -----                                   "ASoC: Failed to set DAI format: %d\n",
 -----                                   ret);
 -----          } else if (dai_fmt) {
 -----                  /* Flip the polarity for the "CPU" end */
 -----                  dai_fmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
 -----                  switch (dai_link->dai_fmt &
 -----                          SND_SOC_DAIFMT_MASTER_MASK) {
 -----                  case SND_SOC_DAIFMT_CBM_CFM:
 -----                          dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
 -----                          break;
 -----                  case SND_SOC_DAIFMT_CBM_CFS:
 -----                          dai_fmt |= SND_SOC_DAIFMT_CBS_CFM;
 -----                          break;
 -----                  case SND_SOC_DAIFMT_CBS_CFM:
 -----                          dai_fmt |= SND_SOC_DAIFMT_CBM_CFS;
 -----                          break;
 -----                  case SND_SOC_DAIFMT_CBS_CFS:
 -----                          dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
 -----                          break;
 -----                  }
 -----
 -----                  ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai,
 -----                                            dai_fmt);
 -----                  if (ret != 0 && ret != -ENOTSUPP)
 -----                          dev_warn(card->rtd[i].cpu_dai->dev,
 -----                                   "ASoC: Failed to set DAI format: %d\n",
 -----                                   ret);
 -----          }
 +++++          if (card->dai_link[i].dai_fmt)
 +++++                  snd_soc_runtime_set_dai_fmt(&card->rtd[i],
 +++++                          card->dai_link[i].dai_fmt);
        }
      
        snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname),
                }
        }
      
 -----  if (card->fully_routed)
 -----          snd_soc_dapm_auto_nc_pins(card);
 -----
        snd_soc_dapm_new_widgets(card);
      
        ret = snd_card_register(card->snd_card);
@@@@@@@ -2140,15 -2119,15 -2119,15 -2119,27 -2119,15 -2119,15 +2140,27 @@@@@@@ static int snd_soc_xlate_tdm_slot_mask(
      }
      
      /**
--- -- * snd_soc_dai_set_tdm_slot - configure DAI TDM.
--- -- * @dai: DAI
+++ ++ * snd_soc_dai_set_tdm_slot() - Configures a DAI for TDM operation
+++ ++ * @dai: The DAI to configure
       * @tx_mask: bitmask representing active TX slots.
       * @rx_mask: bitmask representing active RX slots.
       * @slots: Number of slots in use.
       * @slot_width: Width in bits for each slot.
       *
--- -- * Configures a DAI for TDM operation. Both mask and slots are codec and DAI
--- -- * specific.
+++ ++ * This function configures the specified DAI for TDM operation. @slot contains
+++ ++ * the total number of slots of the TDM stream and @slot_with the width of each
+++ ++ * slot in bit clock cycles. @tx_mask and @rx_mask are bitmasks specifying the
+++ ++ * active slots of the TDM stream for the specified DAI, i.e. which slots the
+++ ++ * DAI should write to or read from. If a bit is set the corresponding slot is
+++ ++ * active, if a bit is cleared the corresponding slot is inactive. Bit 0 maps to
+++ ++ * the first slot, bit 1 to the second slot and so on. The first active slot
+++ ++ * maps to the first channel of the DAI, the second active slot to the second
+++ ++ * channel and so on.
+++ ++ *
+++ ++ * TDM mode can be disabled by passing 0 for @slots. In this case @tx_mask,
+++ ++ * @rx_mask and @slot_width will be ignored.
+++ ++ *
+++ ++ * Returns 0 on success, a negative error code otherwise.
       */
      int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
        unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
@@@@@@@ -2407,8 -2386,8 -2386,8 -2398,8 -2386,8 -2386,8 +2419,8 @@@@@@@ int snd_soc_unregister_card(struct snd_
                card->instantiated = false;
                snd_soc_dapm_shutdown(card);
                soc_cleanup_card_resources(card);
 +++++          dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
        }
 -----  dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
      
        return 0;
      }
@@@@@@@ -3251,7 -3230,7 -3230,7 -3242,7 -3230,7 -3230,7 +3263,7 @@@@@@@ int snd_soc_of_parse_audio_routing(stru
                                   const char *propname)
      {
        struct device_node *np = card->dev->of_node;
 -----  int num_routes, old_routes;
 +++++  int num_routes;
        struct snd_soc_dapm_route *routes;
        int i, ret;
      
                return -EINVAL;
        }
      
 -----  old_routes = card->num_dapm_routes;
 -----  routes = devm_kzalloc(card->dev,
 -----                        (old_routes + num_routes) * sizeof(*routes),
 +++++  routes = devm_kzalloc(card->dev, num_routes * sizeof(*routes),
                              GFP_KERNEL);
        if (!routes) {
                dev_err(card->dev,
                return -EINVAL;
        }
      
 -----  memcpy(routes, card->dapm_routes, old_routes * sizeof(*routes));
 -----
        for (i = 0; i < num_routes; i++) {
                ret = of_property_read_string_index(np, propname,
 -----                  2 * i, &routes[old_routes + i].sink);
 +++++                  2 * i, &routes[i].sink);
                if (ret) {
                        dev_err(card->dev,
                                "ASoC: Property '%s' index %d could not be read: %d\n",
                        return -EINVAL;
                }
                ret = of_property_read_string_index(np, propname,
 -----                  (2 * i) + 1, &routes[old_routes + i].source);
 +++++                  (2 * i) + 1, &routes[i].source);
                if (ret) {
                        dev_err(card->dev,
                                "ASoC: Property '%s' index %d could not be read: %d\n",
                }
        }
      
 -----  card->num_dapm_routes += num_routes;
 +++++  card->num_dapm_routes = num_routes;
        card->dapm_routes = routes;
      
        return 0;