Merge branch 'fix/hda' into topic/hda
authorTakashi Iwai <tiwai@suse.de>
Tue, 21 Sep 2010 15:40:48 +0000 (17:40 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 21 Sep 2010 15:40:48 +0000 (17:40 +0200)
1  2 
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_realtek.c

Simple merge
@@@ -14654,71 -14451,28 +14654,80 @@@ static void alc269_auto_init(struct hda
                alc_inithook(codec);
  }
  
 +#ifdef SND_HDA_NEEDS_RESUME
 +static void alc269_toggle_power_output(struct hda_codec *codec, int power_up)
 +{
 +      int val = alc_read_coef_idx(codec, 0x04);
 +      if (power_up)
 +              val |= 1 << 11;
 +      else
 +              val &= ~(1 << 11);
 +      alc_write_coef_idx(codec, 0x04, val);
 +}
 +
 +#ifdef CONFIG_SND_HDA_POWER_SAVE
 +static int alc269_suspend(struct hda_codec *codec, pm_message_t state)
 +{
 +      struct alc_spec *spec = codec->spec;
 +
 +      if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017)
 +              alc269_toggle_power_output(codec, 0);
 +      if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
 +              alc269_toggle_power_output(codec, 0);
 +              msleep(150);
 +      }
 +
 +      alc_shutup(codec);
 +      if (spec && spec->power_hook)
 +              spec->power_hook(codec);
 +      return 0;
 +}
 +#endif /* CONFIG_SND_HDA_POWER_SAVE */
 +
 +static int alc269_resume(struct hda_codec *codec)
 +{
 +      if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
 +              alc269_toggle_power_output(codec, 0);
 +              msleep(150);
 +      }
 +
 +      codec->patch_ops.init(codec);
 +
 +      if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017) {
 +              alc269_toggle_power_output(codec, 1);
 +              msleep(200);
 +      }
 +
 +      if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018)
 +              alc269_toggle_power_output(codec, 1);
 +
 +      snd_hda_codec_resume_amp(codec);
 +      snd_hda_codec_resume_cache(codec);
 +      hda_call_check_power_status(codec, 0x01);
 +      return 0;
 +}
 +#endif /* SND_HDA_NEEDS_RESUME */
 +
  enum {
        ALC269_FIXUP_SONY_VAIO,
+       ALC269_FIXUP_DELL_M101Z,
  };
  
 -static const struct hda_verb alc269_sony_vaio_fixup_verbs[] = {
 -      {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
 -      {}
 -};
 -
  static const struct alc_fixup alc269_fixups[] = {
        [ALC269_FIXUP_SONY_VAIO] = {
 -              .verbs = alc269_sony_vaio_fixup_verbs
 +              .verbs = (const struct hda_verb[]) {
 +                      {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
 +                      {}
 +              }
        },
+       [ALC269_FIXUP_DELL_M101Z] = {
+               .verbs = (const struct hda_verb[]) {
+                       /* Enables internal speaker */
+                       {0x20, AC_VERB_SET_COEF_INDEX, 13},
+                       {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
+                       {}
+               }
+       },
  };
  
  static struct snd_pci_quirk alc269_fixup_tbl[] = {