Merge branch 'fix/hda' into for-linus
authorTakashi Iwai <tiwai@suse.de>
Thu, 21 Apr 2011 10:44:38 +0000 (12:44 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 21 Apr 2011 10:44:38 +0000 (12:44 +0200)
1  2 
sound/pci/hda/hda_codec.c
sound/pci/hda/patch_realtek.c

@@@ -937,6 -937,7 +937,7 @@@ void snd_hda_shutup_pins(struct hda_cod
  }
  EXPORT_SYMBOL_HDA(snd_hda_shutup_pins);
  
+ #ifdef SND_HDA_NEEDS_RESUME
  /* Restore the pin controls cleared previously via snd_hda_shutup_pins() */
  static void restore_shutup_pins(struct hda_codec *codec)
  {
        }
        codec->pins_shutup = 0;
  }
+ #endif
  
  static void init_hda_cache(struct hda_cache_rec *cache,
                           unsigned int record_size);
@@@ -1329,6 -1331,7 +1331,7 @@@ static void purify_inactive_streams(str
        }
  }
  
+ #ifdef SND_HDA_NEEDS_RESUME
  /* clean up all streams; called from suspend */
  static void hda_cleanup_all_streams(struct hda_codec *codec)
  {
                        really_cleanup_stream(codec, p);
        }
  }
+ #endif
  
  /*
   * amp access functions
@@@ -3661,7 -3665,7 +3665,7 @@@ int snd_hda_codec_build_pcms(struct hda
   * with the proper parameters for set up.
   * ops.cleanup should be called in hw_free for clean up of streams.
   *
 - * This function returns 0 if successfull, or a negative error code.
 + * This function returns 0 if successful, or a negative error code.
   */
  int __devinit snd_hda_build_pcms(struct hda_bus *bus)
  {
@@@ -4851,7 -4855,7 +4855,7 @@@ EXPORT_SYMBOL_HDA(snd_hda_suspend)
   *
   * Returns 0 if successful.
   *
 - * This fucntion is defined only when POWER_SAVE isn't set.
 + * This function is defined only when POWER_SAVE isn't set.
   * In the power-save mode, the codec is resumed dynamically.
   */
  int snd_hda_resume(struct hda_bus *bus)
@@@ -549,7 -549,7 +549,7 @@@ static int alc_ch_mode_put(struct snd_k
  
  /*
   * Control the mode of pin widget settings via the mixer.  "pc" is used
 - * instead of "%" to avoid consequences of accidently treating the % as
 + * instead of "%" to avoid consequences of accidentally treating the % as
   * being part of a format specifier.  Maximum allowed length of a value is
   * 63 characters plus NULL terminator.
   *
@@@ -9836,7 -9836,7 +9836,7 @@@ static struct snd_pci_quirk alc882_cfg_
  
        SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL),
  
 -      SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG),
 +      SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavilion", ALC883_6ST_DIG),
        SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP),
        SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP),
        SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
@@@ -14868,6 -14868,23 +14868,23 @@@ static void alc269_fixup_hweq(struct hd
        alc_write_coef_idx(codec, 0x1e, coef | 0x80);
  }
  
+ static void alc271_fixup_dmic(struct hda_codec *codec,
+                             const struct alc_fixup *fix, int action)
+ {
+       static struct hda_verb verbs[] = {
+               {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
+               {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
+               {}
+       };
+       unsigned int cfg;
+       if (strcmp(codec->chip_name, "ALC271X"))
+               return;
+       cfg = snd_hda_codec_get_pincfg(codec, 0x12);
+       if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
+               snd_hda_sequence_write(codec, verbs);
+ }
  enum {
        ALC269_FIXUP_SONY_VAIO,
        ALC275_FIXUP_SONY_VAIO_GPIO2,
        ALC269_FIXUP_ASUS_G73JW,
        ALC269_FIXUP_LENOVO_EAPD,
        ALC275_FIXUP_SONY_HWEQ,
+       ALC271_FIXUP_DMIC,
  };
  
  static const struct alc_fixup alc269_fixups[] = {
                .v.func = alc269_fixup_hweq,
                .chained = true,
                .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
-       }
+       },
+       [ALC271_FIXUP_DMIC] = {
+               .type = ALC_FIXUP_FUNC,
+               .v.func = alc271_fixup_dmic,
+       },
  };
  
  static struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
        SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
        SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
+       SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
        SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
        SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
        SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),