]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' into for-next
authorTakashi Iwai <tiwai@suse.de>
Tue, 13 Oct 2015 09:37:06 +0000 (11:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 13 Oct 2015 09:37:06 +0000 (11:37 +0200)
1  2 
sound/soc/au1x/db1200.c
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5645.h
sound/soc/codecs/tlv320aic3x.c

diff --combined sound/soc/au1x/db1200.c
index 638ca0ba7e6efcb4f891564af24f4d8a570b927f,8c907ebea18960ec8e48942f5746fd2121705736..5c73061d912ad55a2cf51e75f9779bad900f9f33
@@@ -129,6 -129,8 +129,8 @@@ static struct snd_soc_dai_link db1300_i
        .cpu_dai_name   = "au1xpsc_i2s.2",
        .platform_name  = "au1xpsc-pcm.2",
        .codec_name     = "wm8731.0-001b",
+       .dai_fmt        = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF |
+                         SND_SOC_DAIFMT_CBM_CFM,
        .ops            = &db1200_i2s_wm8731_ops,
  };
  
@@@ -146,6 -148,8 +148,8 @@@ static struct snd_soc_dai_link db1550_i
        .cpu_dai_name   = "au1xpsc_i2s.3",
        .platform_name  = "au1xpsc-pcm.3",
        .codec_name     = "wm8731.0-001b",
+       .dai_fmt        = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF |
+                         SND_SOC_DAIFMT_CBM_CFM,
        .ops            = &db1200_i2s_wm8731_ops,
  };
  
@@@ -174,7 -178,14 +178,7 @@@ static int db1200_audio_probe(struct pl
  
        card = db1200_cards[pid->driver_data];
        card->dev = &pdev->dev;
 -      return snd_soc_register_card(card);
 -}
 -
 -static int db1200_audio_remove(struct platform_device *pdev)
 -{
 -      struct snd_soc_card *card = platform_get_drvdata(pdev);
 -      snd_soc_unregister_card(card);
 -      return 0;
 +      return devm_snd_soc_register_card(&pdev->dev, card);
  }
  
  static struct platform_driver db1200_audio_driver = {
        },
        .id_table       = db1200_pids,
        .probe          = db1200_audio_probe,
 -      .remove         = db1200_audio_remove,
  };
  
  module_platform_driver(db1200_audio_driver);
index 3eb184c4abe549ba7c0aa6c81688572462fb5a4d,5c101af0ac630dddf1cf12085846d5cfd9c08911..080cc1ce3963c834a82e3ba5f73e2ffd9b8af6dc
@@@ -519,11 -519,11 +519,11 @@@ static const struct snd_kcontrol_new rt
                RT5645_L_VOL_SFT + 1, RT5645_R_VOL_SFT + 1, 63, 0, adc_vol_tlv),
  
        /* ADC Boost Volume Control */
-       SOC_DOUBLE_TLV("STO1 ADC Boost Gain", RT5645_ADC_BST_VOL1,
+       SOC_DOUBLE_TLV("ADC Boost Capture Volume", RT5645_ADC_BST_VOL1,
                RT5645_STO1_ADC_L_BST_SFT, RT5645_STO1_ADC_R_BST_SFT, 3, 0,
                adc_bst_tlv),
-       SOC_DOUBLE_TLV("STO2 ADC Boost Gain", RT5645_ADC_BST_VOL1,
-               RT5645_STO2_ADC_L_BST_SFT, RT5645_STO2_ADC_R_BST_SFT, 3, 0,
+       SOC_DOUBLE_TLV("Mono ADC Boost Capture Volume", RT5645_ADC_BST_VOL2,
+               RT5645_MONO_ADC_L_BST_SFT, RT5645_MONO_ADC_R_BST_SFT, 3, 0,
                adc_bst_tlv),
  
        /* I2S2 function select */
@@@ -2829,9 -2829,6 +2829,9 @@@ static int rt5645_jack_detect(struct sn
                        snd_soc_dapm_sync(dapm);
                        rt5645->jack_type = SND_JACK_HEADPHONE;
                }
 +              if (rt5645->pdata.jd_invert)
 +                      regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
 +                              RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV);
        } else { /* jack out */
                rt5645->jack_type = 0;
  
                        snd_soc_dapm_disable_pin(dapm, "LDO2");
                snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
                snd_soc_dapm_sync(dapm);
 +              if (rt5645->pdata.jd_invert)
 +                      regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
 +                              RT5645_JD_1_1_MASK, RT5645_JD_1_1_NOR);
        }
  
        return rt5645->jack_type;
@@@ -3218,32 -3212,6 +3218,32 @@@ static const struct dmi_system_id dmi_p
        { }
  };
  
 +static struct rt5645_platform_data buddy_platform_data = {
 +      .dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
 +      .dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
 +      .jd_mode = 3,
 +      .jd_invert = true,
 +};
 +
 +static int buddy_quirk_cb(const struct dmi_system_id *id)
 +{
 +      rt5645_pdata = &buddy_platform_data;
 +
 +      return 1;
 +}
 +
 +static struct dmi_system_id dmi_platform_intel_broadwell[] __initdata = {
 +      {
 +              .ident = "Chrome Buddy",
 +              .callback = buddy_quirk_cb,
 +              .matches = {
 +                      DMI_MATCH(DMI_PRODUCT_NAME, "Buddy"),
 +              },
 +      },
 +      { }
 +};
 +
 +
  static int rt5645_parse_dt(struct rt5645_priv *rt5645, struct device *dev)
  {
        rt5645->pdata.in2_diff = device_property_read_bool(dev,
@@@ -3276,8 -3244,7 +3276,8 @@@ static int rt5645_i2c_probe(struct i2c_
  
        if (pdata)
                rt5645->pdata = *pdata;
 -      else if (dmi_check_system(dmi_platform_intel_braswell))
 +      else if (dmi_check_system(dmi_platform_intel_braswell) ||
 +                      dmi_check_system(dmi_platform_intel_broadwell))
                rt5645->pdata = *rt5645_pdata;
        else
                rt5645_parse_dt(rt5645, &i2c->dev);
index f45861c49ef25af6347d2ea1588b8be425452b55,8c964cfb120ddc4130e5d39e9ab96ae34623eb34..61bc8ab776468e8857664ef7ea32646b30c089a7
@@@ -39,8 -39,8 +39,8 @@@
  #define RT5645_STO1_ADC_DIG_VOL                       0x1c
  #define RT5645_MONO_ADC_DIG_VOL                       0x1d
  #define RT5645_ADC_BST_VOL1                   0x1e
- /* Mixer - D-D */
  #define RT5645_ADC_BST_VOL2                   0x20
+ /* Mixer - D-D */
  #define RT5645_STO1_ADC_MIXER                 0x27
  #define RT5645_MONO_ADC_MIXER                 0x28
  #define RT5645_AD_DA_MIXER                    0x29
  #define RT5645_STO1_ADC_R_BST_SFT             12
  #define RT5645_STO1_ADC_COMP_MASK             (0x3 << 10)
  #define RT5645_STO1_ADC_COMP_SFT              10
- #define RT5645_STO2_ADC_L_BST_MASK            (0x3 << 8)
- #define RT5645_STO2_ADC_L_BST_SFT             8
- #define RT5645_STO2_ADC_R_BST_MASK            (0x3 << 6)
- #define RT5645_STO2_ADC_R_BST_SFT             6
- #define RT5645_STO2_ADC_COMP_MASK             (0x3 << 4)
- #define RT5645_STO2_ADC_COMP_SFT              4
+ /* ADC Boost Volume Control (0x20) */
+ #define RT5645_MONO_ADC_L_BST_MASK            (0x3 << 14)
+ #define RT5645_MONO_ADC_L_BST_SFT             14
+ #define RT5645_MONO_ADC_R_BST_MASK            (0x3 << 12)
+ #define RT5645_MONO_ADC_R_BST_SFT             12
+ #define RT5645_MONO_ADC_COMP_MASK             (0x3 << 10)
+ #define RT5645_MONO_ADC_COMP_SFT              10
  
  /* Stereo2 ADC Mixer Control (0x26) */
  #define RT5645_STO2_ADC_SRC_MASK              (0x1 << 15)
  #define RT5645_PWR_CLS_D_R_BIT                        9
  #define RT5645_PWR_CLS_D_L                    (0x1 << 8)
  #define RT5645_PWR_CLS_D_L_BIT                        8
 -#define RT5645_PWR_ADC_R                      (0x1 << 1)
 -#define RT5645_PWR_ADC_R_BIT                  1
  #define RT5645_PWR_DAC_L2                     (0x1 << 7)
  #define RT5645_PWR_DAC_L2_BIT                 7
  #define RT5645_PWR_DAC_R2                     (0x1 << 6)
  #define RT5645_OT_P_NOR                               (0x0 << 10)
  #define RT5645_OT_P_INV                               (0x1 << 10)
  #define RT5645_IRQ_JD_1_1_EN                  (0x1 << 9)
 +#define RT5645_JD_1_1_MASK                    (0x1 << 7)
 +#define RT5645_JD_1_1_SFT                     7
 +#define RT5645_JD_1_1_NOR                     (0x0 << 7)
 +#define RT5645_JD_1_1_INV                     (0x1 << 7)
  
  /* IRQ Control 2 (0xbe) */
  #define RT5645_IRQ_MB1_OC_MASK                        (0x1 << 15)
index f1c9fffcd3a66b2ee7a5d287ae4d5d84750b13cc,8739126a1f6f60d4c9e3eac08aaf337c2f7b3a2b..a564759845f980119a29c49633cb537ef685bcd9
@@@ -80,7 -80,6 +80,7 @@@ struct aic3x_priv 
        unsigned int sysclk;
        unsigned int dai_fmt;
        unsigned int tdm_delay;
 +      unsigned int slot_width;
        struct list_head list;
        int master;
        int gpio_reset;
@@@ -1026,14 -1025,10 +1026,14 @@@ static int aic3x_hw_params(struct snd_p
        u8 data, j, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1;
        u16 d, pll_d = 1;
        int clk;
 +      int width = aic3x->slot_width;
 +
 +      if (!width)
 +              width = params_width(params);
  
        /* select data word length */
        data = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLB) & (~(0x3 << 4));
 -      switch (params_width(params)) {
 +      switch (width) {
        case 16:
                break;
        case 20:
@@@ -1175,16 -1170,12 +1175,16 @@@ static int aic3x_prepare(struct snd_pcm
        struct snd_soc_codec *codec = dai->codec;
        struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
        int delay = 0;
 +      int width = aic3x->slot_width;
 +
 +      if (!width)
 +              width = substream->runtime->sample_bits;
  
        /* TDM slot selection only valid in DSP_A/_B mode */
        if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_A)
 -              delay += (aic3x->tdm_delay + 1);
 +              delay += (aic3x->tdm_delay*width + 1);
        else if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_B)
 -              delay += aic3x->tdm_delay;
 +              delay += aic3x->tdm_delay*width;
  
        /* Configure data delay */
        snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, delay);
@@@ -1305,20 -1296,7 +1305,20 @@@ static int aic3x_set_dai_tdm_slot(struc
                return -EINVAL;
        }
  
 -      aic3x->tdm_delay = lsb * slot_width;
 +      switch (slot_width) {
 +      case 16:
 +      case 20:
 +      case 24:
 +      case 32:
 +              break;
 +      default:
 +              dev_err(codec->dev, "Unsupported slot width %d\n", slot_width);
 +              return -EINVAL;
 +      }
 +
 +
 +      aic3x->tdm_delay = lsb;
 +      aic3x->slot_width = slot_width;
  
        /* DOUT in high-impedance on inactive bit clocks */
        snd_soc_update_bits(codec, AIC3X_ASD_INTF_CTRLA,
@@@ -1531,14 -1509,17 +1531,17 @@@ static int aic3x_init(struct snd_soc_co
        snd_soc_write(codec, PGAL_2_LLOPM_VOL, DEFAULT_VOL);
        snd_soc_write(codec, PGAR_2_RLOPM_VOL, DEFAULT_VOL);
  
-       /* Line2 to HP Bypass default volume, disconnect from Output Mixer */
-       snd_soc_write(codec, LINE2L_2_HPLOUT_VOL, DEFAULT_VOL);
-       snd_soc_write(codec, LINE2R_2_HPROUT_VOL, DEFAULT_VOL);
-       snd_soc_write(codec, LINE2L_2_HPLCOM_VOL, DEFAULT_VOL);
-       snd_soc_write(codec, LINE2R_2_HPRCOM_VOL, DEFAULT_VOL);
-       /* Line2 Line Out default volume, disconnect from Output Mixer */
-       snd_soc_write(codec, LINE2L_2_LLOPM_VOL, DEFAULT_VOL);
-       snd_soc_write(codec, LINE2R_2_RLOPM_VOL, DEFAULT_VOL);
+       /* On tlv320aic3104, these registers are reserved and must not be written */
+       if (aic3x->model != AIC3X_MODEL_3104) {
+               /* Line2 to HP Bypass default volume, disconnect from Output Mixer */
+               snd_soc_write(codec, LINE2L_2_HPLOUT_VOL, DEFAULT_VOL);
+               snd_soc_write(codec, LINE2R_2_HPROUT_VOL, DEFAULT_VOL);
+               snd_soc_write(codec, LINE2L_2_HPLCOM_VOL, DEFAULT_VOL);
+               snd_soc_write(codec, LINE2R_2_HPRCOM_VOL, DEFAULT_VOL);
+               /* Line2 Line Out default volume, disconnect from Output Mixer */
+               snd_soc_write(codec, LINE2L_2_LLOPM_VOL, DEFAULT_VOL);
+               snd_soc_write(codec, LINE2R_2_RLOPM_VOL, DEFAULT_VOL);
+       }
  
        switch (aic3x->model) {
        case AIC3X_MODEL_3X: