diff options
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 22 |
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) | |||
2001 | return 0; | 2001 | return 0; |
2002 | } | 2002 | } |
2003 | 2003 | ||
2004 | static int alc_build_controls(struct hda_codec *codec) | 2004 | static int alc_build_jacks(struct hda_codec *codec) |
2005 | { | 2005 | { |
2006 | struct alc_spec *spec = codec->spec; | 2006 | struct alc_spec *spec = codec->spec; |
2007 | |||
2008 | if (spec->shared_mic_hp) { | ||
2009 | int err; | ||
2010 | int nid = spec->autocfg.inputs[1].pin; | ||
2011 | err = snd_hda_jack_add_kctl(codec, nid, "Headphone Mic", 0); | ||
2012 | if (err < 0) | ||
2013 | return err; | ||
2014 | err = snd_hda_jack_detect_enable(codec, nid, 0); | ||
2015 | if (err < 0) | ||
2016 | return err; | ||
2017 | } | ||
2018 | |||
2019 | return snd_hda_jack_add_kctls(codec, &spec->autocfg); | ||
2020 | } | ||
2021 | |||
2022 | static int alc_build_controls(struct hda_codec *codec) | ||
2023 | { | ||
2007 | int err = __alc_build_controls(codec); | 2024 | int err = __alc_build_controls(codec); |
2008 | if (err < 0) | 2025 | if (err < 0) |
2009 | return err; | 2026 | return err; |
2010 | err = snd_hda_jack_add_kctls(codec, &spec->autocfg); | 2027 | |
2028 | err = alc_build_jacks(codec); | ||
2011 | if (err < 0) | 2029 | if (err < 0) |
2012 | return err; | 2030 | return err; |
2013 | alc_apply_fixup(codec, ALC_FIXUP_ACT_BUILD); | 2031 | alc_apply_fixup(codec, ALC_FIXUP_ACT_BUILD); |