aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2015-05-12 08:38:15 -0400
committerTakashi Iwai <tiwai@suse.de>2015-05-18 02:19:57 -0400
commit1f8b46cdc806dfd76386f8442d9a6d0ae69abb25 (patch)
tree5e8105a1671cf85b4e57bf92187485508f2a0023
parent9b5a4e395c2f39fae89f75e4a749be5dba342d22 (diff)
ALSA: hda - Fix headset mic and mic-in for a Dell desktop
ALC662 does not need any special verbs to change the jack functionality, and enables mic in through the headphone jack mode by changing the direction of the headphone pin node. BugLink: https://bugs.launchpad.net/bugs/1454235 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 37c2c9f91df0..4202a80db2ce 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3674,6 +3674,10 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
3674 alc_process_coef_fw(codec, coef0293); 3674 alc_process_coef_fw(codec, coef0293);
3675 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 3675 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
3676 break; 3676 break;
3677 case 0x10ec0662:
3678 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
3679 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
3680 break;
3677 case 0x10ec0668: 3681 case 0x10ec0668:
3678 alc_write_coef_idx(codec, 0x11, 0x0001); 3682 alc_write_coef_idx(codec, 0x11, 0x0001);
3679 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 3683 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
@@ -4012,7 +4016,7 @@ static void alc_update_headset_mode(struct hda_codec *codec)
4012 if (new_headset_mode != ALC_HEADSET_MODE_MIC) { 4016 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
4013 snd_hda_set_pin_ctl_cache(codec, hp_pin, 4017 snd_hda_set_pin_ctl_cache(codec, hp_pin,
4014 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); 4018 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
4015 if (spec->headphone_mic_pin) 4019 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
4016 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, 4020 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
4017 PIN_VREFHIZ); 4021 PIN_VREFHIZ);
4018 } 4022 }
@@ -4215,6 +4219,18 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec,
4215 } 4219 }
4216} 4220}
4217 4221
4222static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
4223 const struct hda_fixup *fix, int action)
4224{
4225 struct alc_spec *spec = codec->spec;
4226
4227 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4228 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4229 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
4230 } else
4231 alc_fixup_headset_mode(codec, fix, action);
4232}
4233
4218static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, 4234static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
4219 const struct hda_fixup *fix, int action) 4235 const struct hda_fixup *fix, int action)
4220{ 4236{
@@ -6087,7 +6103,9 @@ enum {
6087 ALC662_FIXUP_NO_JACK_DETECT, 6103 ALC662_FIXUP_NO_JACK_DETECT,
6088 ALC662_FIXUP_ZOTAC_Z68, 6104 ALC662_FIXUP_ZOTAC_Z68,
6089 ALC662_FIXUP_INV_DMIC, 6105 ALC662_FIXUP_INV_DMIC,
6106 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
6090 ALC668_FIXUP_DELL_MIC_NO_PRESENCE, 6107 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
6108 ALC662_FIXUP_HEADSET_MODE,
6091 ALC668_FIXUP_HEADSET_MODE, 6109 ALC668_FIXUP_HEADSET_MODE,
6092 ALC662_FIXUP_BASS_MODE4_CHMAP, 6110 ALC662_FIXUP_BASS_MODE4_CHMAP,
6093 ALC662_FIXUP_BASS_16, 6111 ALC662_FIXUP_BASS_16,
@@ -6280,6 +6298,20 @@ static const struct hda_fixup alc662_fixups[] = {
6280 .chained = true, 6298 .chained = true,
6281 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE 6299 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
6282 }, 6300 },
6301 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
6302 .type = HDA_FIXUP_PINS,
6303 .v.pins = (const struct hda_pintbl[]) {
6304 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
6305 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
6306 { }
6307 },
6308 .chained = true,
6309 .chain_id = ALC662_FIXUP_HEADSET_MODE
6310 },
6311 [ALC662_FIXUP_HEADSET_MODE] = {
6312 .type = HDA_FIXUP_FUNC,
6313 .v.func = alc_fixup_headset_mode_alc662,
6314 },
6283 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { 6315 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
6284 .type = HDA_FIXUP_PINS, 6316 .type = HDA_FIXUP_PINS,
6285 .v.pins = (const struct hda_pintbl[]) { 6317 .v.pins = (const struct hda_pintbl[]) {
@@ -6431,6 +6463,18 @@ static const struct hda_model_fixup alc662_fixup_models[] = {
6431}; 6463};
6432 6464
6433static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 6465static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
6466 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
6467 {0x12, 0x4004c000},
6468 {0x14, 0x01014010},
6469 {0x15, 0x411111f0},
6470 {0x16, 0x411111f0},
6471 {0x18, 0x01a19020},
6472 {0x19, 0x411111f0},
6473 {0x1a, 0x0181302f},
6474 {0x1b, 0x0221401f},
6475 {0x1c, 0x411111f0},
6476 {0x1d, 0x4054c601},
6477 {0x1e, 0x411111f0}),
6434 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 6478 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6435 {0x12, 0x99a30130}, 6479 {0x12, 0x99a30130},
6436 {0x14, 0x90170110}, 6480 {0x14, 0x90170110},