Skip to content

Commit 1fa7b09

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek - FIxed ALC285 headphone no sound
Dell platform with ALC215 ALC285 ALC289 ALC225 ALC295 ALC299, plug headphone or headset. It had a chance to get no sound from headphone. Replace depop procedure will solve this issue. Signed-off-by: Kailang Yang <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 9b82ff1 commit 1fa7b09

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5090,6 +5090,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
50905090
case 0x10ec0295:
50915091
case 0x10ec0289:
50925092
case 0x10ec0299:
5093+
alc_hp_mute_disable(codec, 75);
50935094
alc_process_coef_fw(codec, alc225_pre_hsmode);
50945095
alc_process_coef_fw(codec, coef0225);
50955096
break;
@@ -5315,6 +5316,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
53155316
case 0x10ec0299:
53165317
alc_process_coef_fw(codec, alc225_pre_hsmode);
53175318
alc_process_coef_fw(codec, coef0225);
5319+
alc_hp_enable_unmute(codec, 75);
53185320
break;
53195321
case 0x10ec0255:
53205322
alc_process_coef_fw(codec, coef0255);
@@ -5474,6 +5476,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
54745476
alc_process_coef_fw(codec, coef0225_2);
54755477
else
54765478
alc_process_coef_fw(codec, coef0225_1);
5479+
alc_hp_enable_unmute(codec, 75);
54775480
break;
54785481
case 0x10ec0867:
54795482
alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
@@ -5579,6 +5582,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
55795582
case 0x10ec0289:
55805583
case 0x10ec0299:
55815584
alc_process_coef_fw(codec, coef0225);
5585+
alc_hp_enable_unmute(codec, 75);
55825586
break;
55835587
}
55845588
codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
@@ -5738,12 +5742,6 @@ static void alc_determine_headset_type(struct hda_codec *codec)
57385742
case 0x10ec0295:
57395743
case 0x10ec0289:
57405744
case 0x10ec0299:
5741-
snd_hda_codec_write(codec, 0x21, 0,
5742-
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5743-
msleep(80);
5744-
snd_hda_codec_write(codec, 0x21, 0,
5745-
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5746-
57475745
alc_process_coef_fw(codec, alc225_pre_hsmode);
57485746
alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
57495747
val = alc_read_coef_idx(codec, 0x45);
@@ -5760,15 +5758,19 @@ static void alc_determine_headset_type(struct hda_codec *codec)
57605758
val = alc_read_coef_idx(codec, 0x46);
57615759
is_ctia = (val & 0x00f0) == 0x00f0;
57625760
}
5761+
if (!is_ctia) {
5762+
alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10);
5763+
alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5764+
msleep(100);
5765+
val = alc_read_coef_idx(codec, 0x46);
5766+
if ((val & 0x00f0) == 0x00f0)
5767+
is_ctia = false;
5768+
else
5769+
is_ctia = true;
5770+
}
57635771
alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
57645772
alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
57655773
alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5766-
5767-
snd_hda_codec_write(codec, 0x21, 0,
5768-
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5769-
msleep(80);
5770-
snd_hda_codec_write(codec, 0x21, 0,
5771-
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
57725774
break;
57735775
case 0x10ec0867:
57745776
is_ctia = true;

0 commit comments

Comments
 (0)