From 2e3666348190d2d372ee5a13493ed4319a45ddc2 Mon Sep 17 00:00:00 2001 From: Todd Kjos Date: Tue, 4 Aug 2020 21:23:35 +0000 Subject: [PATCH] Revert "Revert "Revert "ANDROID: ALSA: jack: Update supported ja..." Now that we have partner approval, we can revert for real. Revert submission 1382582 Reason for revert: QC confirms no longer needed Reverted Changes: Ie71a68da0:Revert "Revert "ANDROID: ALSA: jack: Update suppor... Change-Id: Ibf10f8ab05d6705348a8475d9932ec0959b4b292 Signed-off-by: Todd Kjos Signed-off-by: Greg Kroah-Hartman --- include/sound/jack.h | 3 +++ include/uapi/linux/input-event-codes.h | 4 ---- sound/core/jack.c | 8 ++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/sound/jack.h b/include/sound/jack.h index cd4819ef1a15..2b46e2830566 100755 --- a/include/sound/jack.h +++ b/include/sound/jack.h @@ -105,6 +105,9 @@ enum snd_jack_types { #endif +/* Keep in sync with definitions above */ +#define SND_JACK_SWITCH_TYPES 6 + struct snd_jack { struct list_head kctl_list; struct snd_card *card; diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 4ca2fb2f22f9..aabb07da3447 100755 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -824,10 +824,6 @@ #define SW_LINEIN_INSERT 0x0d /* set = inserted */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ #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_MICROPHONE2_INSERT 0x12 /* set = inserted */ -#define SW_UNSUPPORT_INSERT 0x13 /* set = unsupported device inserted */ #define SW_MACHINE_COVER 0x14 /* set = cover closed */ #define SW_GLOVE 0x20 /* set = glove mode */ #define SW_MAX 0x20 diff --git a/sound/core/jack.c b/sound/core/jack.c index 40190775b034..f652e90efd7e 100755 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -33,17 +33,13 @@ struct snd_jack_kctl { }; #ifdef CONFIG_SND_JACK_INPUT_DEV -static int jack_switch_types[] = { +static int jack_switch_types[SND_JACK_SWITCH_TYPES] = { SW_HEADPHONE_INSERT, SW_MICROPHONE_INSERT, SW_LINEOUT_INSERT, SW_JACK_PHYSICAL_INSERT, SW_VIDEOOUT_INSERT, SW_LINEIN_INSERT, - SW_HPHL_OVERCURRENT, - SW_HPHR_OVERCURRENT, - SW_UNSUPPORT_INSERT, - SW_MICROPHONE2_INSERT, }; #endif /* CONFIG_SND_JACK_INPUT_DEV */ @@ -254,7 +250,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, jack->type = type; - for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++) + for (i = 0; i < SND_JACK_SWITCH_TYPES; i++) if (type & (1 << i)) input_set_capability(jack->input_dev, EV_SW, jack_switch_types[i]);