Headset mic support on Asus X101CH
Bug #1169138 reported by
David Henningsson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HWE Next |
Fix Released
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
David Henningsson | ||
Bug Description
On the Asus X101CH, only the headphone part of the headset jack works by default, not the microphone.
This bug is for tracking purposes. Please do not triage.
Changed in linux (Ubuntu): | |
assignee: | nobody → David Henningsson (diwic) |
status: | New → In Progress |
tags: | added: blocks-hwcert-enablement |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in hwe-next: | |
status: | New → Fix Released |
To post a comment you must log in.
With this patch, a TRRS headset mic cannot be successfully detected
on the Asus X101CH, and we can also distinguish between headphone
and headset automatically.
Buglink: https:/ /bugs.launchpad .net/bugs/ 1169138
Co-authored-by: Kailang <email address hidden>
Tested-by: Luis Henriques <email address hidden>
Signed-off-by: David Henningsson <email address hidden>
---
Now that we have better headset mic support infrastructure, I remembered I forgot
to upstream this patch. It was originally provided by Realtek (therefore, I cannot
answer for the msleeps and exactly why this is needed). I just rewrote it for the
current kernel version.
sound/ pci/hda/ patch_realtek. c | 56 +++++++ +++++++ +++++++ +++++++ +++++++ ++++++
1 file changed, 56 insertions(+)
diff --git a/sound/ pci/hda/ patch_realtek. c b/sound/ pci/hda/ patch_realtek. c pci/hda/ patch_realtek. c pci/hda/ patch_realtek. c fixup_quanta_ mute(struct hda_codec *codec, >gen.automute_ hook = alc269_ quanta_ automute;
index 6cf27f5..1b7aed5 100644
--- a/sound/
+++ b/sound/
@@ -2680,6 +2680,34 @@ static void alc269_
spec-
}
+static void alc269_ x101_hp_ automute_ hook(struct hda_codec *codec, gen_hp_ automute( codec, jack); hp_jack_ present ? PIN_VREF80 : 0; codec_write( codec, 0x18, 0, AC_VERB_ SET_PIN_ WIDGET_ CONTROL, codec_write( codec, 0x18, 0, AC_VERB_ SET_PIN_ WIDGET_ CONTROL, fixup_x101_ headset_ mic(struct hda_codec *codec, ACT_PRE_ PROBE) { HEADSET_ MIC; hp_automute_ hook = alc269_ x101_hp_ automute_ hook; fixup_mic_ mute_hook( void *private_data, int enabled) FIXUP_INV_ DMIC, FIXUP_LENOVO_ DOCK, FIXUP_PINCFG_ NO_HP_TO_ LINEOUT, FIXUP_ASUS_ X101_FUNC, FIXUP_ASUS_ X101_VERB, FIXUP_ASUS_ X101, FIXUP_AMIC_ MIC2, FIXUP_HP_ GATE_MIC_ JACK, FIXUP_ACER_ AC700, fixup_pincfg_ no_hp_to_ lineout, FIXUP_ASUS_ X101_FUNC] = { fixup_x101_ headset_ mic, FIXUP_ASUS_ X101_VERB] = { SET_PIN_ WIDGET_ CONTROL, 0}, SET_COEF_ INDEX, 0x08}, SET_PROC_ COEF, 0x0310}, FIXUP_ASUS_ X101_FUNC FIXUP_ASUS_ X101] = { FIXUP_ASUS_ X101_VERB FIXUP_AMIC_ MIC2] = {
+ struct hda_jack_tbl *jack)
+{
+ struct alc_spec *spec = codec->spec;
+ int vref;
+ msleep(200);
+ snd_hda_
+
+ vref = spec->gen.
+ msleep(100);
+ snd_hda_
+ vref);
+ msleep(500);
+ snd_hda_
+ vref);
+}
+
+static void alc269_
+ const struct hda_fixup *fix, int action)
+{
+ struct alc_spec *spec = codec->spec;
+ if (action == HDA_FIXUP_
+ spec->parse_flags |= HDA_PINCFG_
+ spec->gen.
+ }
+}
+
+
/* update mute-LED according to the speaker mute state via mic VREF pin */
static void alc269_
{
@@ -2837,6 +2865,9 @@ enum {
ALC269_
ALC269_
ALC269_
+ ALC269_
+ ALC269_
+ ALC269_
ALC271_
ALC271_
ALC269_
@@ -2996,6 +3027,30 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc269_
},
+ [ALC269_
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc269_
+ },
+ [ALC269_
+ .type = HDA_FIXUP_VERBS,
+ .v.verbs = (const struct hda_verb[]) {
+ {0x18, AC_VERB_
+ {0x20, AC_VERB_
+ {0x20, AC_VERB_
+ { }
+ },
+ .chained = true,
+ .chain_id = ALC269_
+ },
+ [ALC269_
+ .type = HDA_FIXUP_PINS,
+ .v.pins = (const struct hda_pintbl[]) {
+ { 0x18, 0x04a1182c }, /* Headset mic */
+ { }
+ },
+ .chained = true,
+ .chain_id = ALC269_
+ },
[ALC271_
.type = HDA_FIX...