Skip to contentSkip to conversation

ALSA: Add support for video out to the jack reporting API

PATCH In review Jani Nikula 2 participants 2 messages Jan 5, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: Add support for video out to the jack reporting API

Add support for reporting new jack types SND_JACK_VIDEOOUT and SND_JACK_AVOUT (a combination of LINEOUT and VIDEOOUT) to the jack reporting API.

Also add the corresponding SW_VIDEOOUT_INSERT switch to the input system header.

---
 include/linux/input.h |    1 +
 include/sound/jack.h  |    2 ++
 sound/core/jack.c     |    6 ++++++
 3 files changed, 9 insertions(+), 0 deletions(-)
include/linux/input.h +1 -0
index 9a6355f..adc1332 100644
@@ -661,6 +661,7 @@ struct input_absinfo {
 #define SW_DOCK			0x05  /* set = plugged into dock */
 #define SW_LINEOUT_INSERT	0x06  /* set = inserted */
 #define SW_JACK_PHYSICAL_INSERT 0x07  /* set = mechanical switch set */
+#define SW_VIDEOOUT_INSERT	0x08  /* set = inserted */
 #define SW_MAX			0x0f
 #define SW_CNT			(SW_MAX+1)
 
include/sound/jack.h +2 -0
index 2e0315c..283c975 100644
@@ -37,6 +37,8 @@ enum snd_jack_types {
 	SND_JACK_HEADSET	= SND_JACK_HEADPHONE | SND_JACK_MICROPHONE,
 	SND_JACK_LINEOUT	= 0x0004,
 	SND_JACK_MECHANICAL	= 0x0008, /* If detected separately */
+	SND_JACK_VIDEOOUT	= 0x0010,
+	SND_JACK_AVOUT		= SND_JACK_LINEOUT | SND_JACK_VIDEOOUT,
 };
 
 struct snd_jack {
sound/core/jack.c +6 -0
index dd4a12d..e1de195 100644
@@ -106,6 +106,9 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
 	if (type & SND_JACK_LINEOUT)
 		input_set_capability(jack->input_dev, EV_SW,
 				     SW_LINEOUT_INSERT);
+	if (type & SND_JACK_VIDEOOUT)
+		input_set_capability(jack->input_dev, EV_SW,
+				     SW_VIDEOOUT_INSERT);
 	if (type & SND_JACK_MICROPHONE)
 		input_set_capability(jack->input_dev, EV_SW,
 				     SW_MICROPHONE_INSERT);
@@ -163,6 +166,9 @@ void snd_jack_report(struct snd_jack *jack, int status)
 	if (jack->type & SND_JACK_LINEOUT)
 		input_report_switch(jack->input_dev, SW_LINEOUT_INSERT,
 				    status & SND_JACK_LINEOUT);
+	if (jack->type & SND_JACK_VIDEOOUT)
+		input_report_switch(jack->input_dev, SW_VIDEOOUT_INSERT,
+				    status & SND_JACK_VIDEOOUT);
 	if (jack->type & SND_JACK_MICROPHONE)
 		input_report_switch(jack->input_dev, SW_MICROPHONE_INSERT,
 				    status & SND_JACK_MICROPHONE);
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 8 lines · Jani Nikula

Add support for reporting new jack types SND_JACK_VIDEOOUT and SND_JACK_AVOUT (a combination of LINEOUT and VIDEOOUT) to the jack reporting API.

Also add the corresponding SW_VIDEOOUT_INSERT switch to the input system header.

Could you please regenerate this against the topic/jack-core branch of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git?
I've redone the way the ALSA idea of jacks is mapped to the input layer.