diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-03-22 09:36:50 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-03-22 10:15:51 -0400 |
commit | 26acaf08556a3c64ebf8ea3654b51e6acbb0a26c (patch) | |
tree | 03409c36091ab872c348d92b0721ff2c96a648a7 /sound | |
parent | 6681bc0deba495fad0d6fb349e40524abd1b1732 (diff) |
ALSA: hda/realtek - Fix ADC assignment with a shared HP/Mic pin
The recent Realtek driver tries to assign an extra input via the
headphone plug when only a single input source is found. The code
worked on Samsung Q1, but it broke ASUS 1015 where the mic is a
digital-mic and only a specific ADC works.
This patch fixes the assignment of ADC in the shared mic/hp case.
Instead of assuming the single ADC at first, reduce the ADCs after
trying to assign both mic and HP pins.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42973
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8ea2fd654327..9917e55d6f11 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2717,9 +2717,6 @@ static int alc_auto_fill_adc_caps(struct hda_codec *codec) | |||
2717 | int max_nums = ARRAY_SIZE(spec->private_adc_nids); | 2717 | int max_nums = ARRAY_SIZE(spec->private_adc_nids); |
2718 | int i, nums = 0; | 2718 | int i, nums = 0; |
2719 | 2719 | ||
2720 | if (spec->shared_mic_hp) | ||
2721 | max_nums = 1; /* no multi streams with the shared HP/mic */ | ||
2722 | |||
2723 | nid = codec->start_nid; | 2720 | nid = codec->start_nid; |
2724 | for (i = 0; i < codec->num_nodes; i++, nid++) { | 2721 | for (i = 0; i < codec->num_nodes; i++, nid++) { |
2725 | hda_nid_t src; | 2722 | hda_nid_t src; |
@@ -4076,6 +4073,7 @@ static void alc_remove_invalid_adc_nids(struct hda_codec *codec) | |||
4076 | if (spec->dyn_adc_switch) | 4073 | if (spec->dyn_adc_switch) |
4077 | return; | 4074 | return; |
4078 | 4075 | ||
4076 | again: | ||
4079 | nums = 0; | 4077 | nums = 0; |
4080 | for (n = 0; n < spec->num_adc_nids; n++) { | 4078 | for (n = 0; n < spec->num_adc_nids; n++) { |
4081 | hda_nid_t cap = spec->private_capsrc_nids[n]; | 4079 | hda_nid_t cap = spec->private_capsrc_nids[n]; |
@@ -4096,6 +4094,11 @@ static void alc_remove_invalid_adc_nids(struct hda_codec *codec) | |||
4096 | if (!nums) { | 4094 | if (!nums) { |
4097 | /* check whether ADC-switch is possible */ | 4095 | /* check whether ADC-switch is possible */ |
4098 | if (!alc_check_dyn_adc_switch(codec)) { | 4096 | if (!alc_check_dyn_adc_switch(codec)) { |
4097 | if (spec->shared_mic_hp) { | ||
4098 | spec->shared_mic_hp = 0; | ||
4099 | spec->private_imux[0].num_items = 1; | ||
4100 | goto again; | ||
4101 | } | ||
4099 | printk(KERN_WARNING "hda_codec: %s: no valid ADC found;" | 4102 | printk(KERN_WARNING "hda_codec: %s: no valid ADC found;" |
4100 | " using fallback 0x%x\n", | 4103 | " using fallback 0x%x\n", |
4101 | codec->chip_name, spec->private_adc_nids[0]); | 4104 | codec->chip_name, spec->private_adc_nids[0]); |
@@ -4113,7 +4116,7 @@ static void alc_remove_invalid_adc_nids(struct hda_codec *codec) | |||
4113 | 4116 | ||
4114 | if (spec->auto_mic) | 4117 | if (spec->auto_mic) |
4115 | alc_auto_mic_check_imux(codec); /* check auto-mic setups */ | 4118 | alc_auto_mic_check_imux(codec); /* check auto-mic setups */ |
4116 | else if (spec->input_mux->num_items == 1) | 4119 | else if (spec->input_mux->num_items == 1 || spec->shared_mic_hp) |
4117 | spec->num_adc_nids = 1; /* reduce to a single ADC */ | 4120 | spec->num_adc_nids = 1; /* reduce to a single ADC */ |
4118 | } | 4121 | } |
4119 | 4122 | ||