From 21ce0b65272b85f122455818b0c69740945b451a Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 11 Jul 2011 10:33:47 +0200
Subject: [PATCH] ALSA: hda - Via Fix speaker-mute checks in VIA driver
Git-commit: 21ce0b65272b85f122455818b0c69740945b451a
Patch-mainline: 3.1-rc2
References: FATE#314310

When the line-jack is plugged/unplugged, the driver must check also
the headphone jack state in addition to the line-out jack.  Currently
it checks only the line-out state and ignores the headphone.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/patch_via.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -1606,12 +1606,10 @@ static void via_unsol_event(struct hda_c
 
 	res &= ~VIA_JACK_EVENT;
 
-	if (res == VIA_HP_EVENT)
+	if (res == VIA_HP_EVENT || res == VIA_LINE_EVENT)
 		via_hp_automute(codec);
 	else if (res == VIA_GPIO_EVENT)
 		via_gpio_control(codec);
-	else if (res == VIA_LINE_EVENT)
-		via_line_automute(codec, false);
 }
 
 #ifdef SND_HDA_NEEDS_RESUME
@@ -2535,7 +2533,6 @@ static int via_init(struct hda_codec *co
 	via_auto_init_unsol_event(codec);
 
 	via_hp_automute(codec);
-	via_line_automute(codec, false);
 
 	return 0;
 }
