From 98a387cdfe139c31a108a4623171bcdac82decf8 Mon Sep 17 00:00:00 2001 From: Banajit Goswami Date: Mon, 21 Nov 2016 17:49:35 -0800 Subject: [PATCH] ANDROID: GKI: ALSA: jack: Add support to report second microphone ALSA jack framework currently supports reporting only one single microphone. Add support to report presence of the second microphone to userspace. Test: build Bug: 149430094 Change-Id: I72d16892f2fa563c026bf90d847d9365dcf2233a Signed-off-by: Phani Kumar Uppalapati Signed-off-by: Banajit Goswami Signed-off-by: Sudheer Papothi Signed-off-by: Meng Wang (cherry picked from commit b071d2a1b2a52b1f13ae14769e473f1ee4f66702) Signed-off-by: Hridya Valsaraju --- include/sound/jack.h | 3 +++ include/uapi/linux/input-event-codes.h | 3 ++- sound/core/jack.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/sound/jack.h b/include/sound/jack.h index 55c320dc402c..c66e4e9567b6 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h @@ -61,6 +61,9 @@ enum snd_jack_types { SND_JACK_OC_HPHL = 0x0040, SND_JACK_OC_HPHR = 0x0080, SND_JACK_UNSUPPORTED = 0x0100, + SND_JACK_MICROPHONE2 = 0x0200, + SND_JACK_ANC_HEADPHONE = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE | + SND_JACK_MICROPHONE2, /* Kept separate from switches to facilitate implementation */ SND_JACK_BTN_0 = 0x4000, diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 59b47c11fce2..7a03c1534694 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -797,7 +797,8 @@ #define SW_PEN_INSERTED 0x0f /* set = pen inserted */ #define SW_HPHL_OVERCURRENT 0x10 /* set = over current on left hph */ #define SW_HPHR_OVERCURRENT 0x11 /* set = over current on right hph */ -#define SW_UNSUPPORT_INSERT 0x12 /* set = unsupported device inserted */ +#define SW_MICROPHONE2_INSERT 0x12 /* set = inserted */ +#define SW_UNSUPPORT_INSERT 0x13 /* set = unsupported device inserted */ #define SW_MAX 0x20 #define SW_CNT (SW_MAX+1) diff --git a/sound/core/jack.c b/sound/core/jack.c index 69a2ec974bee..3a25295adb93 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -43,6 +43,7 @@ static int jack_switch_types[] = { SW_HPHL_OVERCURRENT, SW_HPHR_OVERCURRENT, SW_UNSUPPORT_INSERT, + SW_MICROPHONE2_INSERT, }; #endif /* CONFIG_SND_JACK_INPUT_DEV */