summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_jack.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-09-11 12:06:53 (GMT)
committerTakashi Iwai <tiwai@suse.de>2014-09-11 12:14:21 (GMT)
commit62f949bf6bf6ceb44872c44ef3913a96d93fb5d4 (patch)
tree6fb4df39d050165aa24243b80c4dc763d6b8e8c9 /sound/pci/hda/hda_jack.c
parent998052b74574699bdd1e451b6556e4d7667a7a4e (diff)
downloadlinux-62f949bf6bf6ceb44872c44ef3913a96d93fb5d4.tar.xz
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/hda_jack.c')
-rw-r--r--sound/pci/hda/hda_jack.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 9746d73..9c8f24f 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);
* snd_hda_jack_detect_enable - enable the jack-detection
*/
int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
- unsigned char action,
hda_jack_callback cb)
{
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,
if (jack->jack_detect)
return 0; /* already registered */
jack->jack_detect = 1;
- if (action)
- jack->action = action;
if (cb)
jack->callback = cb;
if (codec->jackpoll_interval > 0)
@@ -238,10 +235,9 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
}
EXPORT_SYMBOL_GPL(snd_hda_jack_detect_enable_callback);
-int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid,
- unsigned char action)
+int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid)
{
- return snd_hda_jack_detect_enable_callback(codec, nid, action, NULL);
+ return snd_hda_jack_detect_enable_callback(codec, nid, NULL);
}
EXPORT_SYMBOL_GPL(snd_hda_jack_detect_enable);
@@ -431,7 +427,7 @@ static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
return err;
if (!phantom_jack)
- return snd_hda_jack_detect_enable(codec, nid, 0);
+ return snd_hda_jack_detect_enable(codec, nid);
return 0;
}