diff options
author | Lydia Wang <lydiawang@viatech.com.cn> | 2009-10-10 07:08:01 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-10-11 11:57:10 -0400 |
commit | a34df19a658170fb7125e8017ee46ba54b1ad495 (patch) | |
tree | c89fe8de889d59d8e8891c16254a15d48db1a66f /sound/pci/hda/patch_via.c | |
parent | a80e6e3c8c21ca50837e2e42fa438a4ff4a9788e (diff) |
ALSA: HDA VIA: Add VIA_JACK_EVENT process in via_unsol_event.
Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Logan Li <loganli@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r-- | sound/pci/hda/patch_via.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index c5e99944990a..cd62c88b5246 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -124,6 +124,7 @@ static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec) | |||
124 | 124 | ||
125 | #define VIA_HP_EVENT 0x01 | 125 | #define VIA_HP_EVENT 0x01 |
126 | #define VIA_GPIO_EVENT 0x02 | 126 | #define VIA_GPIO_EVENT 0x02 |
127 | #define VIA_JACK_EVENT 0x04 | ||
127 | 128 | ||
128 | enum { | 129 | enum { |
129 | VIA_CTL_WIDGET_VOL, | 130 | VIA_CTL_WIDGET_VOL, |
@@ -1413,10 +1414,12 @@ static void via_unsol_event(struct hda_codec *codec, | |||
1413 | unsigned int res) | 1414 | unsigned int res) |
1414 | { | 1415 | { |
1415 | res >>= 26; | 1416 | res >>= 26; |
1416 | if (res == VIA_HP_EVENT) | 1417 | if (res & VIA_HP_EVENT) |
1417 | via_hp_automute(codec); | 1418 | via_hp_automute(codec); |
1418 | else if (res == VIA_GPIO_EVENT) | 1419 | if (res & VIA_GPIO_EVENT) |
1419 | via_gpio_control(codec); | 1420 | via_gpio_control(codec); |
1421 | if (res & VIA_JACK_EVENT) | ||
1422 | set_jack_power_state(codec); | ||
1420 | } | 1423 | } |
1421 | 1424 | ||
1422 | static int via_init(struct hda_codec *codec) | 1425 | static int via_init(struct hda_codec *codec) |
@@ -1878,7 +1881,8 @@ static struct snd_kcontrol_new vt1709_capture_mixer[] = { | |||
1878 | }; | 1881 | }; |
1879 | 1882 | ||
1880 | static struct hda_verb vt1709_uniwill_init_verbs[] = { | 1883 | static struct hda_verb vt1709_uniwill_init_verbs[] = { |
1881 | {0x20, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_HP_EVENT}, | 1884 | {0x20, AC_VERB_SET_UNSOLICITED_ENABLE, |
1885 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | ||
1882 | { } | 1886 | { } |
1883 | }; | 1887 | }; |
1884 | 1888 | ||
@@ -2514,7 +2518,15 @@ static struct hda_verb vt1708B_4ch_volume_init_verbs[] = { | |||
2514 | }; | 2518 | }; |
2515 | 2519 | ||
2516 | static struct hda_verb vt1708B_uniwill_init_verbs[] = { | 2520 | static struct hda_verb vt1708B_uniwill_init_verbs[] = { |
2517 | {0x1D, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_HP_EVENT}, | 2521 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, |
2522 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | ||
2523 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
2524 | {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
2525 | {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
2526 | {0x1c, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
2527 | {0x1e, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
2528 | {0x22, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
2529 | {0x23, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
2518 | { } | 2530 | { } |
2519 | }; | 2531 | }; |
2520 | 2532 | ||
@@ -3009,7 +3021,15 @@ static struct hda_verb vt1708S_volume_init_verbs[] = { | |||
3009 | }; | 3021 | }; |
3010 | 3022 | ||
3011 | static struct hda_verb vt1708S_uniwill_init_verbs[] = { | 3023 | static struct hda_verb vt1708S_uniwill_init_verbs[] = { |
3012 | {0x1D, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_HP_EVENT}, | 3024 | {0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, |
3025 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, | ||
3026 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3027 | {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3028 | {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3029 | {0x1c, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3030 | {0x1e, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3031 | {0x22, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3032 | {0x23, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3013 | { } | 3033 | { } |
3014 | }; | 3034 | }; |
3015 | 3035 | ||
@@ -3448,8 +3468,12 @@ static struct hda_verb vt1702_volume_init_verbs[] = { | |||
3448 | }; | 3468 | }; |
3449 | 3469 | ||
3450 | static struct hda_verb vt1702_uniwill_init_verbs[] = { | 3470 | static struct hda_verb vt1702_uniwill_init_verbs[] = { |
3451 | {0x01, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_GPIO_EVENT}, | 3471 | {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, |
3452 | {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_HP_EVENT}, | 3472 | AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT}, |
3473 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3474 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3475 | {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3476 | {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | VIA_JACK_EVENT}, | ||
3453 | { } | 3477 | { } |
3454 | }; | 3478 | }; |
3455 | 3479 | ||