aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-09-11 08:06:53 -0400
committerTakashi Iwai <tiwai@suse.de>2014-09-11 08:14:21 -0400
commit62f949bf6bf6ceb44872c44ef3913a96d93fb5d4 (patch)
tree6fb4df39d050165aa24243b80c4dc763d6b8e8c9
parent998052b74574699bdd1e451b6556e4d7667a7a4e (diff)
ALSA: hda - Get rid of action field from struct hda_jack_tbl
The action value assigned to each hda_jack_tbl entry is mostly superfluous. The actually used values are either the widget NID or a value specific to the callback. The former case can be simply replaced by a reference to widget NID itself. The only place doing the latter is STAC/IDT codec driver for the powermap handling. But, the code doesn't need to check the action field at all -- the function jack_update_power() is called either with a specific pin or with NULL. So the check of jack->action can be removed completely there, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_generic.c4
-rw-r--r--sound/pci/hda/hda_generic.h6
-rw-r--r--sound/pci/hda/hda_jack.c10
-rw-r--r--sound/pci/hda/hda_jack.h22
-rw-r--r--sound/pci/hda/patch_ca0132.c16
-rw-r--r--sound/pci/hda/patch_cirrus.c3
-rw-r--r--sound/pci/hda/patch_hdmi.c4
-rw-r--r--sound/pci/hda/patch_realtek.c9
-rw-r--r--sound/pci/hda/patch_sigmatel.c18
-rw-r--r--sound/pci/hda/patch_via.c4
10 files changed, 23 insertions, 73 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 95121e818b4d..4d605e4ac41c 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -4180,7 +4180,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
4180 if (!is_jack_detectable(codec, nid)) 4180 if (!is_jack_detectable(codec, nid))
4181 continue; 4181 continue;
4182 codec_dbg(codec, "Enable HP auto-muting on NID 0x%x\n", nid); 4182 codec_dbg(codec, "Enable HP auto-muting on NID 0x%x\n", nid);
4183 snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT, 4183 snd_hda_jack_detect_enable_callback(codec, nid,
4184 call_hp_automute); 4184 call_hp_automute);
4185 spec->detect_hp = 1; 4185 spec->detect_hp = 1;
4186 } 4186 }
@@ -4193,7 +4193,6 @@ static int check_auto_mute_availability(struct hda_codec *codec)
4193 continue; 4193 continue;
4194 codec_dbg(codec, "Enable Line-Out auto-muting on NID 0x%x\n", nid); 4194 codec_dbg(codec, "Enable Line-Out auto-muting on NID 0x%x\n", nid);
4195 snd_hda_jack_detect_enable_callback(codec, nid, 4195 snd_hda_jack_detect_enable_callback(codec, nid,
4196 HDA_GEN_FRONT_EVENT,
4197 call_line_automute); 4196 call_line_automute);
4198 spec->detect_lo = 1; 4197 spec->detect_lo = 1;
4199 } 4198 }
@@ -4235,7 +4234,6 @@ static bool auto_mic_check_imux(struct hda_codec *codec)
4235 for (i = 1; i < spec->am_num_entries; i++) 4234 for (i = 1; i < spec->am_num_entries; i++)
4236 snd_hda_jack_detect_enable_callback(codec, 4235 snd_hda_jack_detect_enable_callback(codec,
4237 spec->am_entry[i].pin, 4236 spec->am_entry[i].pin,
4238 HDA_GEN_MIC_EVENT,
4239 call_mic_autoswitch); 4237 call_mic_autoswitch);
4240 return true; 4238 return true;
4241} 4239}
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 3f95f1d3f1f8..72f5624125fb 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -12,12 +12,6 @@
12#ifndef __SOUND_HDA_GENERIC_H 12#ifndef __SOUND_HDA_GENERIC_H
13#define __SOUND_HDA_GENERIC_H 13#define __SOUND_HDA_GENERIC_H
14 14
15/* unsol event tags */
16enum {
17 HDA_GEN_HP_EVENT = 1, HDA_GEN_FRONT_EVENT, HDA_GEN_MIC_EVENT,
18 HDA_GEN_LAST_EVENT = HDA_GEN_MIC_EVENT
19};
20
21/* table entry for multi-io paths */ 15/* table entry for multi-io paths */
22struct hda_multi_io { 16struct hda_multi_io {
23 hda_nid_t pin; /* multi-io widget pin NID */ 17 hda_nid_t pin; /* multi-io widget pin NID */
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 9746d73cec52..9c8f24f2d56b 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -217,7 +217,6 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_detect_state);
217 * snd_hda_jack_detect_enable - enable the jack-detection 217 * snd_hda_jack_detect_enable - enable the jack-detection
218 */ 218 */
219int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid, 219int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
220 unsigned char action,
221 hda_jack_callback cb) 220 hda_jack_callback cb)
222{ 221{
223 struct hda_jack_tbl *jack = snd_hda_jack_tbl_new(codec, nid); 222 struct hda_jack_tbl *jack = snd_hda_jack_tbl_new(codec, nid);
@@ -226,8 +225,6 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
226 if (jack->jack_detect) 225 if (jack->jack_detect)
227 return 0; /* already registered */ 226 return 0; /* already registered */
228 jack->jack_detect = 1; 227 jack->jack_detect = 1;
229 if (action)
230 jack->action = action;
231 if (cb) 228 if (cb)
232 jack->callback = cb; 229 jack->callback = cb;
233 if (codec->jackpoll_interval > 0) 230 if (codec->jackpoll_interval > 0)
@@ -238,10 +235,9 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
238} 235}
239EXPORT_SYMBOL_GPL(snd_hda_jack_detect_enable_callback); 236EXPORT_SYMBOL_GPL(snd_hda_jack_detect_enable_callback);
240 237
241int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid, 238int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid)
242 unsigned char action)
243{ 239{
244 return snd_hda_jack_detect_enable_callback(codec, nid, action, NULL); 240 return snd_hda_jack_detect_enable_callback(codec, nid, NULL);
245} 241}
246EXPORT_SYMBOL_GPL(snd_hda_jack_detect_enable); 242EXPORT_SYMBOL_GPL(snd_hda_jack_detect_enable);
247 243
@@ -431,7 +427,7 @@ static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
431 return err; 427 return err;
432 428
433 if (!phantom_jack) 429 if (!phantom_jack)
434 return snd_hda_jack_detect_enable(codec, nid, 0); 430 return snd_hda_jack_detect_enable(codec, nid);
435 return 0; 431 return 0;
436} 432}
437 433
diff --git a/sound/pci/hda/hda_jack.h b/sound/pci/hda/hda_jack.h
index 46e1ea83ce3c..c1abc7324d68 100644
--- a/sound/pci/hda/hda_jack.h
+++ b/sound/pci/hda/hda_jack.h
@@ -19,7 +19,6 @@ typedef void (*hda_jack_callback) (struct hda_codec *, struct hda_jack_tbl *);
19 19
20struct hda_jack_tbl { 20struct hda_jack_tbl {
21 hda_nid_t nid; 21 hda_nid_t nid;
22 unsigned char action; /* event action (0 = none) */
23 unsigned char tag; /* unsol event tag */ 22 unsigned char tag; /* unsol event tag */
24 unsigned int private_data; /* arbitrary data */ 23 unsigned int private_data; /* arbitrary data */
25 hda_jack_callback callback; 24 hda_jack_callback callback;
@@ -47,29 +46,10 @@ struct hda_jack_tbl *
47snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid); 46snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid);
48void snd_hda_jack_tbl_clear(struct hda_codec *codec); 47void snd_hda_jack_tbl_clear(struct hda_codec *codec);
49 48
50/**
51 * snd_hda_jack_get_action - get jack-tbl entry for the tag
52 *
53 * Call this from the unsol event handler to get the assigned action for the
54 * event. This will mark the dirty flag for the later reporting, too.
55 */
56static inline unsigned char
57snd_hda_jack_get_action(struct hda_codec *codec, unsigned int tag)
58{
59 struct hda_jack_tbl *jack = snd_hda_jack_tbl_get_from_tag(codec, tag);
60 if (jack) {
61 jack->jack_dirty = 1;
62 return jack->action;
63 }
64 return 0;
65}
66
67void snd_hda_jack_set_dirty_all(struct hda_codec *codec); 49void snd_hda_jack_set_dirty_all(struct hda_codec *codec);
68 50
69int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid, 51int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid);
70 unsigned char action);
71int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid, 52int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
72 unsigned char action,
73 hda_jack_callback cb); 53 hda_jack_callback cb);
74 54
75int snd_hda_jack_set_gating_jack(struct hda_codec *codec, hda_nid_t gated_nid, 55int snd_hda_jack_set_gating_jack(struct hda_codec *codec, hda_nid_t gated_nid,
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 5d8455e2dacd..39fae52258f0 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -4116,8 +4116,8 @@ static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc)
4116 4116
4117static void ca0132_init_unsol(struct hda_codec *codec) 4117static void ca0132_init_unsol(struct hda_codec *codec)
4118{ 4118{
4119 snd_hda_jack_detect_enable(codec, UNSOL_TAG_HP, UNSOL_TAG_HP); 4119 snd_hda_jack_detect_enable(codec, UNSOL_TAG_HP);
4120 snd_hda_jack_detect_enable(codec, UNSOL_TAG_AMIC1, UNSOL_TAG_AMIC1); 4120 snd_hda_jack_detect_enable(codec, UNSOL_TAG_AMIC1);
4121} 4121}
4122 4122
4123static void refresh_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir) 4123static void refresh_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir)
@@ -4406,16 +4406,18 @@ static void ca0132_process_dsp_response(struct hda_codec *codec)
4406static void ca0132_unsol_event(struct hda_codec *codec, unsigned int res) 4406static void ca0132_unsol_event(struct hda_codec *codec, unsigned int res)
4407{ 4407{
4408 struct ca0132_spec *spec = codec->spec; 4408 struct ca0132_spec *spec = codec->spec;
4409 unsigned int tag = (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f;
4409 4410
4410 if (((res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f) == UNSOL_TAG_DSP) { 4411 if (tag == UNSOL_TAG_DSP) {
4411 ca0132_process_dsp_response(codec); 4412 ca0132_process_dsp_response(codec);
4412 } else { 4413 } else {
4413 res = snd_hda_jack_get_action(codec, 4414 struct hda_jack_tbl *jack;
4414 (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f);
4415 4415
4416 codec_dbg(codec, "snd_hda_jack_get_action: 0x%x\n", res); 4416 codec_dbg(codec, "snd_hda_jack_get_action: 0x%x\n", res);
4417 4417 jack = snd_hda_jack_tbl_get_from_tag(codec, tag);
4418 switch (res) { 4418 if (!jack)
4419 return;
4420 switch (jack->nid) {
4419 case UNSOL_TAG_HP: 4421 case UNSOL_TAG_HP:
4420 /* Delay enabling the HP amp, to let the mic-detection 4422 /* Delay enabling the HP amp, to let the mic-detection
4421 * state machine run. 4423 * state machine run.
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 3db724eaa53c..69b0ffc55a51 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -135,8 +135,6 @@ enum {
135#define CS421X_IDX_DAC_CFG 0x03 135#define CS421X_IDX_DAC_CFG 0x03
136#define CS421X_IDX_SPK_CTL 0x04 136#define CS421X_IDX_SPK_CTL 0x04
137 137
138#define SPDIF_EVENT 0x04
139
140/* Cirrus Logic CS4213 is like CS4210 but does not have SPDIF input/output */ 138/* Cirrus Logic CS4213 is like CS4210 but does not have SPDIF input/output */
141#define CS4213_VENDOR_NID 0x09 139#define CS4213_VENDOR_NID 0x09
142 140
@@ -1019,7 +1017,6 @@ static void parse_cs421x_digital(struct hda_codec *codec)
1019 if (get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP) { 1017 if (get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP) {
1020 spec->spdif_detect = 1; 1018 spec->spdif_detect = 1;
1021 snd_hda_jack_detect_enable_callback(codec, nid, 1019 snd_hda_jack_detect_enable_callback(codec, nid,
1022 SPDIF_EVENT,
1023 cs4210_spdif_automute); 1020 cs4210_spdif_automute);
1024 } 1021 }
1025 } 1022 }
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 99d7d7fecaad..8f94527f1890 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2165,7 +2165,7 @@ static int generic_hdmi_init(struct hda_codec *codec)
2165 hda_nid_t pin_nid = per_pin->pin_nid; 2165 hda_nid_t pin_nid = per_pin->pin_nid;
2166 2166
2167 hdmi_init_pin(codec, pin_nid); 2167 hdmi_init_pin(codec, pin_nid);
2168 snd_hda_jack_detect_enable_callback(codec, pin_nid, pin_nid, 2168 snd_hda_jack_detect_enable_callback(codec, pin_nid,
2169 codec->jackpoll_interval > 0 ? jack_callback : NULL); 2169 codec->jackpoll_interval > 0 ? jack_callback : NULL);
2170 } 2170 }
2171 return 0; 2171 return 0;
@@ -2428,7 +2428,7 @@ static int simple_playback_init(struct hda_codec *codec)
2428 if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP) 2428 if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP)
2429 snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, 2429 snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE,
2430 AMP_OUT_UNMUTE); 2430 AMP_OUT_UNMUTE);
2431 snd_hda_jack_detect_enable(codec, pin, pin); 2431 snd_hda_jack_detect_enable(codec, pin);
2432 return 0; 2432 return 0;
2433} 2433}
2434 2434
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6b1a5de07e35..ac00420e59ff 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -40,9 +40,6 @@
40/* keep halting ALC5505 DSP, for power saving */ 40/* keep halting ALC5505 DSP, for power saving */
41#define HALT_REALTEK_ALC5505 41#define HALT_REALTEK_ALC5505
42 42
43/* unsol event tags */
44#define ALC_DCVOL_EVENT 0x08
45
46/* for GPIO Poll */ 43/* for GPIO Poll */
47#define GPIO_MASK 0x03 44#define GPIO_MASK 0x03
48 45
@@ -1130,7 +1127,8 @@ static void alc880_fixup_vol_knob(struct hda_codec *codec,
1130 const struct hda_fixup *fix, int action) 1127 const struct hda_fixup *fix, int action)
1131{ 1128{
1132 if (action == HDA_FIXUP_ACT_PROBE) 1129 if (action == HDA_FIXUP_ACT_PROBE)
1133 snd_hda_jack_detect_enable_callback(codec, 0x21, ALC_DCVOL_EVENT, alc_update_knob_master); 1130 snd_hda_jack_detect_enable_callback(codec, 0x21,
1131 alc_update_knob_master);
1134} 1132}
1135 1133
1136static const struct hda_fixup alc880_fixups[] = { 1134static const struct hda_fixup alc880_fixups[] = {
@@ -1593,7 +1591,7 @@ static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1593 spec->gen.detect_hp = 1; 1591 spec->gen.detect_hp = 1;
1594 spec->gen.automute_speaker = 1; 1592 spec->gen.automute_speaker = 1;
1595 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ 1593 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1596 snd_hda_jack_detect_enable_callback(codec, 0x0f, HDA_GEN_HP_EVENT, 1594 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1597 snd_hda_gen_hp_automute); 1595 snd_hda_gen_hp_automute);
1598 snd_hda_add_verbs(codec, alc_gpio1_init_verbs); 1596 snd_hda_add_verbs(codec, alc_gpio1_init_verbs);
1599 } 1597 }
@@ -4254,7 +4252,6 @@ static void alc282_fixup_asus_tx300(struct hda_codec *codec,
4254 spec->gen.auto_mute_via_amp = 1; 4252 spec->gen.auto_mute_via_amp = 1;
4255 spec->gen.automute_hook = asus_tx300_automute; 4253 spec->gen.automute_hook = asus_tx300_automute;
4256 snd_hda_jack_detect_enable_callback(codec, 0x1b, 4254 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4257 HDA_GEN_HP_EVENT,
4258 snd_hda_gen_hp_automute); 4255 snd_hda_gen_hp_automute);
4259 break; 4256 break;
4260 case HDA_FIXUP_ACT_BUILD: 4257 case HDA_FIXUP_ACT_BUILD:
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 60aebd0f5e56..bc371cfb5d84 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -40,11 +40,6 @@
40#include "hda_generic.h" 40#include "hda_generic.h"
41 41
42enum { 42enum {
43 STAC_VREF_EVENT = 8,
44 STAC_PWR_EVENT,
45};
46
47enum {
48 STAC_REF, 43 STAC_REF,
49 STAC_9200_OQO, 44 STAC_9200_OQO,
50 STAC_9200_DELL_D21, 45 STAC_9200_DELL_D21,
@@ -505,13 +500,11 @@ static void jack_update_power(struct hda_codec *codec,
505 for (i = 0; i < spec->num_pwrs; i++) { 500 for (i = 0; i < spec->num_pwrs; i++) {
506 hda_nid_t nid = spec->pwr_nids[i]; 501 hda_nid_t nid = spec->pwr_nids[i];
507 jack = snd_hda_jack_tbl_get(codec, nid); 502 jack = snd_hda_jack_tbl_get(codec, nid);
508 if (!jack || !jack->action) 503 if (!jack)
509 continue; 504 continue;
510 if (jack->action == STAC_PWR_EVENT || 505 stac_toggle_power_map(codec, nid,
511 jack->action <= HDA_GEN_LAST_EVENT) 506 snd_hda_jack_detect(codec, nid),
512 stac_toggle_power_map(codec, nid, 507 false);
513 snd_hda_jack_detect(codec, nid),
514 false);
515 } 508 }
516 509
517 snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_IDT_SET_POWER_MAP, 510 snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_IDT_SET_POWER_MAP,
@@ -568,7 +561,6 @@ static void stac_init_power_map(struct hda_codec *codec)
568 spec->vref_mute_led_nid != nid && 561 spec->vref_mute_led_nid != nid &&
569 is_jack_detectable(codec, nid)) { 562 is_jack_detectable(codec, nid)) {
570 snd_hda_jack_detect_enable_callback(codec, nid, 563 snd_hda_jack_detect_enable_callback(codec, nid,
571 STAC_PWR_EVENT,
572 jack_update_power); 564 jack_update_power);
573 } else { 565 } else {
574 if (def_conf == AC_JACK_PORT_NONE) 566 if (def_conf == AC_JACK_PORT_NONE)
@@ -3028,7 +3020,6 @@ static void stac92hd71bxx_fixup_hp_m4(struct hda_codec *codec,
3028 snd_hda_codec_write_cache(codec, codec->afg, 0, 3020 snd_hda_codec_write_cache(codec, codec->afg, 0,
3029 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02); 3021 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
3030 snd_hda_jack_detect_enable_callback(codec, codec->afg, 3022 snd_hda_jack_detect_enable_callback(codec, codec->afg,
3031 STAC_VREF_EVENT,
3032 stac_vref_event); 3023 stac_vref_event);
3033 jack = snd_hda_jack_tbl_get(codec, codec->afg); 3024 jack = snd_hda_jack_tbl_get(codec, codec->afg);
3034 if (jack) 3025 if (jack)
@@ -4052,7 +4043,6 @@ static void stac9205_fixup_dell_m43(struct hda_codec *codec,
4052 snd_hda_codec_write_cache(codec, codec->afg, 0, 4043 snd_hda_codec_write_cache(codec, codec->afg, 0,
4053 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10); 4044 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10);
4054 snd_hda_jack_detect_enable_callback(codec, codec->afg, 4045 snd_hda_jack_detect_enable_callback(codec, codec->afg,
4055 STAC_VREF_EVENT,
4056 stac_vref_event); 4046 stac_vref_event);
4057 jack = snd_hda_jack_tbl_get(codec, codec->afg); 4047 jack = snd_hda_jack_tbl_get(codec, codec->afg);
4058 if (jack) 4048 if (jack)
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 778166259b3e..2a8be5a5da15 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -592,8 +592,6 @@ static void via_jack_powerstate_event(struct hda_codec *codec, struct hda_jack_t
592 set_widgets_power_state(codec); 592 set_widgets_power_state(codec);
593} 593}
594 594
595#define VIA_JACK_EVENT (HDA_GEN_LAST_EVENT + 1)
596
597static void via_set_jack_unsol_events(struct hda_codec *codec) 595static void via_set_jack_unsol_events(struct hda_codec *codec)
598{ 596{
599 struct via_spec *spec = codec->spec; 597 struct via_spec *spec = codec->spec;
@@ -610,7 +608,6 @@ static void via_set_jack_unsol_events(struct hda_codec *codec)
610 if (pin && !snd_hda_jack_tbl_get(codec, pin) && 608 if (pin && !snd_hda_jack_tbl_get(codec, pin) &&
611 is_jack_detectable(codec, pin)) 609 is_jack_detectable(codec, pin))
612 snd_hda_jack_detect_enable_callback(codec, pin, 610 snd_hda_jack_detect_enable_callback(codec, pin,
613 VIA_JACK_EVENT,
614 via_jack_powerstate_event); 611 via_jack_powerstate_event);
615 } 612 }
616 613
@@ -619,7 +616,6 @@ static void via_set_jack_unsol_events(struct hda_codec *codec)
619 if (pin && !snd_hda_jack_tbl_get(codec, pin) && 616 if (pin && !snd_hda_jack_tbl_get(codec, pin) &&
620 is_jack_detectable(codec, pin)) 617 is_jack_detectable(codec, pin))
621 snd_hda_jack_detect_enable_callback(codec, pin, 618 snd_hda_jack_detect_enable_callback(codec, pin,
622 VIA_JACK_EVENT,
623 via_jack_powerstate_event); 619 via_jack_powerstate_event);
624 } 620 }
625} 621}