From 35360ca5816b19f73f9eda1a8d98be8a966aaaa5 Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Thu, 2 Jan 2014 21:11:45 -0800 Subject: [PATCH] ALSA: jack: Add support to report second microphone ALSA jack framework currently supports reporting only one microphone. Add support to report presence of second microphone to the userspace. Change-Id: Id0df7aa222e547da3771f5d61092a959394c10dc Signed-off-by: Phani Kumar Uppalapati --- include/linux/input.h | 1 + include/sound/jack.h | 3 +++ sound/core/jack.c | 1 + 3 files changed, 5 insertions(+) diff --git a/include/linux/input.h b/include/linux/input.h index 558178b8060..77fc25365a3 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -850,6 +850,7 @@ struct input_keymap_entry { #define SW_HPHL_OVERCURRENT 0x0e /* set = over current on left hph */ #define SW_HPHR_OVERCURRENT 0x0f /* set = over current on right hph */ #define SW_UNSUPPORT_INSERT 0x10 /* set = unsupported device inserted */ +#define SW_MICROPHONE2_INSERT 0x11 /* set = inserted */ #define SW_MAX 0x20 #define SW_CNT (SW_MAX+1) diff --git a/include/sound/jack.h b/include/sound/jack.h index 8e8c1330fae..4a88c22434a 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h @@ -47,6 +47,9 @@ enum snd_jack_types { SND_JACK_OC_HPHL = 0x0000040, SND_JACK_OC_HPHR = 0x0000080, SND_JACK_UNSUPPORTED = 0x0000100, + SND_JACK_MICROPHONE2 = 0x0000200, + SND_JACK_ANC_HEADPHONE = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE | + SND_JACK_MICROPHONE2, /* Kept separate from switches to facilitate implementation */ SND_JACK_BTN_0 = 0x4000000, SND_JACK_BTN_1 = 0x2000000, diff --git a/sound/core/jack.c b/sound/core/jack.c index 9e2e085b78c..6e2dbdb39bd 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -35,6 +35,7 @@ static int jack_switch_types[] = { SW_HPHL_OVERCURRENT, SW_HPHR_OVERCURRENT, SW_UNSUPPORT_INSERT, + SW_MICROPHONE2_INSERT, }; static int snd_jack_dev_free(struct snd_device *device)