Commit 1387e2d12799e554df2f60e7ae7fe01384bcb96f

Authored by Kailang Yang
Committed by Takashi Iwai
1 parent f58161ba1b

ALSA: hda - Improve HP depop when system enter to S3

alc269_toggle_power_output() was only use in ALC269VB.  I rename it to
alc269vb_toggle_power_output().

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 11 additions and 13 deletions Side-by-side Diff

sound/pci/hda/patch_realtek.c
... ... @@ -5840,7 +5840,7 @@
5840 5840 return alc_parse_auto_config(codec, alc269_ignore, ssids);
5841 5841 }
5842 5842  
5843   -static void alc269_toggle_power_output(struct hda_codec *codec, int power_up)
  5843 +static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
5844 5844 {
5845 5845 int val = alc_read_coef_idx(codec, 0x04);
5846 5846 if (power_up)
... ... @@ -5857,10 +5857,10 @@
5857 5857 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
5858 5858 return;
5859 5859  
5860   - if ((alc_get_coef0(codec) & 0x00ff) == 0x017)
5861   - alc269_toggle_power_output(codec, 0);
5862   - if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
5863   - alc269_toggle_power_output(codec, 0);
  5860 + if (spec->codec_variant == ALC269_TYPE_ALC269VB)
  5861 + alc269vb_toggle_power_output(codec, 0);
  5862 + if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
  5863 + (alc_get_coef0(codec) & 0x00ff) == 0x018) {
5864 5864 msleep(150);
5865 5865 }
5866 5866 }
5867 5867  
5868 5868  
5869 5869  
5870 5870  
... ... @@ -5870,23 +5870,21 @@
5870 5870 {
5871 5871 struct alc_spec *spec = codec->spec;
5872 5872  
5873   - if (spec->codec_variant == ALC269_TYPE_ALC269VB ||
  5873 + if (spec->codec_variant == ALC269_TYPE_ALC269VB)
  5874 + alc269vb_toggle_power_output(codec, 0);
  5875 + if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
5874 5876 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
5875   - alc269_toggle_power_output(codec, 0);
5876 5877 msleep(150);
5877 5878 }
5878 5879  
5879 5880 codec->patch_ops.init(codec);
5880 5881  
5881   - if (spec->codec_variant == ALC269_TYPE_ALC269VB ||
  5882 + if (spec->codec_variant == ALC269_TYPE_ALC269VB)
  5883 + alc269vb_toggle_power_output(codec, 1);
  5884 + if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
5882 5885 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
5883   - alc269_toggle_power_output(codec, 1);
5884 5886 msleep(200);
5885 5887 }
5886   -
5887   - if (spec->codec_variant == ALC269_TYPE_ALC269VB ||
5888   - (alc_get_coef0(codec) & 0x00ff) == 0x018)
5889   - alc269_toggle_power_output(codec, 1);
5890 5888  
5891 5889 snd_hda_codec_resume_amp(codec);
5892 5890 snd_hda_codec_resume_cache(codec);