aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_via.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r--sound/pci/hda/patch_via.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 431c0d417ee..3467d0c23fe 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -54,6 +54,7 @@
54#include <sound/asoundef.h> 54#include <sound/asoundef.h>
55#include "hda_codec.h" 55#include "hda_codec.h"
56#include "hda_local.h" 56#include "hda_local.h"
57#include "hda_jack.h"
57 58
58/* Pin Widget NID */ 59/* Pin Widget NID */
59#define VT1708_HP_PIN_NID 0x20 60#define VT1708_HP_PIN_NID 0x20
@@ -1708,6 +1709,8 @@ static void via_gpio_control(struct hda_codec *codec)
1708static void via_unsol_event(struct hda_codec *codec, 1709static void via_unsol_event(struct hda_codec *codec,
1709 unsigned int res) 1710 unsigned int res)
1710{ 1711{
1712 snd_hda_jack_set_dirty_all(codec); /* FIXME: to be more fine-grained */
1713
1711 res >>= 26; 1714 res >>= 26;
1712 1715
1713 if (res & VIA_JACK_EVENT) 1716 if (res & VIA_JACK_EVENT)
@@ -2729,9 +2732,8 @@ static void via_auto_init_unsol_event(struct hda_codec *codec)
2729 int i; 2732 int i;
2730 2733
2731 if (cfg->hp_pins[0] && is_jack_detectable(codec, cfg->hp_pins[0])) 2734 if (cfg->hp_pins[0] && is_jack_detectable(codec, cfg->hp_pins[0]))
2732 snd_hda_codec_write(codec, cfg->hp_pins[0], 0, 2735 snd_hda_jack_detect_enable(codec, cfg->hp_pins[0],
2733 AC_VERB_SET_UNSOLICITED_ENABLE, 2736 VIA_HP_EVENT | VIA_JACK_EVENT);
2734 AC_USRSP_EN | VIA_HP_EVENT | VIA_JACK_EVENT);
2735 2737
2736 if (cfg->speaker_pins[0]) 2738 if (cfg->speaker_pins[0])
2737 ev = VIA_LINE_EVENT; 2739 ev = VIA_LINE_EVENT;
@@ -2740,16 +2742,14 @@ static void via_auto_init_unsol_event(struct hda_codec *codec)
2740 for (i = 0; i < cfg->line_outs; i++) { 2742 for (i = 0; i < cfg->line_outs; i++) {
2741 if (cfg->line_out_pins[i] && 2743 if (cfg->line_out_pins[i] &&
2742 is_jack_detectable(codec, cfg->line_out_pins[i])) 2744 is_jack_detectable(codec, cfg->line_out_pins[i]))
2743 snd_hda_codec_write(codec, cfg->line_out_pins[i], 0, 2745 snd_hda_jack_detect_enable(codec, cfg->line_out_pins[i],
2744 AC_VERB_SET_UNSOLICITED_ENABLE, 2746 ev | VIA_JACK_EVENT);
2745 AC_USRSP_EN | ev | VIA_JACK_EVENT);
2746 } 2747 }
2747 2748
2748 for (i = 0; i < cfg->num_inputs; i++) { 2749 for (i = 0; i < cfg->num_inputs; i++) {
2749 if (is_jack_detectable(codec, cfg->inputs[i].pin)) 2750 if (is_jack_detectable(codec, cfg->inputs[i].pin))
2750 snd_hda_codec_write(codec, cfg->inputs[i].pin, 0, 2751 snd_hda_jack_detect_enable(codec, cfg->inputs[i].pin,
2751 AC_VERB_SET_UNSOLICITED_ENABLE, 2752 VIA_JACK_EVENT);
2752 AC_USRSP_EN | VIA_JACK_EVENT);
2753 } 2753 }
2754} 2754}
2755 2755
@@ -2781,6 +2781,7 @@ static void vt1708_update_hp_jack_state(struct work_struct *work)
2781 vt1708_hp_work.work); 2781 vt1708_hp_work.work);
2782 if (spec->codec_type != VT1708) 2782 if (spec->codec_type != VT1708)
2783 return; 2783 return;
2784 snd_hda_jack_set_dirty_all(spec->codec);
2784 /* if jack state toggled */ 2785 /* if jack state toggled */
2785 if (spec->vt1708_hp_present 2786 if (spec->vt1708_hp_present
2786 != snd_hda_jack_detect(spec->codec, spec->autocfg.hp_pins[0])) { 2787 != snd_hda_jack_detect(spec->codec, spec->autocfg.hp_pins[0])) {