diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-10-27 22:03:22 (GMT) |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-11-16 10:12:17 (GMT) |
commit | 01a61e12b4602c82bde9797d0e153f3e53c95b04 (patch) | |
tree | 04f817cb8cec2bae3edcc9a873aea1b674b146ad /sound/pci/hda/hda_jack.h | |
parent | 1835a0f9a2121ce3198dab67507d4d3e960cc09e (diff) | |
download | linux-01a61e12b4602c82bde9797d0e153f3e53c95b04.tar.xz |
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 5c1bcb8..b5983ea 100644 --- a/sound/pci/hda/hda_jack.h +++ b/sound/pci/hda/hda_jack.h @@ -15,7 +15,10 @@ struct hda_jack_tbl { hda_nid_t nid; unsigned int pin_sense; /* cached pin-sense value */ + unsigned int jack_cachable:1; /* can be updated via unsol events */ unsigned int jack_dirty:1; /* needs to update? */ + unsigned int need_notify:1; /* to be notified? */ + struct snd_kcontrol *kctl; /* assigned kctl for jack-detection */ }; struct hda_jack_tbl * @@ -60,4 +63,13 @@ static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) return true; } +int snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid, + const char *name, int idx); +int snd_hda_jack_add_kctls(struct hda_codec *codec, + const struct auto_pin_cfg *cfg); + +void snd_hda_jack_report(struct hda_codec *codec, hda_nid_t nid); +void snd_hda_jack_report_sync(struct hda_codec *codec); + + #endif /* __SOUND_HDA_JACK_H */ |