diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-09-11 08:06:53 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-11 08:14:21 -0400 |
commit | 62f949bf6bf6ceb44872c44ef3913a96d93fb5d4 (patch) | |
tree | 6fb4df39d050165aa24243b80c4dc763d6b8e8c9 /sound/pci/hda/patch_sigmatel.c | |
parent | 998052b74574699bdd1e451b6556e4d7667a7a4e (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>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 18 |
1 files changed, 4 insertions, 14 deletions
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 | ||
42 | enum { | 42 | enum { |
43 | STAC_VREF_EVENT = 8, | ||
44 | STAC_PWR_EVENT, | ||
45 | }; | ||
46 | |||
47 | enum { | ||
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) |