summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-22 07:46:31 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-22 14:12:42 +0100
commit92603c594579e744a13b06efbbebb126db254655 (patch)
treef82f9c04a1ac384b25a96e2b2575743fa440910f
parenta607148ff3b9f40427c0f0d5fa039a3a758735c7 (diff)
ALSA: hda - Disable HP auto-mute during independent HP mode
Both the HP auto-mute and the independent HP mode conflict with each other. Make HP auto-mute disabled (only for the affected HP jack) during the driver is in HP independent mode. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_generic.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 63d12efb7c1a..258fb5ee75c5 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1889,6 +1889,13 @@ static int indep_hp_put(struct snd_kcontrol *kcontrol,
*dacp = 0;
else
*dacp = spec->alt_dac_nid;
+
+ /* update HP auto-mute state too */
+ if (spec->hp_automute_hook)
+ spec->hp_automute_hook(codec, NULL);
+ else
+ snd_hda_gen_hp_automute(codec, NULL);
+
ret = 1;
}
unlock:
@@ -3467,10 +3474,16 @@ static void call_update_outputs(struct hda_codec *codec)
void snd_hda_gen_hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
{
struct hda_gen_spec *spec = codec->spec;
+ hda_nid_t *pins = spec->autocfg.hp_pins;
+ int num_pins = ARRAY_SIZE(spec->autocfg.hp_pins);
+
+ /* No detection for the first HP jack during indep-HP mode */
+ if (spec->indep_hp_enabled) {
+ pins++;
+ num_pins--;
+ }
- spec->hp_jack_present =
- detect_jacks(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
- spec->autocfg.hp_pins);
+ spec->hp_jack_present = detect_jacks(codec, num_pins, pins);
if (!spec->detect_hp || (!spec->automute_speaker && !spec->automute_lo))
return;
call_update_outputs(codec);