From dc13b765c57c907ca98fec4296b27e164e1a2ba0 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Wed, 27 Jun 2012 18:45:45 +0200 Subject: [PATCH] --- yaml --- r: 316146 b: refs/heads/master c: 5780b627e24113323427c102175296ae43dfb9d7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/patch_realtek.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 3b95cf61cd7e..4a3c6f0585e1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 00227f15a0ad8401d2b0b67905da63e75b544895 +refs/heads/master: 5780b627e24113323427c102175296ae43dfb9d7 diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index 40dda2a83774..f912d74438a6 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -2001,13 +2001,31 @@ static int __alc_build_controls(struct hda_codec *codec) return 0; } -static int alc_build_controls(struct hda_codec *codec) +static int alc_build_jacks(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; + + if (spec->shared_mic_hp) { + int err; + int nid = spec->autocfg.inputs[1].pin; + err = snd_hda_jack_add_kctl(codec, nid, "Headphone Mic", 0); + if (err < 0) + return err; + err = snd_hda_jack_detect_enable(codec, nid, 0); + if (err < 0) + return err; + } + + return snd_hda_jack_add_kctls(codec, &spec->autocfg); +} + +static int alc_build_controls(struct hda_codec *codec) +{ int err = __alc_build_controls(codec); if (err < 0) return err; - err = snd_hda_jack_add_kctls(codec, &spec->autocfg); + + err = alc_build_jacks(codec); if (err < 0) return err; alc_apply_fixup(codec, ALC_FIXUP_ACT_BUILD);