Skip to content

Commit bde1a74

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek - Fixed headphone issue for ALC700
If it plugged headphone or headset into the jack, then do the reboot, it will have a chance to cause headphone no sound. It just need to run the headphone mode procedure after boot time. The issue will be fixed. It also suitable for ALC234 ALC274 and ALC294. Signed-off-by: Kailang Yang <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent b72f936 commit bde1a74

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7227,6 +7227,37 @@ static void alc269_fill_coef(struct hda_codec *codec)
72277227
alc_update_coef_idx(codec, 0x4, 0, 1<<11);
72287228
}
72297229

7230+
static void alc294_hp_init(struct hda_codec *codec)
7231+
{
7232+
struct alc_spec *spec = codec->spec;
7233+
hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
7234+
int i, val;
7235+
7236+
if (!hp_pin)
7237+
return;
7238+
7239+
snd_hda_codec_write(codec, hp_pin, 0,
7240+
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
7241+
7242+
msleep(100);
7243+
7244+
snd_hda_codec_write(codec, hp_pin, 0,
7245+
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7246+
7247+
alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
7248+
alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
7249+
7250+
/* Wait for depop procedure finish */
7251+
val = alc_read_coefex_idx(codec, 0x58, 0x01);
7252+
for (i = 0; i < 20 && val & 0x0080; i++) {
7253+
msleep(50);
7254+
val = alc_read_coefex_idx(codec, 0x58, 0x01);
7255+
}
7256+
/* Set HP depop to auto mode */
7257+
alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
7258+
msleep(50);
7259+
}
7260+
72307261
/*
72317262
*/
72327263
static int patch_alc269(struct hda_codec *codec)
@@ -7352,6 +7383,7 @@ static int patch_alc269(struct hda_codec *codec)
73527383
spec->codec_variant = ALC269_TYPE_ALC294;
73537384
spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
73547385
alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7386+
alc294_hp_init(codec);
73557387
break;
73567388
case 0x10ec0300:
73577389
spec->codec_variant = ALC269_TYPE_ALC300;
@@ -7363,6 +7395,7 @@ static int patch_alc269(struct hda_codec *codec)
73637395
spec->codec_variant = ALC269_TYPE_ALC700;
73647396
spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
73657397
alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7398+
alc294_hp_init(codec);
73667399
break;
73677400

73687401
}

0 commit comments

Comments
 (0)