summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_ca0132.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-09-11 14:06:53 +0200
committerTakashi Iwai <tiwai@suse.de>2014-09-11 14:14:21 +0200
commit62f949bf6bf6ceb44872c44ef3913a96d93fb5d4 (patch)
tree6fb4df39d050165aa24243b80c4dc763d6b8e8c9 /sound/pci/hda/patch_ca0132.c
parent998052b74574699bdd1e451b6556e4d7667a7a4e (diff)
downloadlinux-next-62f949bf6bf6ceb44872c44ef3913a96d93fb5d4.tar.gz
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_ca0132.c')
-rw-r--r--sound/pci/hda/patch_ca0132.c16
1 files changed, 9 insertions, 7 deletions
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)
static void ca0132_init_unsol(struct hda_codec *codec)
{
- snd_hda_jack_detect_enable(codec, UNSOL_TAG_HP, UNSOL_TAG_HP);
- snd_hda_jack_detect_enable(codec, UNSOL_TAG_AMIC1, UNSOL_TAG_AMIC1);
+ snd_hda_jack_detect_enable(codec, UNSOL_TAG_HP);
+ snd_hda_jack_detect_enable(codec, UNSOL_TAG_AMIC1);
}
static 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)
static void ca0132_unsol_event(struct hda_codec *codec, unsigned int res)
{
struct ca0132_spec *spec = codec->spec;
+ unsigned int tag = (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f;
- if (((res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f) == UNSOL_TAG_DSP) {
+ if (tag == UNSOL_TAG_DSP) {
ca0132_process_dsp_response(codec);
} else {
- res = snd_hda_jack_get_action(codec,
- (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f);
+ struct hda_jack_tbl *jack;
codec_dbg(codec, "snd_hda_jack_get_action: 0x%x\n", res);
-
- switch (res) {
+ jack = snd_hda_jack_tbl_get_from_tag(codec, tag);
+ if (!jack)
+ return;
+ switch (jack->nid) {
case UNSOL_TAG_HP:
/* Delay enabling the HP amp, to let the mic-detection
* state machine run.