ALSA: hda/realtek: Enable audio jacks of ASUS D700SA with ALC887
PATCH 1/1 ALSA: hda/realtek: Enable audio jacks of ASUS D700SA with ALC887
The ASUS D700SA desktop's audio (1043:2390) with ALC887 cannot detect the headset microphone and another headphone jack until ALC887_FIXUP_ASUS_HMIC and ALC887_FIXUP_ASUS_AUDIO quirks are applied. The NID 0x15 maps as the headset microphone and NID 0x19 maps as another headphone jack. Also need the function like alc887_fixup_asus_jack to enable the audio jacks.
--- sound/pci/hda/patch_realtek.c | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
sound/pci/hda/patch_realtek.c +41 -0
@@ -1929,6 +1929,8 @@ enum {ALC1220_FIXUP_CLEVO_P950 ,ALC1220_FIXUP_CLEVO_PB51ED ,ALC1220_FIXUP_CLEVO_PB51ED_PINS , +ALC887_FIXUP_ASUS_AUDIO , + ALC887_FIXUP_ASUS_HMIC, }; static void alc889_fixup_coef(struct hda_codec *codec,
@@ -2141,6 +2143,30 @@ static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,alc_fixup_headset_mode_no_hp_mic (codec, fix, action); } +static void alc887_asus_hp_automute_hook (struct hda_codec *codec, +struct hda_jack_callback *jack) +{ +struct alc_spec *spec = codec->spec; +int vref; + +snd_hda_gen_hp_automute (codec, jack); + + vref = spec->gen.hp_jack_present ?0xc4 :0xc0 ; +snd_hda_codec_write (codec,0x19 ,0 ,AC_VERB_SET_PIN_WIDGET_CONTROL , + vref); +} + +static void alc887_fixup_asus_jack (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +struct alc_spec *spec = codec->spec; +if (action !=HDA_FIXUP_ACT_PROBE ) +return ; +snd_hda_codec_write (codec,0x1b ,0 ,AC_VERB_SET_PIN_WIDGET_CONTROL , +0xc0 ); + spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; +} +static const struct hda_fixup alc882_fixups[] = { [ALC882_FIXUP_ABIT_AW9D_MAX ] = { .type =HDA_FIXUP_PINS ,
@@ -2398,6 +2424,20 @@ static const struct hda_fixup alc882_fixups[] = { .chained = true, .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, }, + [ALC887_FIXUP_ASUS_AUDIO] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x15 ,0x02a14150 },/* use as headset mic, without its own jack detect */ + {0x19 ,0x22219420 }, + {} + }, + }, + [ALC887_FIXUP_ASUS_HMIC] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc887_fixup_asus_jack, + .chained = true, + .chain_id = ALC887_FIXUP_ASUS_AUDIO, + }, };static const struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -2431,6 +2471,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x13c2 ,"Asus A7M" ,ALC882_FIXUP_EAPD ),SND_PCI_QUIRK (0x1043 ,0x1873 ,"ASUS W90V" ,ALC882_FIXUP_ASUS_W90V ),SND_PCI_QUIRK (0x1043 ,0x1971 ,"Asus W2JC" ,ALC882_FIXUP_ASUS_W2JC ), +SND_PCI_QUIRK (0x1043 ,0x2390 ,"Asus D700SA" ,ALC887_FIXUP_ASUS_HMIC ),SND_PCI_QUIRK (0x1043 ,0x835f ,"Asus Eee 1601" ,ALC888_FIXUP_EEE1601 ),SND_PCI_QUIRK (0x1043 ,0x84bc ,"ASUS ET2700" ,ALC887_FIXUP_ASUS_BASS ), SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
Signature · 1 line
2.28.0
Quoted 30 lines · Jian-Hong Pan
The ASUS D700SA desktop's audio (1043:2390) with ALC887 cannot detect the headset microphone and another headphone jack until
ALC887_FIXUP_ASUS_HMICandALC887_FIXUP_ASUS_AUDIOquirks are applied. The NID0x15maps as the headset microphone and NID0x19maps as another headphone jack. Also need the function likealc887_fixup_asus_jackto enable the audio jacks.Signed-off-by Jian-Hong Pan <[email protected]>Signed-off-by Kailang Yang <[email protected]>--- sound/pci/hda/patch_realtek.c | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)sound/pci/hda/patch_realtek.c +2
-0@@ -1929,6 +1929,8 @@ enum {ALC1220_FIXUP_CLEVO_P950 ,ALC1220_FIXUP_CLEVO_PB51ED ,ALC1220_FIXUP_CLEVO_PB51ED_PINS , +ALC887_FIXUP_ASUS_AUDIO , + ALC887_FIXUP_ASUS_HMIC, }; static void alc889_fixup_coef(struct hda_codec *codec,@@ -2141,6 +2143,30 @@ static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,alc_fixup_headset_mode_no_hp_mic (codec, fix, action); }
sound/pci/hda/patch_realtek.c static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, · line 2154
Quoted 10 lines
sound/pci/hda/patch_realtek.c +9
-0+static void alc887_asus_hp_automute_hook (struct hda_codec *codec, +struct hda_jack_callback *jack) +{ +struct alc_spec *spec = codec->spec; +int vref; + +snd_hda_gen_hp_automute (codec, jack); + + vref = spec->gen.hp_jack_present ?0xc4 :0xc0 ;
Use the AC_PINCTL_* instead of the raw numbers. Some values are shortened form in hda_local.h, too (e.g. 0xc0 = PIN_HP).
sound/pci/hda/patch_realtek.c static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, · line 2156
Quoted 2 lines
sound/pci/hda/patch_realtek.c +2
-0+snd_hda_codec_write (codec,0x19 ,0 ,AC_VERB_SET_PIN_WIDGET_CONTROL , + vref);
Better to use snd_hda_set_pin_ctl().
sound/pci/hda/patch_realtek.c static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, · line 2166
Quoted 10 lines
sound/pci/hda/patch_realtek.c +10
-0+} + +static void alc887_fixup_asus_jack (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +struct alc_spec *spec = codec->spec; +if (action !=HDA_FIXUP_ACT_PROBE ) +return ; +snd_hda_codec_write (codec,0x1b ,0 ,AC_VERB_SET_PIN_WIDGET_CONTROL , +0xc0 );
This one would be snd_hda_set_pin_ctl_cached(), so that it'll be restored at resume.
thanks,
Takashi
PATCH v2 1/1 ALSA: hda/realtek: Enable audio jacks of ASUS D700SA with ALC887
The ASUS D700SA desktop's audio (1043:2390) with ALC887 cannot detect the headset microphone and another headphone jack until ALC887_FIXUP_ASUS_HMIC and ALC887_FIXUP_ASUS_AUDIO quirks are applied. The NID 0x15 maps as the headset microphone and NID 0x19 maps as another headphone jack. Also need the function like alc887_fixup_asus_jack to enable the audio jacks.
---
v2:
- Change the magic numbers to meaningful macros.
- Change snd_hda_codec_write to snd_hda_set_pin_ctl and snd_hda_set_pin_ctl_cache accroding to Takashi's suggestion
sound/pci/hda/patch_realtek.c | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
sound/pci/hda/patch_realtek.c +42 -0
@@ -1929,6 +1929,8 @@ enum {ALC1220_FIXUP_CLEVO_P950 ,ALC1220_FIXUP_CLEVO_PB51ED ,ALC1220_FIXUP_CLEVO_PB51ED_PINS , +ALC887_FIXUP_ASUS_AUDIO , + ALC887_FIXUP_ASUS_HMIC, }; static void alc889_fixup_coef(struct hda_codec *codec,
@@ -2141,6 +2143,31 @@ static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,alc_fixup_headset_mode_no_hp_mic (codec, fix, action); } +static void alc887_asus_hp_automute_hook (struct hda_codec *codec, +struct hda_jack_callback *jack) +{ +struct alc_spec *spec = codec->spec; +unsigned int vref; + +snd_hda_gen_hp_automute (codec, jack); + +if (spec->gen.hp_jack_present) + vref =AC_PINCTL_VREF_80 ; +else + vref =AC_PINCTL_VREF_HIZ ; +snd_hda_set_pin_ctl (codec,0x19 ,PIN_HP | vref); +} + +static void alc887_fixup_asus_jack (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +struct alc_spec *spec = codec->spec; +if (action !=HDA_FIXUP_ACT_PROBE ) +return ; +snd_hda_set_pin_ctl_cache (codec,0x1b ,PIN_HP ); + spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; +} +static const struct hda_fixup alc882_fixups[] = { [ALC882_FIXUP_ABIT_AW9D_MAX ] = { .type =HDA_FIXUP_PINS ,
@@ -2398,6 +2425,20 @@ static const struct hda_fixup alc882_fixups[] = { .chained = true, .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, }, + [ALC887_FIXUP_ASUS_AUDIO] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x15 ,0x02a14150 },/* use as headset mic, without its own jack detect */ + {0x19 ,0x22219420 }, + {} + }, + }, + [ALC887_FIXUP_ASUS_HMIC] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc887_fixup_asus_jack, + .chained = true, + .chain_id = ALC887_FIXUP_ASUS_AUDIO, + }, };static const struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -2431,6 +2472,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x13c2 ,"Asus A7M" ,ALC882_FIXUP_EAPD ),SND_PCI_QUIRK (0x1043 ,0x1873 ,"ASUS W90V" ,ALC882_FIXUP_ASUS_W90V ),SND_PCI_QUIRK (0x1043 ,0x1971 ,"Asus W2JC" ,ALC882_FIXUP_ASUS_W2JC ), +SND_PCI_QUIRK (0x1043 ,0x2390 ,"Asus D700SA" ,ALC887_FIXUP_ASUS_HMIC ),SND_PCI_QUIRK (0x1043 ,0x835f ,"Asus Eee 1601" ,ALC888_FIXUP_EEE1601 ),SND_PCI_QUIRK (0x1043 ,0x84bc ,"ASUS ET2700" ,ALC887_FIXUP_ASUS_BASS ), SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
Signature · 1 line
2.28.0
Takashi Iwai
AppliedQuoted 8 lines · Jian-Hong Pan
The ASUS D700SA desktop's audio (1043:2390) with ALC887 cannot detect the headset microphone and another headphone jack until
ALC887_FIXUP_ASUS_HMICandALC887_FIXUP_ASUS_AUDIOquirks are applied. The NID0x15maps as the headset microphone and NID0x19maps as another headphone jack. Also need the function likealc887_fixup_asus_jackto enable the audio jacks.
Quoted 7 lines
Signed-off-by Jian-Hong Pan <[email protected]>Signed-off-by Kailang Yang <[email protected]>---
v2:
- Change the magic numbers to meaningful macros.
- Changesnd_hda_codec_writetosnd_hda_set_pin_ctlandsnd_hda_set_pin_ctl_cacheaccroding to Takashi's suggestion
Thanks, applied.
Takashi