* [PATCH 6/6] ALSA: VIA HDA: Update unsolicited event function
@ 2011-03-24 4:43 Lydia Wang
0 siblings, 0 replies; only message in thread
From: Lydia Wang @ 2011-03-24 4:43 UTC (permalink / raw)
To: alsa-devel; +Cc: tiwai, HaraldWelte, lydiawang
From: Lydia Wang <lydiawang@viatech.com.cn>
Subject: ALSA: VIA HDA: 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>
---
sound/pci/hda/patch_via.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -234,12 +234,12 @@
return codec_type;
};
+#define VIA_JACK_EVENT 0x20
#define VIA_HP_EVENT 0x01
#define VIA_GPIO_EVENT 0x02
-#define VIA_JACK_EVENT 0x04
-#define VIA_MONO_EVENT 0x08
-#define VIA_SPEAKER_EVENT 0x10
-#define VIA_BIND_HP_EVENT 0x20
+#define VIA_MONO_EVENT 0x03
+#define VIA_SPEAKER_EVENT 0x04
+#define VIA_BIND_HP_EVENT 0x05
enum {
VIA_CTL_WIDGET_VOL,
@@ -1746,17 +1746,21 @@
unsigned int res)
{
res >>= 26;
- if (res & VIA_HP_EVENT)
- via_hp_automute(codec);
- if (res & VIA_GPIO_EVENT)
- via_gpio_control(codec);
+
if (res & VIA_JACK_EVENT)
set_widgets_power_state(codec);
- if (res & VIA_MONO_EVENT)
+
+ res &= ~VIA_JACK_EVENT;
+
+ if (res == VIA_HP_EVENT)
+ via_hp_automute(codec);
+ else if (res == VIA_GPIO_EVENT)
+ via_gpio_control(codec);
+ else if (res == VIA_MONO_EVENT)
via_mono_automute(codec);
- if (res & VIA_SPEAKER_EVENT)
+ else if (res == VIA_SPEAKER_EVENT)
via_speaker_automute(codec);
- if (res & VIA_BIND_HP_EVENT)
+ else if (res == VIA_BIND_HP_EVENT)
via_hp_bind_automute(codec);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-24 4:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 4:43 [PATCH 6/6] ALSA: VIA HDA: Update unsolicited event function Lydia Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.