aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_jack.h
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-09-25 11:30:59 +0200
committerTakashi Iwai <tiwai@suse.de>2012-10-06 16:43:31 +0200
commit954df2a9686cebbb9cc4067697b370aa9ce77d4a (patch)
treec80b9b5959d14637b3061934c15b348449f0e79b /sound/pci/hda/hda_jack.h
parentMerge tag 'asoc-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next (diff)
downloadlinux-dev-954df2a9686cebbb9cc4067697b370aa9ce77d4a.tar.xz
linux-dev-954df2a9686cebbb9cc4067697b370aa9ce77d4a.zip
ALSA: hda - make a generic unsol event handler
Moving towards less duplication of code between codecs - this patch takes some of the common code of unsol event handling and makes it generic. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_jack.h')
-rw-r--r--sound/pci/hda/hda_jack.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_jack.h b/sound/pci/hda/hda_jack.h
index a9803da633c0..af8dd4724da5 100644
--- a/sound/pci/hda/hda_jack.h
+++ b/sound/pci/hda/hda_jack.h
@@ -13,12 +13,16 @@
#define __SOUND_HDA_JACK_H
struct auto_pin_cfg;
+struct hda_jack_tbl;
+
+typedef void (*hda_jack_callback) (struct hda_codec *, struct hda_jack_tbl *);
struct hda_jack_tbl {
hda_nid_t nid;
unsigned char action; /* event action (0 = none) */
unsigned char tag; /* unsol event tag */
unsigned int private_data; /* arbitrary data */
+ hda_jack_callback callback;
/* jack-detection stuff */
unsigned int pin_sense; /* cached pin-sense value */
unsigned int jack_detect:1; /* capable of jack-detection? */
@@ -61,6 +65,10 @@ void snd_hda_jack_set_dirty_all(struct hda_codec *codec);
int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid,
unsigned char action);
+int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
+ unsigned char action,
+ hda_jack_callback cb);
+
u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid);
int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid);
@@ -74,5 +82,6 @@ int snd_hda_jack_add_kctls(struct hda_codec *codec,
void snd_hda_jack_report_sync(struct hda_codec *codec);
+void snd_hda_jack_unsol_event(struct hda_codec *codec, unsigned int res);
#endif /* __SOUND_HDA_JACK_H */