diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-10-27 18:03:22 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-11-16 05:12:17 -0500 |
commit | 01a61e12b4602c82bde9797d0e153f3e53c95b04 (patch) | |
tree | 04f817cb8cec2bae3edcc9a873aea1b674b146ad /sound/pci/hda/hda_jack.h | |
parent | 1835a0f9a2121ce3198dab67507d4d3e960cc09e (diff) |
ALSA: hda - Create jack-detection kcontrols
Create kcontrols for pin jack-detections, which work similarly like
jack-input layer. Each control will notify when the jack is plugged or
unplugged, and also user can read the value at any time via the normal
control API.
The control elements are created with iface=CARD, so that they won't
appear in the mixer apps.
So far, only the pins that enabled the jack-detection are registered.
For covering all pins, the transition of the common unsol-tag handling
would be needed. Stay tuned.
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.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_jack.h b/sound/pci/hda/hda_jack.h index 5c1bcb8cf565..b5983eaea51e 100644 --- a/sound/pci/hda/hda_jack.h +++ b/sound/pci/hda/hda_jack.h | |||
@@ -15,7 +15,10 @@ | |||
15 | struct hda_jack_tbl { | 15 | struct hda_jack_tbl { |
16 | hda_nid_t nid; | 16 | hda_nid_t nid; |
17 | unsigned int pin_sense; /* cached pin-sense value */ | 17 | unsigned int pin_sense; /* cached pin-sense value */ |
18 | unsigned int jack_cachable:1; /* can be updated via unsol events */ | ||
18 | unsigned int jack_dirty:1; /* needs to update? */ | 19 | unsigned int jack_dirty:1; /* needs to update? */ |
20 | unsigned int need_notify:1; /* to be notified? */ | ||
21 | struct snd_kcontrol *kctl; /* assigned kctl for jack-detection */ | ||
19 | }; | 22 | }; |
20 | 23 | ||
21 | struct hda_jack_tbl * | 24 | struct hda_jack_tbl * |
@@ -60,4 +63,13 @@ static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) | |||
60 | return true; | 63 | return true; |
61 | } | 64 | } |
62 | 65 | ||
66 | int snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid, | ||
67 | const char *name, int idx); | ||
68 | int snd_hda_jack_add_kctls(struct hda_codec *codec, | ||
69 | const struct auto_pin_cfg *cfg); | ||
70 | |||
71 | void snd_hda_jack_report(struct hda_codec *codec, hda_nid_t nid); | ||
72 | void snd_hda_jack_report_sync(struct hda_codec *codec); | ||
73 | |||
74 | |||
63 | #endif /* __SOUND_HDA_JACK_H */ | 75 | #endif /* __SOUND_HDA_JACK_H */ |