aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLydia Wang <lydiawang@viatech.com.cn>2011-03-24 00:43:44 -0400
committerTakashi Iwai <tiwai@suse.de>2011-03-24 02:47:15 -0400
commitec7e7e42da0b33c77f1baafeac93e5128c4eea7a (patch)
tree5828c78744ca3989d861d28354f074e96b56d5b5 /sound
parenteadb9a804de223ef899ebb64aa037fa0da7bdee9 (diff)
ALSA: hda - VIA: Update unsolicited event function
Update unsolicited event process function via_unsol_event() to make it can process more unsolicited events. Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_via.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index ae9fdaa955f0..15b57a101aa0 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -234,12 +234,12 @@ static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec)
234 return codec_type; 234 return codec_type;
235}; 235};
236 236
237#define VIA_JACK_EVENT 0x20
237#define VIA_HP_EVENT 0x01 238#define VIA_HP_EVENT 0x01
238#define VIA_GPIO_EVENT 0x02 239#define VIA_GPIO_EVENT 0x02
239#define VIA_JACK_EVENT 0x04 240#define VIA_MONO_EVENT 0x03
240#define VIA_MONO_EVENT 0x08 241#define VIA_SPEAKER_EVENT 0x04
241#define VIA_SPEAKER_EVENT 0x10 242#define VIA_BIND_HP_EVENT 0x05
242#define VIA_BIND_HP_EVENT 0x20
243 243
244enum { 244enum {
245 VIA_CTL_WIDGET_VOL, 245 VIA_CTL_WIDGET_VOL,
@@ -1746,17 +1746,21 @@ static void via_unsol_event(struct hda_codec *codec,
1746 unsigned int res) 1746 unsigned int res)
1747{ 1747{
1748 res >>= 26; 1748 res >>= 26;
1749 if (res & VIA_HP_EVENT) 1749
1750 via_hp_automute(codec);
1751 if (res & VIA_GPIO_EVENT)
1752 via_gpio_control(codec);
1753 if (res & VIA_JACK_EVENT) 1750 if (res & VIA_JACK_EVENT)
1754 set_widgets_power_state(codec); 1751 set_widgets_power_state(codec);
1755 if (res & VIA_MONO_EVENT) 1752
1753 res &= ~VIA_JACK_EVENT;
1754
1755 if (res == VIA_HP_EVENT)
1756 via_hp_automute(codec);
1757 else if (res == VIA_GPIO_EVENT)
1758 via_gpio_control(codec);
1759 else if (res == VIA_MONO_EVENT)
1756 via_mono_automute(codec); 1760 via_mono_automute(codec);
1757 if (res & VIA_SPEAKER_EVENT) 1761 else if (res == VIA_SPEAKER_EVENT)
1758 via_speaker_automute(codec); 1762 via_speaker_automute(codec);
1759 if (res & VIA_BIND_HP_EVENT) 1763 else if (res == VIA_BIND_HP_EVENT)
1760 via_hp_bind_automute(codec); 1764 via_hp_bind_automute(codec);
1761} 1765}
1762 1766