Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/width', 'asoc...
authorMark Brown <broonie@linaro.org>
Mon, 4 Aug 2014 15:32:18 +0000 (16:32 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 4 Aug 2014 15:32:18 +0000 (16:32 +0100)
17 files changed:
1  2  3  4  5  6 
sound/soc/codecs/sgtl5000.c
sound/soc/codecs/sta529.c
sound/soc/codecs/tas5086.c
sound/soc/codecs/tlv320aic31xx.c
sound/soc/codecs/tlv320aic32x4.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320dac33.c
sound/soc/codecs/twl4030.c
sound/soc/codecs/uda134x.c
sound/soc/codecs/wl1273.c
sound/soc/codecs/wm0010.c
sound/soc/codecs/wm8350.c
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8904.c
sound/soc/codecs/wm8960.c
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm8994.c

index d739f83380a84570ed8d0212feb05305f2218e90,3d39f0b5b4a8afd8352edd95627e1fd690d968d5,a0e1f9c67ab288a998301ef99e91a766680a7fcd,3d39f0b5b4a8afd8352edd95627e1fd690d968d5,3d39f0b5b4a8afd8352edd95627e1fd690d968d5,3d39f0b5b4a8afd8352edd95627e1fd690d968d5..e997d271728d4943c1ffa63d59f7930ef2b59e65
@@@@@@@ -724,25 -724,25 -724,25 -724,25 -724,25 -724,25 +724,25 @@@@@@@ static int sgtl5000_pcm_hw_params(struc
                return ret;
      
        /* set i2s data format */
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                if (sgtl5000->fmt == SND_SOC_DAIFMT_RIGHT_J)
                        return -EINVAL;
                i2s_ctl |= SGTL5000_I2S_DLEN_16 << SGTL5000_I2S_DLEN_SHIFT;
                i2s_ctl |= SGTL5000_I2S_SCLKFREQ_32FS <<
                    SGTL5000_I2S_SCLKFREQ_SHIFT;
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                i2s_ctl |= SGTL5000_I2S_DLEN_20 << SGTL5000_I2S_DLEN_SHIFT;
                i2s_ctl |= SGTL5000_I2S_SCLKFREQ_64FS <<
                    SGTL5000_I2S_SCLKFREQ_SHIFT;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                i2s_ctl |= SGTL5000_I2S_DLEN_24 << SGTL5000_I2S_DLEN_SHIFT;
                i2s_ctl |= SGTL5000_I2S_SCLKFREQ_64FS <<
                    SGTL5000_I2S_SCLKFREQ_SHIFT;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                if (sgtl5000->fmt == SND_SOC_DAIFMT_RIGHT_J)
                        return -EINVAL;
                i2s_ctl |= SGTL5000_I2S_DLEN_32 << SGTL5000_I2S_DLEN_SHIFT;
@@@@@@@ -843,8 -843,10 -843,10 -843,10 -843,10 -843,10 +843,8 @@@@@@@ static int ldo_regulator_register(struc
      
        ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL);
      
 -----  if (!ldo) {
 -----          dev_err(codec->dev, "failed to allocate ldo_regulator\n");
 +++++  if (!ldo)
                return -ENOMEM;
 -----  }
      
        ldo->desc.name = kstrdup(dev_name(codec->dev), GFP_KERNEL);
        if (!ldo->desc.name) {
@@@@@@@ -1275,7 -1277,7 -1277,7 -1277,7 -1277,7 -1277,7 +1275,7 @@@@@@@ static int sgtl5000_enable_regulators(s
                        return ret;
        }
      
 -----  ret = devm_regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
 +++++  ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
                                 sgtl5000->supplies);
        if (ret)
                goto err_ldo_remove;
        ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies),
                                        sgtl5000->supplies);
        if (ret)
 -----          goto err_ldo_remove;
 +++++          goto err_regulator_free;
      
        /* wait for all power rails bring up */
        udelay(10);
      
        return 0;
      
 +++++err_regulator_free:
 +++++  regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 +++++                          sgtl5000->supplies);
      err_ldo_remove:
        if (!external_vddd)
                ldo_regulator_remove(codec);
@@@@@@@ -1362,8 -1361,6 -1361,6 -1361,6 -1361,6 -1361,6 +1362,8 @@@@@@@ static int sgtl5000_probe(struct snd_so
      err:
        regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
                                                sgtl5000->supplies);
 +++++  regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 +++++                          sgtl5000->supplies);
        ldo_regulator_remove(codec);
      
        return ret;
@@@@@@@ -1377,8 -1374,6 -1374,6 -1374,6 -1374,6 -1374,6 +1377,8 @@@@@@@ static int sgtl5000_remove(struct snd_s
      
        regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
                                                sgtl5000->supplies);
 +++++  regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 +++++                          sgtl5000->supplies);
        ldo_regulator_remove(codec);
      
        return 0;
index fcdf11026afffef47015ea8072469c34b916b739,a40c4b0196a3cfc42a0ebd464d067e0d379f9daa,7ece89b246749c952bf566b2e61734359f820a34,a40c4b0196a3cfc42a0ebd464d067e0d379f9daa,a40c4b0196a3cfc42a0ebd464d067e0d379f9daa,a40c4b0196a3cfc42a0ebd464d067e0d379f9daa..9aa1323fb2abef7d937125590aba3d36daa1523e
@@@@@@@ -197,16 -197,16 -197,16 -197,16 -197,16 -197,16 +197,16 @@@@@@@ static int sta529_hw_params(struct snd_
        int pdata, play_freq_val, record_freq_val;
        int bclk_to_fs_ratio;
      
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                pdata = 1;
                bclk_to_fs_ratio = 0;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                pdata = 2;
                bclk_to_fs_ratio = 1;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                pdata = 3;
                bclk_to_fs_ratio = 2;
                break;
@@@@@@@ -380,8 -380,10 -380,10 -380,10 -380,10 -380,10 +380,8 @@@@@@@ static int sta529_i2c_probe(struct i2c_
                return -EINVAL;
      
        sta529 = devm_kzalloc(&i2c->dev, sizeof(struct sta529), GFP_KERNEL);
 -----  if (sta529 == NULL) {
 -----          dev_err(&i2c->dev, "Can not allocate memory\n");
 +++++  if (!sta529)
                return -ENOMEM;
 -----  }
      
        sta529->regmap = devm_regmap_init_i2c(i2c, &sta529_regmap);
        if (IS_ERR(sta529->regmap)) {
index be7194b43b7a73324271528a356fe467badd9e05,d48491a4a19db93d8b496d6f8899d88dd44fa3c0,9871cf374055ee61769c66e9bbb1f47116570eb4,d48491a4a19db93d8b496d6f8899d88dd44fa3c0,d48491a4a19db93d8b496d6f8899d88dd44fa3c0,d48491a4a19db93d8b496d6f8899d88dd44fa3c0..249ef5c4c762795bfb19f3545ce8398868f4dba3
      #include <linux/gpio.h>
      #include <linux/i2c.h>
      #include <linux/regmap.h>
 +++++#include <linux/regulator/consumer.h>
      #include <linux/spi/spi.h>
      #include <linux/of.h>
      #include <linux/of_device.h>
@@@@@@@ -241,10 -240,6 -240,6 -240,6 -240,6 -240,6 +241,10 @@@@@@@ static int tas5086_reg_read(void *conte
        return 0;
      }
      
 +++++static const char * const supply_names[] = {
 +++++  "dvdd", "avdd"
 +++++};
 +++++
      struct tas5086_private {
        struct regmap   *regmap;
        unsigned int    mclk, sclk;
        int             rate;
        /* GPIO driving Reset pin, if any */
        int             gpio_nreset;
 +++++  struct          regulator_bulk_data supplies[ARRAY_SIZE(supply_names)];
      };
      
      static int tas5086_deemph[] = { 0, 32000, 44100, 48000 };
@@@@@@@ -425,14 -419,14 -419,14 -419,14 -419,14 -419,14 +425,14 @@@@@@@ static int tas5086_hw_params(struct snd
        }
      
        /* ... then add the offset for the sample bit depth. */
-- ---  switch (params_format(params)) {
-- ---        case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++        case 16:
                val += 0;
                      break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                val += 1;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_3LE:
++ +++  case 24:
                val += 2;
                break;
        default:
@@@@@@@ -779,8 -773,6 -773,6 -773,6 -773,6 -773,6 +779,8 @@@@@@@ static int tas5086_soc_suspend(struct s
        if (ret < 0)
                return ret;
      
 +++++  regulator_bulk_disable(ARRAY_SIZE(priv->supplies), priv->supplies);
 +++++
        return 0;
      }
      
@@@@@@@ -789,10 -781,6 -781,6 -781,6 -781,6 -781,6 +789,10 @@@@@@@ static int tas5086_soc_resume(struct sn
        struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
        int ret;
      
 +++++  ret = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), priv->supplies);
 +++++  if (ret < 0)
 +++++          return ret;
 +++++
        tas5086_reset(priv);
        regcache_mark_dirty(priv->regmap);
      
@@@@@@@ -824,12 -812,6 -812,6 -812,6 -812,6 -812,6 +824,12 @@@@@@@ static int tas5086_probe(struct snd_soc
        struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
        int i, ret;
      
 +++++  ret = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), priv->supplies);
 +++++  if (ret < 0) {
 +++++          dev_err(codec->dev, "Failed to enable regulators: %d\n", ret);
 +++++          return ret;
 +++++  }
 +++++
        priv->pwm_start_mid_z = 0;
        priv->charge_period = 1300000; /* hardware default is 1300 ms */
      
                }
        }
      
 +++++  tas5086_reset(priv);
        ret = tas5086_init(codec->dev, priv);
        if (ret < 0)
 -----          return ret;
 +++++          goto exit_disable_regulators;
      
        /* set master volume to 0 dB */
        ret = regmap_write(priv->regmap, TAS5086_MASTER_VOL, 0x30);
        if (ret < 0)
 -----          return ret;
 +++++          goto exit_disable_regulators;
      
        return 0;
 +++++
 +++++exit_disable_regulators:
 +++++  regulator_bulk_disable(ARRAY_SIZE(priv->supplies), priv->supplies);
 +++++
 +++++  return ret;
      }
      
      static int tas5086_remove(struct snd_soc_codec *codec)
                /* Set codec to the reset state */
                gpio_set_value(priv->gpio_nreset, 0);
      
 +++++  regulator_bulk_disable(ARRAY_SIZE(priv->supplies), priv->supplies);
 +++++
        return 0;
      };
      
@@@@@@@ -926,16 -900,6 -900,6 -900,6 -900,6 -900,6 +926,16 @@@@@@@ static int tas5086_i2c_probe(struct i2c
        if (!priv)
                return -ENOMEM;
      
 +++++  for (i = 0; i < ARRAY_SIZE(supply_names); i++)
 +++++          priv->supplies[i].supply = supply_names[i];
 +++++
 +++++  ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies),
 +++++                                priv->supplies);
 +++++  if (ret < 0) {
 +++++          dev_err(dev, "Failed to get regulators: %d\n", ret);
 +++++          return ret;
 +++++  }
 +++++
        priv->regmap = devm_regmap_init(dev, NULL, i2c, &tas5086_regmap);
        if (IS_ERR(priv->regmap)) {
                ret = PTR_ERR(priv->regmap);
                        gpio_nreset = -EINVAL;
      
        priv->gpio_nreset = gpio_nreset;
 +++++
 +++++  ret = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), priv->supplies);
 +++++  if (ret < 0) {
 +++++          dev_err(dev, "Failed to enable regulators: %d\n", ret);
 +++++          return ret;
 +++++  }
 +++++
        tas5086_reset(priv);
      
        /* The TAS5086 always returns 0x03 in its TAS5086_DEV_ID register */
        ret = regmap_read(priv->regmap, TAS5086_DEV_ID, &i);
 -----  if (ret < 0)
 -----          return ret;
 -----
 -----  if (i != 0x3) {
 +++++  if (ret == 0 && i != 0x3) {
                dev_err(dev,
                        "Failed to identify TAS5086 codec (got %02x)\n", i);
 -----          return -ENODEV;
 +++++          ret = -ENODEV;
        }
      
 -----  return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_tas5086,
 -----          &tas5086_dai, 1);
 +++++  /*
 +++++   * The chip has been identified, so we can turn off the power
 +++++   * again until the dai link is set up.
 +++++   */
 +++++  regulator_bulk_disable(ARRAY_SIZE(priv->supplies), priv->supplies);
 +++++
 +++++  if (ret == 0)
 +++++          ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_tas5086,
 +++++                                       &tas5086_dai, 1);
 +++++
 +++++  return ret;
      }
      
      static int tas5086_i2c_remove(struct i2c_client *i2c)
index 095f4556ab1b4da0927bb80ba86ebf210b2f2dce,23419109ecac10982489fa8b283498dfbea79447,42f23f382c5d427413c6b403d5971ca065ddf104,23419109ecac10982489fa8b283498dfbea79447,23419109ecac10982489fa8b283498dfbea79447,23419109ecac10982489fa8b283498dfbea79447..0f64c7890eed65a6efaaf1cea2bdf4b888950ca7
@@@@@@@ -249,16 -249,17 -249,17 -249,17 -249,17 -249,17 +249,16 @@@@@@@ static const char * const mic_select_te
        "Off", "FFR 10 Ohm", "FFR 20 Ohm", "FFR 40 Ohm"
      };
      
 -----static const
 -----SOC_ENUM_SINGLE_DECL(mic1lp_p_enum, AIC31XX_MICPGAPI, 6, mic_select_text);
 -----static const
 -----SOC_ENUM_SINGLE_DECL(mic1rp_p_enum, AIC31XX_MICPGAPI, 4, mic_select_text);
 -----static const
 -----SOC_ENUM_SINGLE_DECL(mic1lm_p_enum, AIC31XX_MICPGAPI, 2, mic_select_text);
 -----
 -----static const
 -----SOC_ENUM_SINGLE_DECL(cm_m_enum, AIC31XX_MICPGAMI, 6, mic_select_text);
 -----static const
 -----SOC_ENUM_SINGLE_DECL(mic1lm_m_enum, AIC31XX_MICPGAMI, 4, mic_select_text);
 +++++static SOC_ENUM_SINGLE_DECL(mic1lp_p_enum, AIC31XX_MICPGAPI, 6,
 +++++  mic_select_text);
 +++++static SOC_ENUM_SINGLE_DECL(mic1rp_p_enum, AIC31XX_MICPGAPI, 4,
 +++++  mic_select_text);
 +++++static SOC_ENUM_SINGLE_DECL(mic1lm_p_enum, AIC31XX_MICPGAPI, 2,
 +++++  mic_select_text);
 +++++
 +++++static SOC_ENUM_SINGLE_DECL(cm_m_enum, AIC31XX_MICPGAMI, 6, mic_select_text);
 +++++static SOC_ENUM_SINGLE_DECL(mic1lm_m_enum, AIC31XX_MICPGAMI, 4,
 +++++  mic_select_text);
      
      static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6350, 50, 0);
      static const DECLARE_TLV_DB_SCALE(adc_fgain_tlv, 0, 10, 0);
@@@@@@@ -328,7 -329,6 -329,6 -329,6 -329,6 -329,6 +328,7 @@@@@@@ static int aic31xx_wait_bits(struct aic
        unsigned int bits;
        int counter = count;
        int ret = regmap_read(aic31xx->regmap, reg, &bits);
 +++++
        while ((bits & mask) != wbits && counter && !ret) {
                usleep_range(sleep, sleep * 2);
                ret = regmap_read(aic31xx->regmap, reg, &bits);
@@@@@@@ -435,7 -435,6 -435,6 -435,6 -435,6 -435,6 +435,7 @@@@@@@ static int mic_bias_event(struct snd_so
      {
        struct snd_soc_codec *codec = w->codec;
        struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
 +++++
        switch (event) {
        case SND_SOC_DAPM_POST_PMU:
                /* change mic bias voltage to user defined */
@@@@@@@ -760,8 -759,8 -759,8 -759,8 -759,8 -759,8 +760,8 @@@@@@@ static int aic31xx_hw_params(struct snd
        struct snd_soc_codec *codec = dai->codec;
        u8 data = 0;
      
-- ---  dev_dbg(codec->dev, "## %s: format %d width %d rate %d\n",
-- ---          __func__, params_format(params), params_width(params),
++ +++  dev_dbg(codec->dev, "## %s: width %d rate %d\n",
++ +++          __func__, params_width(params),
                params_rate(params));
      
        switch (params_width(params)) {
                        AIC31XX_IFACE1_DATALEN_SHIFT);
                break;
        default:
-- ---          dev_err(codec->dev, "%s: Unsupported format %d\n",
-- ---                  __func__, params_format(params));
++ +++          dev_err(codec->dev, "%s: Unsupported width %d\n",
++ +++                  __func__, params_width(params));
                return -EINVAL;
        }
      
@@@@@@@ -1179,7 -1178,7 -1178,7 -1178,7 -1178,7 -1178,7 +1179,7 @@@@@@@ static void aic31xx_pdata_from_of(struc
      }
      #endif /* CONFIG_OF */
      
 -----static void aic31xx_device_init(struct aic31xx_priv *aic31xx)
 +++++static int aic31xx_device_init(struct aic31xx_priv *aic31xx)
      {
        int ret, i;
      
                                            "aic31xx-reset-pin");
                if (ret < 0) {
                        dev_err(aic31xx->dev, "not able to acquire gpio\n");
 -----                  return;
 +++++                  return ret;
                }
        }
      
        if (ret != 0)
                dev_err(aic31xx->dev, "Failed to request supplies: %d\n", ret);
      
 +++++  return ret;
      }
      
      static int aic31xx_i2c_probe(struct i2c_client *i2c,
      
        aic31xx->pdata.codec_type = id->driver_data;
      
 -----  aic31xx_device_init(aic31xx);
 +++++  ret = aic31xx_device_init(aic31xx);
 +++++  if (ret)
 +++++          return ret;
      
        return snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx,
                                     aic31xx_dai_driver,
index 89e41d2f7586a6d6890e727a0b5090dadd2800c0,1d9b117345a3ae6fc8182f73733603a34f6a20d7,5d618e50cbf1e33f189c317781a60da271a5bf8c,1d9b117345a3ae6fc8182f73733603a34f6a20d7,1d9b117345a3ae6fc8182f73733603a34f6a20d7,1d9b117345a3ae6fc8182f73733603a34f6a20d7..6ea662db2410714c7a945234cb016c779a12a4eb
@@@@@@@ -450,16 -450,16 -450,16 -450,16 -450,16 -450,16 +450,16 @@@@@@@ static int aic32x4_hw_params(struct snd
      
        data = snd_soc_read(codec, AIC32X4_IFACE1);
        data = data & ~(3 << 4);
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                data |= (AIC32X4_WORD_LEN_20BITS << AIC32X4_DOSRMSB_SHIFT);
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                data |= (AIC32X4_WORD_LEN_24BITS << AIC32X4_DOSRMSB_SHIFT);
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                data |= (AIC32X4_WORD_LEN_32BITS << AIC32X4_DOSRMSB_SHIFT);
                break;
        }
@@@@@@@ -626,33 -626,32 -626,32 -626,32 -626,32 -626,32 +626,33 @@@@@@@ static int aic32x4_probe(struct snd_soc
                snd_soc_write(codec, AIC32X4_MICBIAS, AIC32X4_MICBIAS_LDOIN |
                                                      AIC32X4_MICBIAS_2075V);
        }
 -----  if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE) {
 +++++  if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE)
                snd_soc_write(codec, AIC32X4_PWRCFG, AIC32X4_AVDDWEAKDISABLE);
 -----  }
      
        tmp_reg = (aic32x4->power_cfg & AIC32X4_PWR_AIC32X4_LDO_ENABLE) ?
                        AIC32X4_LDOCTLEN : 0;
        snd_soc_write(codec, AIC32X4_LDOCTL, tmp_reg);
      
        tmp_reg = snd_soc_read(codec, AIC32X4_CMMODE);
 -----  if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36) {
 +++++  if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36)
                tmp_reg |= AIC32X4_LDOIN_18_36;
 -----  }
 -----  if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED) {
 +++++  if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED)
                tmp_reg |= AIC32X4_LDOIN2HP;
 -----  }
        snd_soc_write(codec, AIC32X4_CMMODE, tmp_reg);
      
        /* Mic PGA routing */
        if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K)
 -----          snd_soc_write(codec, AIC32X4_LMICPGANIN, AIC32X4_LMICPGANIN_IN2R_10K);
 +++++          snd_soc_write(codec, AIC32X4_LMICPGANIN,
 +++++                          AIC32X4_LMICPGANIN_IN2R_10K);
        else
 -----          snd_soc_write(codec, AIC32X4_LMICPGANIN, AIC32X4_LMICPGANIN_CM1L_10K);
 +++++          snd_soc_write(codec, AIC32X4_LMICPGANIN,
 +++++                          AIC32X4_LMICPGANIN_CM1L_10K);
        if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K)
 -----          snd_soc_write(codec, AIC32X4_RMICPGANIN, AIC32X4_RMICPGANIN_IN1L_10K);
 +++++          snd_soc_write(codec, AIC32X4_RMICPGANIN,
 +++++                          AIC32X4_RMICPGANIN_IN1L_10K);
        else
 -----          snd_soc_write(codec, AIC32X4_RMICPGANIN, AIC32X4_RMICPGANIN_CM1R_10K);
 +++++          snd_soc_write(codec, AIC32X4_RMICPGANIN,
 +++++                          AIC32X4_RMICPGANIN_CM1R_10K);
      
        aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
      
index f14b551b729e390196059d26812997213fd6f8b3,00b127fe2b771bf8513aa340dd2950704efe0790,e12fafbb1e094c539663605a9bb5b5641c081f06,e12fafbb1e094c539663605a9bb5b5641c081f06,e12fafbb1e094c539663605a9bb5b5641c081f06,e12fafbb1e094c539663605a9bb5b5641c081f06..64f179ee98345f841319599c255188e14fc37767
@@@@@@@ -873,16 -873,16 -873,16 -873,16 -873,16 -873,16 +873,16 @@@@@@@ static int aic3x_hw_params(struct snd_p
      
        /* select data word length */
        data = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLB) & (~(0x3 << 4));
- ----  switch (params_format(params)) {
- ----  case SNDRV_PCM_FORMAT_S16_LE:
+ ++++  switch (params_width(params)) {
+ ++++  case 16:
                break;
- ----  case SNDRV_PCM_FORMAT_S20_3LE:
+ ++++  case 20:
                data |= (0x01 << 4);
                break;
-       case SNDRV_PCM_FORMAT_S24_3LE:
  ----  case SNDRV_PCM_FORMAT_S24_LE:
+ ++++  case 24:
                data |= (0x02 << 4);
                break;
- ----  case SNDRV_PCM_FORMAT_S32_LE:
+ ++++  case 32:
                data |= (0x03 << 4);
                break;
        }
@@@@@@@ -1194,7 -1194,8 -1194,7 -1194,7 -1194,7 -1194,7 +1194,8 @@@@@@@ static int aic3x_set_bias_level(struct 
      
      #define AIC3X_RATES       SNDRV_PCM_RATE_8000_96000
      #define AIC3X_FORMATS     (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
- ----                   SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
+ ++++                   SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE | \
+ ++++                   SNDRV_PCM_FMTBIT_S32_LE)
      
      static const struct snd_soc_dai_ops aic3x_dai_ops = {
        .hw_params      = aic3x_hw_params,
@@@@@@@ -1477,8 -1478,10 -1477,10 -1477,10 -1477,10 -1477,10 +1478,8 @@@@@@@ static int aic3x_i2c_probe(struct i2c_c
        u32 value;
      
        aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL);
 -----  if (aic3x == NULL) {
 -----          dev_err(&i2c->dev, "failed to create private data\n");
 +++++  if (!aic3x)
                return -ENOMEM;
 -----  }
      
        aic3x->regmap = devm_regmap_init_i2c(i2c, &aic3x_regmap);
        if (IS_ERR(aic3x->regmap)) {
        } else if (np) {
                ai3x_setup = devm_kzalloc(&i2c->dev, sizeof(*ai3x_setup),
                                                                GFP_KERNEL);
 -----          if (ai3x_setup == NULL) {
 -----                  dev_err(&i2c->dev, "failed to create private data\n");
 +++++          if (!ai3x_setup)
                        return -ENOMEM;
 -----          }
      
                ret = of_get_named_gpio(np, "gpio-reset", 0);
                if (ret >= 0)
index ff006cc9552006bc086ddd2b4402bff495a781d9,df3a7506c023b53787d9fa1d8d76d6c0ffb1403b,34f8ff886c33e609f62fd3feee29c70d830a7389,df3a7506c023b53787d9fa1d8d76d6c0ffb1403b,df3a7506c023b53787d9fa1d8d76d6c0ffb1403b,df3a7506c023b53787d9fa1d8d76d6c0ffb1403b..e21ed934bdbf9cdc1f55de3b4786196250336355
@@@@@@@ -832,18 -832,18 -832,18 -832,18 -832,18 -832,18 +832,18 @@@@@@@ static int dac33_hw_params(struct snd_p
                return -EINVAL;
        }
      
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                dac33->fifo_size = DAC33_FIFO_SIZE_16BIT;
                dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 32);
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                dac33->fifo_size = DAC33_FIFO_SIZE_24BIT;
                dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 64);
                break;
        default:
-- ---          dev_err(codec->dev, "unsupported format %d\n",
-- ---                  params_format(params));
++ +++          dev_err(codec->dev, "unsupported width %d\n",
++ +++                  params_width(params));
                return -EINVAL;
        }
      
@@@@@@@ -1404,7 -1404,7 -1404,7 -1404,7 -1404,7 -1404,7 +1404,7 @@@@@@@ static int dac33_soc_probe(struct snd_s
        if (dac33->irq >= 0) {
                ret = request_irq(dac33->irq, dac33_interrupt_handler,
                                  IRQF_TRIGGER_RISING,
 -----                            codec->name, codec);
 +++++                            codec->component.name, codec);
                if (ret < 0) {
                        dev_err(codec->dev, "Could not request IRQ%d (%d)\n",
                                                dac33->irq, ret);
index cf404505e7d1b01a18681d334c7be857a17530ad,69e12a311ba20009fe489960800f95798eecbbc3,6164a7e43896433c03b067c15c228a7965bcacf7,69e12a311ba20009fe489960800f95798eecbbc3,69e12a311ba20009fe489960800f95798eecbbc3,69e12a311ba20009fe489960800f95798eecbbc3..b6b0cb39959979f783bcaa5864c80ebe864d4142
@@@@@@@ -344,16 -344,17 -344,17 -344,17 -344,17 -344,17 +344,16 @@@@@@@ static void twl4030_init_chip(struct sn
      static void twl4030_apll_enable(struct snd_soc_codec *codec, int enable)
      {
        struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
 -----  int status = -1;
      
        if (enable) {
                twl4030->apll_enabled++;
                if (twl4030->apll_enabled == 1)
 -----                  status = twl4030_audio_enable_resource(
 +++++                  twl4030_audio_enable_resource(
                                                        TWL4030_AUDIO_RES_APLL);
        } else {
                twl4030->apll_enabled--;
                if (!twl4030->apll_enabled)
 -----                  status = twl4030_audio_disable_resource(
 +++++                  twl4030_audio_disable_resource(
                                                        TWL4030_AUDIO_RES_APLL);
        }
      }
@@@@@@@ -1763,16 -1764,16 -1764,16 -1764,16 -1764,16 -1764,16 +1763,16 @@@@@@@ static int twl4030_hw_params(struct snd
        old_format = twl4030_read(codec, TWL4030_REG_AUDIO_IF);
        format = old_format;
        format &= ~TWL4030_DATA_WIDTH;
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                format |= TWL4030_DATA_WIDTH_16S_16W;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                format |= TWL4030_DATA_WIDTH_32S_24W;
                break;
        default:
-- ---          dev_err(codec->dev, "%s: unknown format %d\n", __func__,
-- ---                  params_format(params));
++ +++          dev_err(codec->dev, "%s: unsupported bits/sample %d\n",
++ +++                  __func__, params_width(params));
                return -EINVAL;
        }
      
@@@@@@@ -2161,8 -2162,10 -2162,10 -2162,10 -2162,10 -2162,10 +2161,8 @@@@@@@ static int twl4030_soc_probe(struct snd
      
        twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv),
                               GFP_KERNEL);
 -----  if (twl4030 == NULL) {
 -----          dev_err(codec->dev, "Can not allocate memory\n");
 +++++  if (!twl4030)
                return -ENOMEM;
 -----  }
        snd_soc_codec_set_drvdata(codec, twl4030);
        /* Set the defaults, and power up the codec */
        twl4030->sysclk = twl4030_audio_get_mclk() / 1000;
index 12fc0aed7503188390a96966ff4c59626cb66325,edf27acc1d77da6ba457cef5e8a403867e753fb2,ad145ba85cd5e99de99c92b483e5956947806c5b,edf27acc1d77da6ba457cef5e8a403867e753fb2,edf27acc1d77da6ba457cef5e8a403867e753fb2,edf27acc1d77da6ba457cef5e8a403867e753fb2..32b2f78aa62cbabe237c51a1681ee1b3e1ab1bbf
@@@@@@@ -243,14 -243,14 -243,14 -243,14 -243,14 -243,14 +243,14 @@@@@@@ static int uda134x_hw_params(struct snd
        case SND_SOC_DAIFMT_I2S:
                break;
        case SND_SOC_DAIFMT_RIGHT_J:
-- ---          switch (params_format(params)) {
-- ---          case SNDRV_PCM_FORMAT_S16_LE:
++ +++          switch (params_width(params)) {
++ +++          case 16:
                        hw_params |= (1<<1);
                        break;
-- ---          case SNDRV_PCM_FORMAT_S18_3LE:
++ +++          case 18:
                        hw_params |= (1<<2);
                        break;
-- ---          case SNDRV_PCM_FORMAT_S20_3LE:
++ +++          case 20:
                        hw_params |= ((1<<2) | (1<<1));
                        break;
                default:
@@@@@@@ -479,7 -479,7 -479,7 -479,7 -479,7 -479,7 +479,7 @@@@@@@ static struct snd_soc_dai_driver uda134
      static int uda134x_soc_probe(struct snd_soc_codec *codec)
      {
        struct uda134x_priv *uda134x;
 -----  struct uda134x_platform_data *pd = codec->card->dev->platform_data;
 +++++  struct uda134x_platform_data *pd = codec->component.card->dev->platform_data;
        const struct snd_soc_dapm_widget *widgets;
        unsigned num_widgets;
      
index 5d8ba779085b559d0a24c37fcfc6542fadfe5a8b,4ead0dc02b87428e15e160032e3b9ef8fab6f925,34f64dc281ec6438a804a7adf558b610d0dd7d70,4ead0dc02b87428e15e160032e3b9ef8fab6f925,4ead0dc02b87428e15e160032e3b9ef8fab6f925,4ead0dc02b87428e15e160032e3b9ef8fab6f925..f3d4e88d0b7b3b1fc3f3224c7e50f97edb580ade
@@@@@@@ -341,8 -341,8 -341,9 -341,8 -341,8 -341,8 +341,9 @@@@@@@ static int wl1273_hw_params(struct snd_
        struct wl1273_core *core = wl1273->core;
        unsigned int rate, width, r;
      
-- ---  if (params_format(params) != SNDRV_PCM_FORMAT_S16_LE) {
-- ---          pr_err("Only SNDRV_PCM_FORMAT_S16_LE supported.\n");
++ +++  if (params_width(params) != 16) {
++ +++          dev_err(dai->dev, "%d bits/sample not supported\n",
++ +++                  params_width(params));
                return -EINVAL;
        }
      
@@@@@@@ -461,8 -461,10 -462,10 -461,10 -461,10 -461,10 +462,8 @@@@@@@ static int wl1273_probe(struct snd_soc_
        }
      
        wl1273 = kzalloc(sizeof(struct wl1273_priv), GFP_KERNEL);
 -----  if (wl1273 == NULL) {
 -----          dev_err(codec->dev, "Cannot allocate memory.\n");
 +++++  if (!wl1273)
                return -ENOMEM;
 -----  }
      
        wl1273->mode = WL1273_MODE_BT;
        wl1273->core = *core;
index 982467c1d56a1a1b617886661836a0f3db86a798,71ce3159a62e73da7fb6c97f5ba7baed06db44c9,71ce3159a62e73da7fb6c97f5ba7baed06db44c9,65d7c79716a0403cd3b942d1f29378e64d24ea94,71ce3159a62e73da7fb6c97f5ba7baed06db44c9,71ce3159a62e73da7fb6c97f5ba7baed06db44c9..f37989ec7cbaff9509c50f4b5a66b1c4e1fe1e85
@@@@@@@ -144,7 -144,7 -144,7 -144,7 -144,7 -144,7 +144,7 @@@@@@@ static const struct snd_soc_dapm_route 
      
      static const char *wm0010_state_to_str(enum wm0010_state state)
      {
--- --  const char *state_to_str[] = {
+++ ++  static const char * const state_to_str[] = {
                "Power off",
                "Out of reset",
                "Boot ROM",
@@@@@@@ -413,6 -413,7 -413,7 -413,7 -413,7 -413,7 +413,6 @@@@@@@ static int wm0010_firmware_load(const c
      
                xfer = kzalloc(sizeof(*xfer), GFP_KERNEL);
                if (!xfer) {
 -----                  dev_err(codec->dev, "Failed to allocate xfer\n");
                        ret = -ENOMEM;
                        goto abort;
                }
      
                out = kzalloc(len, GFP_KERNEL | GFP_DMA);
                if (!out) {
 -----                  dev_err(codec->dev,
 -----                          "Failed to allocate RX buffer\n");
                        ret = -ENOMEM;
                        goto abort1;
                }
      
                img = kzalloc(len, GFP_KERNEL | GFP_DMA);
                if (!img) {
 -----                  dev_err(codec->dev,
 -----                          "Failed to allocate image buffer\n");
                        ret = -ENOMEM;
                        goto abort1;
                }
@@@@@@@ -521,12 -526,14 -526,14 -526,14 -526,14 -526,14 +521,12 @@@@@@@ static int wm0010_stage2_load(struct sn
        /* Copy to local buffer first as vmalloc causes problems for dma */
        img = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
        if (!img) {
 -----          dev_err(codec->dev, "Failed to allocate image buffer\n");
                ret = -ENOMEM;
                goto abort2;
        }
      
        out = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
        if (!out) {
 -----          dev_err(codec->dev, "Failed to allocate output buffer\n");
                ret = -ENOMEM;
                goto abort1;
        }
@@@@@@@ -672,8 -679,11 -679,11 -679,11 -679,11 -679,11 +672,8 @@@@@@@ static int wm0010_boot(struct snd_soc_c
                }
      
                img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
 -----          if (!img_swap) {
 -----                  dev_err(codec->dev,
 -----                          "Failed to allocate image buffer\n");
 +++++          if (!img_swap)
                        goto abort;
 -----          }
      
                /* We need to re-order for 0010 */
                byte_swap_64((u64 *)&pll_rec, img_swap, len);
index d9e634c55e81a92050a08ac4721909d78ade2fbc,392285edb59545787f336bdc59babdbb5e15e69f,b3053a98db824aabef67073c7cfbd2336a0ba67d,392285edb59545787f336bdc59babdbb5e15e69f,392285edb59545787f336bdc59babdbb5e15e69f,392285edb59545787f336bdc59babdbb5e15e69f..3dfdcc4197fa96cce56a13e50291b9075e44d4a9
@@@@@@@ -918,16 -918,16 -918,16 -918,16 -918,16 -918,16 +918,16 @@@@@@@ static int wm8350_pcm_hw_params(struct 
            ~WM8350_AIF_WL_MASK;
      
        /* bit size */
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                iface |= 0x1 << 10;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                iface |= 0x2 << 10;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                iface |= 0x3 << 10;
                break;
        }
@@@@@@@ -1341,18 -1341,21 -1341,21 -1341,21 -1341,21 -1341,21 +1341,18 @@@@@@@ int wm8350_hp_jack_detect(struct snd_so
      {
        struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
        struct wm8350 *wm8350 = priv->wm8350;
 -----  int irq;
        int ena;
      
        switch (which) {
        case WM8350_JDL:
                priv->hpl.jack = jack;
                priv->hpl.report = report;
 -----          irq = WM8350_IRQ_CODEC_JCK_DET_L;
                ena = WM8350_JDL_ENA;
                break;
      
        case WM8350_JDR:
                priv->hpr.jack = jack;
                priv->hpr.report = report;
 -----          irq = WM8350_IRQ_CODEC_JCK_DET_R;
                ena = WM8350_JDR_ENA;
                break;
      
index ec3250daa93e43ed75dd34a729d0103abdca2557,b84940c359a127fd1330146b21ef50cda605ac0d,fa4bccf601e656743b51efd1f87147d7017e07d3,b84940c359a127fd1330146b21ef50cda605ac0d,b84940c359a127fd1330146b21ef50cda605ac0d,b84940c359a127fd1330146b21ef50cda605ac0d..aa0984864e761f52d677d458fbee6969588f5de8
@@@@@@@ -281,7 -281,8 -281,8 -281,8 -281,8 -281,8 +281,7 @@@@@@@ static int wm8903_dcs_event(struct snd_
      static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm,
                                enum snd_soc_dapm_type event, int subseq)
      {
 -----  struct snd_soc_codec *codec = container_of(dapm,
 -----                                             struct snd_soc_codec, dapm);
 +++++  struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm);
        struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
        int dcs_mode = WM8903_DCS_MODE_WRITE_STOP;
        int i, val;
@@@@@@@ -1476,19 -1477,19 -1477,19 -1477,19 -1477,19 -1477,19 +1476,19 @@@@@@@ static int wm8903_hw_params(struct snd_
      
        aif1 &= ~WM8903_AIF_WL_MASK;
        bclk = 2 * fs;
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                bclk *= 16;
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                bclk *= 20;
                aif1 |= 0x4;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                bclk *= 24;
                aif1 |= 0x8;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                bclk *= 32;
                aif1 |= 0xc;
                break;
index e2792980ecf23c56a82d0f40f8f37122f7408a4d,f7c549949c542203c954cb89b2a1f8552212e98a,79b303a1f2a76f7fb6b0b3db47070de5ef6cb689,f7c549949c542203c954cb89b2a1f8552212e98a,da46c2ad05666a386441844b51acf14a1fcd8bdf,f7c549949c542203c954cb89b2a1f8552212e98a..4d2d2b1380d59d2b8e1043acbdd29d314eef1b97
       * published by the Free Software Foundation.
       */
      
++++ +#include <linux/clk.h>
      #include <linux/module.h>
      #include <linux/moduleparam.h>
      #include <linux/init.h>
@@@@@@@ -49,6 -49,6 -49,6 -49,6 -50,7 -49,6 +50,7 @@@@@@@ static const char *wm8904_supply_names[
      /* codec private data */
      struct wm8904_priv {
        struct regmap *regmap;
++++ +  struct clk *mclk;
      
        enum wm8904_type devtype;
      
@@@@@@@ -1290,16 -1290,16 -1290,16 -1290,16 -1292,16 -1290,16 +1292,16 @@@@@@@ static int wm8904_hw_params(struct snd_
                wm8904->bclk = snd_soc_params_to_bclk(params);
        }
      
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                aif1 |= 0x40;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                aif1 |= 0x80;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                aif1 |= 0xc0;
                break;
        default:
@@@@@@@ -1828,6 -1828,6 -1828,6 -1828,6 -1830,7 -1828,6 +1830,7 @@@@@@@ static int wm8904_set_bias_level(struc
      
        switch (level) {
        case SND_SOC_BIAS_ON:
++++ +          clk_prepare_enable(wm8904->mclk);
                break;
      
        case SND_SOC_BIAS_PREPARE:
      
                regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies),
                                       wm8904->supplies);
++++ +          clk_disable_unprepare(wm8904->mclk);
                break;
        }
        codec->dapm.bias_level = level;
@@@@@@@ -2013,8 -2013,12 -2013,12 -2013,12 -2017,12 -2013,12 +2017,8 @@@@@@@ static void wm8904_handle_pdata(struct 
                /* We need an array of texts for the enum API */
                wm8904->drc_texts = kmalloc(sizeof(char *)
                                            * pdata->num_drc_cfgs, GFP_KERNEL);
 -----          if (!wm8904->drc_texts) {
 -----                  dev_err(codec->dev,
 -----                          "Failed to allocate %d DRC config texts\n",
 -----                          pdata->num_drc_cfgs);
 +++++          if (!wm8904->drc_texts)
                        return;
 -----          }
      
                for (i = 0; i < pdata->num_drc_cfgs; i++)
                        wm8904->drc_texts[i] = pdata->drc_cfgs[i].name;
@@@@@@@ -2106,6 -2110,6 -2110,6 -2110,6 -2114,13 -2110,6 +2110,13 @@@@@@@ static int wm8904_i2c_probe(struct i2c_
        if (wm8904 == NULL)
                return -ENOMEM;
      
++++ +  wm8904->mclk = devm_clk_get(&i2c->dev, "mclk");
++++ +  if (IS_ERR(wm8904->mclk)) {
++++ +          ret = PTR_ERR(wm8904->mclk);
++++ +          dev_err(&i2c->dev, "Failed to get MCLK\n");
++++ +          return ret;
++++ +  }
++++ +
        wm8904->regmap = devm_regmap_init_i2c(i2c, &wm8904_regmap);
        if (IS_ERR(wm8904->regmap)) {
                ret = PTR_ERR(wm8904->regmap);
index e96349b04ba6553a1c26b6a4bc532cb3d7d364de,a145d0431b63dbc11c975f8b226a6f250ed17008,1916ac74fdc426ea4c57337ebf5248875324da71,a145d0431b63dbc11c975f8b226a6f250ed17008,a145d0431b63dbc11c975f8b226a6f250ed17008,a145d0431b63dbc11c975f8b226a6f250ed17008..4dc4e85116cd214da566ff84d7d56e673e17927a
@@@@@@@ -472,7 -472,7 -472,7 -472,7 -472,7 -472,7 +472,7 @@@@@@@ static int wm8960_add_widgets(struct sn
         * list each time to find the desired power state do so now
         * and save the result.
         */
 -----  list_for_each_entry(w, &codec->card->widgets, list) {
 +++++  list_for_each_entry(w, &codec->component.card->widgets, list) {
                if (w->dapm != &codec->dapm)
                        continue;
                if (strcmp(w->name, "LOUT1 PGA") == 0)
@@@@@@@ -567,24 -567,24 -567,21 -567,24 -567,24 -567,24 +567,21 @@@@@@@ static int wm8960_hw_params(struct snd_
        struct snd_soc_codec *codec = dai->codec;
        struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
        u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3;
-- ---  snd_pcm_format_t format = params_format(params);
        int i;
      
        /* bit size */
-- ---  switch (format) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
-- ---  case SNDRV_PCM_FORMAT_S16_BE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
-- ---  case SNDRV_PCM_FORMAT_S20_3BE:
++ +++  case 20:
                iface |= 0x0004;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
-- ---  case SNDRV_PCM_FORMAT_S24_BE:
++ +++  case 24:
                iface |= 0x0008;
                break;
        default:
-- ---          dev_err(codec->dev, "unsupported format %i\n", format);
++ +++          dev_err(codec->dev, "unsupported width %d\n",
++ +++                  params_width(params));
                return -EINVAL;
        }
      
index ca2fda9d72be57ca614b1c5ce877eb24dc54f05d,ca2fda9d72be57ca614b1c5ce877eb24dc54f05d,4be6f2afdbc4a7ccaaed1a36d09199c67ac62655,ca2fda9d72be57ca614b1c5ce877eb24dc54f05d,ca2fda9d72be57ca614b1c5ce877eb24dc54f05d,eac29031ae266338be11e0245350507d54b450f4..1098ae32f1f9373a7600b4fea928501f02fd16b5
      #include <linux/module.h>
      #include <linux/moduleparam.h>
      #include <linux/init.h>
+++++ #include <linux/clk.h>
      #include <linux/delay.h>
      #include <linux/pm.h>
      #include <linux/gcd.h>
@@@@@@@ -2586,16 -2586,16 -2586,16 -2586,16 -2586,16 -2587,16 +2587,16 @@@@@@@ static int wm8962_hw_params(struct snd_
        if (wm8962->lrclk % 8000 == 0)
                adctl3 |= WM8962_SAMPLE_RATE_INT_MODE;
      
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                aif0 |= 0x4;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                aif0 |= 0x8;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                aif0 |= 0xc;
                break;
        default:
@@@@@@@ -3541,6 -3541,6 -3541,6 -3541,6 -3541,6 -3542,8 +3542,8 @@@@@@@ static int wm8962_set_pdata_from_of(str
                                pdata->gpio_init[i] = 0x0;
                }
      
+++++   pdata->mclk = devm_clk_get(&i2c->dev, NULL);
+++++ 
        return 0;
      }
      
@@@@@@@ -3572,6 -3572,6 -3572,6 -3572,6 -3572,6 -3575,14 +3575,14 @@@@@@@ static int wm8962_i2c_probe(struct i2c_
                        return ret;
        }
      
+++++   /* Mark the mclk pointer to NULL if no mclk assigned */
+++++   if (IS_ERR(wm8962->pdata.mclk)) {
+++++           /* But do not ignore the request for probe defer */
+++++           if (PTR_ERR(wm8962->pdata.mclk) == -EPROBE_DEFER)
+++++                   return -EPROBE_DEFER;
+++++           wm8962->pdata.mclk = NULL;
+++++   }
+++++ 
        for (i = 0; i < ARRAY_SIZE(wm8962->supplies); i++)
                wm8962->supplies[i].supply = wm8962_supply_names[i];
      
@@@@@@@ -3780,6 -3780,6 -3780,6 -3780,6 -3780,6 -3791,12 +3791,12 @@@@@@@ static int wm8962_runtime_resume(struc
        struct wm8962_priv *wm8962 = dev_get_drvdata(dev);
        int ret;
      
+++++   ret = clk_prepare_enable(wm8962->pdata.mclk);
+++++   if (ret) {
+++++           dev_err(dev, "Failed to enable MCLK: %d\n", ret);
+++++           return ret;
+++++   }
+++++ 
        ret = regulator_bulk_enable(ARRAY_SIZE(wm8962->supplies),
                                    wm8962->supplies);
        if (ret != 0) {
@@@@@@@ -3839,6 -3839,6 -3839,6 -3839,6 -3839,6 -3856,8 +3856,8 @@@@@@@ static int wm8962_runtime_suspend(struc
        regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies),
                               wm8962->supplies);
      
+++++   clk_disable_unprepare(wm8962->pdata.mclk);
+++++ 
        return 0;
      }
      #endif
index 39d8df04011616e6f18d4812c4967cae84cf5472,247b39013fba682efa253924a178285e2f7e43ce,e7dcaf3645db9e996df8a5a9f0ddd8e835785847,247b39013fba682efa253924a178285e2f7e43ce,247b39013fba682efa253924a178285e2f7e43ce,247b39013fba682efa253924a178285e2f7e43ce..6cc0566dc29a42653c96b571f07c0a02397cbb7e
@@@@@@@ -2815,19 -2815,19 -2815,19 -2815,19 -2815,19 -2815,19 +2815,19 @@@@@@@ static int wm8994_hw_params(struct snd_
        }
      
        bclk_rate = params_rate(params);
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                bclk_rate *= 16;
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                bclk_rate *= 20;
                aif1 |= 0x20;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                bclk_rate *= 24;
                aif1 |= 0x40;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                bclk_rate *= 32;
                aif1 |= 0x60;
                break;
@@@@@@@ -2966,16 -2966,16 -2966,16 -2966,16 -2966,16 -2966,16 +2966,16 @@@@@@@ static int wm8994_aif3_hw_params(struc
                return 0;
        }
      
-- ---  switch (params_format(params)) {
-- ---  case SNDRV_PCM_FORMAT_S16_LE:
++ +++  switch (params_width(params)) {
++ +++  case 16:
                break;
-- ---  case SNDRV_PCM_FORMAT_S20_3LE:
++ +++  case 20:
                aif1 |= 0x20;
                break;
-- ---  case SNDRV_PCM_FORMAT_S24_LE:
++ +++  case 24:
                aif1 |= 0x40;
                break;
-- ---  case SNDRV_PCM_FORMAT_S32_LE:
++ +++  case 32:
                aif1 |= 0x60;
                break;
        default:
@@@@@@@ -3296,8 -3296,12 -3296,12 -3296,12 -3296,12 -3296,12 +3296,8 @@@@@@@ static void wm8994_handle_pdata(struct 
                /* We need an array of texts for the enum API */
                wm8994->drc_texts = devm_kzalloc(wm8994->hubs.codec->dev,
                            sizeof(char *) * pdata->num_drc_cfgs, GFP_KERNEL);
 -----          if (!wm8994->drc_texts) {
 -----                  dev_err(wm8994->hubs.codec->dev,
 -----                          "Failed to allocate %d DRC config texts\n",
 -----                          pdata->num_drc_cfgs);
 +++++          if (!wm8994->drc_texts)
                        return;
 -----          }
      
                for (i = 0; i < pdata->num_drc_cfgs; i++)
                        wm8994->drc_texts[i] = pdata->drc_cfgs[i].name;
@@@@@@@ -3501,7 -3505,6 -3505,6 -3505,6 -3505,6 -3505,6 +3501,7 @@@@@@@ static irqreturn_t wm8994_mic_irq(int i
        return IRQ_HANDLED;
      }
      
 +++++/* Should be called with accdet_lock held */
      static void wm1811_micd_stop(struct snd_soc_codec *codec)
      {
        struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
        if (!wm8994->jackdet)
                return;
      
 -----  mutex_lock(&wm8994->accdet_lock);
 -----
        snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, WM8958_MICD_ENA, 0);
      
        wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_JACK);
      
 -----  mutex_unlock(&wm8994->accdet_lock);
 -----
        if (wm8994->wm8994->pdata.jd_ext_cap)
                snd_soc_dapm_disable_pin(&codec->dapm,
                                         "MICBIAS2");
@@@@@@@ -3553,10 -3560,10 -3560,10 -3560,10 -3560,10 -3560,10 +3553,10 @@@@@@@ static void wm8958_open_circuit_work(st
                                                  open_circuit_work.work);
        struct device *dev = wm8994->wm8994->dev;
      
 -----  wm1811_micd_stop(wm8994->hubs.codec);
 -----
        mutex_lock(&wm8994->accdet_lock);
      
 +++++  wm1811_micd_stop(wm8994->hubs.codec);
 +++++
        dev_dbg(dev, "Reporting open circuit\n");
      
        wm8994->jack_mic = false;