Merge branch 'fix/hda' into topic/hda
authorTakashi Iwai <tiwai@suse.de>
Thu, 19 Apr 2012 15:17:59 +0000 (17:17 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 19 Apr 2012 15:20:13 +0000 (17:20 +0200)
Conflicts:
sound/pci/hda/patch_conexant.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
1  2 
sound/pci/hda/patch_conexant.c

index abb59f472d4848720efc81acf95f2ebaa6f5bc39,d906c5b74cf0e7b047a4e702c71ba8b6d0e5d5de..6e04c2bf06de47b1b1a267d773cebec8be6a59c6
@@@ -4429,12 -4382,7 +4434,13 @@@ static void apply_pincfg(struct hda_cod
  
  }
  
 -static void apply_pin_fixup(struct hda_codec *codec,
 +enum {
 +      CXT_PINCFG_LENOVO_X200,
++      CXT_PINCFG_LENOVO_TP410,
 +      CXT_FIXUP_STEREO_DMIC,
 +};
 +
 +static void apply_fixup(struct hda_codec *codec,
                            const struct snd_pci_quirk *quirk,
                            const struct cxt_pincfg **table)
  {
                            quirk->name);
                apply_pincfg(codec, table[quirk->value]);
        }
 +      if (quirk->value == CXT_FIXUP_STEREO_DMIC) {
 +              snd_printdd(KERN_INFO "hda_codec: applying internal mic workaround for %s\n",
 +                          quirk->name);
 +              spec->fixup_stereo_dmic = 1;
 +      }
  }
  
 -enum {
 -      CXT_PINCFG_LENOVO_X200,
 -      CXT_PINCFG_LENOVO_TP410,
 -};
 -
+ /* ThinkPad X200 & co with cxt5051 */
  static const struct cxt_pincfg cxt_pincfg_lenovo_x200[] = {
        { 0x16, 0x042140ff }, /* HP (seq# overridden) */
        { 0x17, 0x21a11000 }, /* dock-mic */
        {}
  };
  
+ /* ThinkPad 410/420/510/520, X201 & co with cxt5066 */
+ static const struct cxt_pincfg cxt_pincfg_lenovo_tp410[] = {
+       { 0x19, 0x042110ff }, /* HP (seq# overridden) */
+       { 0x1a, 0x21a190f0 }, /* dock-mic */
+       { 0x1c, 0x212140ff }, /* dock-HP */
+       {}
+ };
  static const struct cxt_pincfg *cxt_pincfg_tbl[] = {
        [CXT_PINCFG_LENOVO_X200] = cxt_pincfg_lenovo_x200,
+       [CXT_PINCFG_LENOVO_TP410] = cxt_pincfg_lenovo_tp410,
 +      [CXT_FIXUP_STEREO_DMIC] = NULL,
  };
  
- static const struct snd_pci_quirk cxt_fixups[] = {
+ static const struct snd_pci_quirk cxt5051_fixups[] = {
        SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT_PINCFG_LENOVO_X200),
+       {}
+ };
+ static const struct snd_pci_quirk cxt5066_fixups[] = {
+       SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
+       SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T410", CXT_PINCFG_LENOVO_TP410),
+       SND_PCI_QUIRK(0x17aa, 0x215f, "Lenovo T510", CXT_PINCFG_LENOVO_TP410),
+       SND_PCI_QUIRK(0x17aa, 0x21ce, "Lenovo T420", CXT_PINCFG_LENOVO_TP410),
+       SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520", CXT_PINCFG_LENOVO_TP410),
 +      SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
        {}
  };
  
@@@ -4510,13 -4471,13 +4535,13 @@@ static int patch_conexant_auto(struct h
        case 0x14f15051:
                add_cx5051_fake_mutes(codec);
                codec->pin_amp_workaround = 1;
 -              apply_pin_fixup(codec, cxt5051_fixups, cxt_pincfg_tbl);
++              apply_fixup(codec, cxt5051_fixups, cxt_pincfg_tbl);
                break;
        default:
                codec->pin_amp_workaround = 1;
 -              apply_pin_fixup(codec, cxt5066_fixups, cxt_pincfg_tbl);
++              apply_fixup(codec, cxt5066_fixups, cxt_pincfg_tbl);
        }
  
-       apply_fixup(codec, cxt_fixups, cxt_pincfg_tbl);
        /* Show mute-led control only on HP laptops
         * This is a sort of white-list: on HP laptops, EAPD corresponds
         * only to the mute-LED without actualy amp function.  Meanwhile,