mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
ALSA: hda/realtek: update ALC222 depop optimize
commit ca0dedaff92307591f66c9206933fbdfe87add10 upstream. Add ALC222 its own depop functions for alc_init and alc_shutup. [note: this fixes pop noise issues on the models with two headphone jacks -- tiwai ] Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
dc209114b2
commit
010cd94654
@@ -3831,6 +3831,79 @@ static void alc225_shutup(struct hda_codec *codec)
|
||||
}
|
||||
}
|
||||
|
||||
static void alc222_init(struct hda_codec *codec)
|
||||
{
|
||||
struct alc_spec *spec = codec->spec;
|
||||
hda_nid_t hp_pin = alc_get_hp_pin(spec);
|
||||
bool hp1_pin_sense, hp2_pin_sense;
|
||||
|
||||
if (!hp_pin)
|
||||
return;
|
||||
|
||||
msleep(30);
|
||||
|
||||
hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
|
||||
hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
|
||||
|
||||
if (hp1_pin_sense || hp2_pin_sense) {
|
||||
msleep(2);
|
||||
|
||||
if (hp1_pin_sense)
|
||||
snd_hda_codec_write(codec, hp_pin, 0,
|
||||
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
|
||||
if (hp2_pin_sense)
|
||||
snd_hda_codec_write(codec, 0x14, 0,
|
||||
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
|
||||
msleep(75);
|
||||
|
||||
if (hp1_pin_sense)
|
||||
snd_hda_codec_write(codec, hp_pin, 0,
|
||||
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
|
||||
if (hp2_pin_sense)
|
||||
snd_hda_codec_write(codec, 0x14, 0,
|
||||
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
|
||||
|
||||
msleep(75);
|
||||
}
|
||||
}
|
||||
|
||||
static void alc222_shutup(struct hda_codec *codec)
|
||||
{
|
||||
struct alc_spec *spec = codec->spec;
|
||||
hda_nid_t hp_pin = alc_get_hp_pin(spec);
|
||||
bool hp1_pin_sense, hp2_pin_sense;
|
||||
|
||||
if (!hp_pin)
|
||||
hp_pin = 0x21;
|
||||
|
||||
hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
|
||||
hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
|
||||
|
||||
if (hp1_pin_sense || hp2_pin_sense) {
|
||||
msleep(2);
|
||||
|
||||
if (hp1_pin_sense)
|
||||
snd_hda_codec_write(codec, hp_pin, 0,
|
||||
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
|
||||
if (hp2_pin_sense)
|
||||
snd_hda_codec_write(codec, 0x14, 0,
|
||||
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
|
||||
|
||||
msleep(75);
|
||||
|
||||
if (hp1_pin_sense)
|
||||
snd_hda_codec_write(codec, hp_pin, 0,
|
||||
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
|
||||
if (hp2_pin_sense)
|
||||
snd_hda_codec_write(codec, 0x14, 0,
|
||||
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
|
||||
|
||||
msleep(75);
|
||||
}
|
||||
alc_auto_setup_eapd(codec, false);
|
||||
alc_shutup_pins(codec);
|
||||
}
|
||||
|
||||
static void alc_default_init(struct hda_codec *codec)
|
||||
{
|
||||
struct alc_spec *spec = codec->spec;
|
||||
@@ -11111,8 +11184,11 @@ static int patch_alc269(struct hda_codec *codec)
|
||||
spec->codec_variant = ALC269_TYPE_ALC300;
|
||||
spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
|
||||
break;
|
||||
case 0x10ec0222:
|
||||
case 0x10ec0623:
|
||||
spec->codec_variant = ALC269_TYPE_ALC623;
|
||||
spec->shutup = alc222_shutup;
|
||||
spec->init_hook = alc222_init;
|
||||
break;
|
||||
case 0x10ec0700:
|
||||
case 0x10ec0701:
|
||||
|
||||
Reference in New Issue
Block a user