aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_jack.h
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2012-11-19 19:48:07 +0100
committerTakashi Iwai <tiwai@suse.de>2012-11-19 19:49:58 +0100
commit0619ba8c17b121ef0273be181198659b17d84247 (patch)
tree81cb3273e7376734b517d4695efa3d02455458ad /sound/pci/hda/hda_jack.h
parentsound: oss/sb_audio: cap value in sb201_audio_set_speed() (diff)
downloadlinux-dev-0619ba8c17b121ef0273be181198659b17d84247.tar.xz
linux-dev-0619ba8c17b121ef0273be181198659b17d84247.zip
ALSA: hda - Allow jack state to depend on another jack
Introduce the concept of a "gated" jack. The gated jack's pin sense is only valid when the "gating" jack is plugged. This requires checking the gating jack when the gated jack changes and re-checking the gated jack when the gating jack is plugged/unplugged. This allows handling of devices where the mic jack detect floats when the headphone jack is unplugged. [Rewritten for fixing the possible snd_array reallocation, covering the missing callback calls and jack sync operations, as well as some code cleanups -- tiwai] Signed-off-by: Dylan Reid <dgreid@chromium.org> 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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_jack.h b/sound/pci/hda/hda_jack.h
index 4487785adf34..ec12abd45263 100644
--- a/sound/pci/hda/hda_jack.h
+++ b/sound/pci/hda/hda_jack.h
@@ -28,6 +28,8 @@ struct hda_jack_tbl {
unsigned int jack_detect:1; /* capable of jack-detection? */
unsigned int jack_dirty:1; /* needs to update? */
unsigned int phantom_jack:1; /* a fixed, always present port? */
+ hda_nid_t gating_jack; /* valid when gating jack plugged */
+ hda_nid_t gated_jack; /* gated is dependent on this jack */
struct snd_kcontrol *kctl; /* assigned kctl for jack-detection */
#ifdef CONFIG_SND_HDA_INPUT_JACK
int type;
@@ -69,6 +71,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
unsigned char action,
hda_jack_callback cb);
+int snd_hda_jack_set_gating_jack(struct hda_codec *codec, hda_nid_t gated_nid,
+ hda_nid_t gating_nid);
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);