summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-06-27 18:45:45 +0200
committerTakashi Iwai <tiwai@suse.de>2012-06-27 20:21:02 +0200
commit5780b627e24113323427c102175296ae43dfb9d7 (patch)
tree15fcd9c33738a4a776c5d5d351f223c26ebeedbd /sound/pci
parent00227f15a0ad8401d2b0b67905da63e75b544895 (diff)
ALSA: hda - give 3-pin jack the name "Headphone Mic Jack"
This 3-pin jack was labeled "Headphone Jack", but it could also be used as a mic jack just by switching "Input Source". Therefore we need to call the jack something else, to make sure PulseAudio can use the speaker together with the external mic. (PulseAudio might mute the speaker if it detects a headphone being plugged in.) Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 40dda2a83774..f912d74438a6 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/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);