diff options
author | Sudheer Papothi <spapothi@codeaurora.org> | 2016-01-29 00:51:57 +0530 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:09:52 -0700 |
commit | 545e868e0583cf4372bb0e5d8ba3db826d87b4ef (patch) | |
tree | 1b646f42eab8aef034c6f81cbc66656adca18215 | |
parent | 9710603b4951b27dd944da13df38534a71004941 (diff) |
ALSA: jack: Update supported jack switch types
Change adds support for jack switch types supported
by platform.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
-rw-r--r-- | include/uapi/linux/input-event-codes.h | 5 | ||||
-rw-r--r-- | sound/core/jack.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 87cf351bab03..b97184a4175e 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -749,7 +749,10 @@ #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ #define SW_LINEIN_INSERT 0x0d /* set = inserted */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ -#define SW_MAX 0x0f +#define SW_HPHL_OVERCURRENT 0x0f /* set = over current on left hph */ +#define SW_HPHR_OVERCURRENT 0x10 /* set = over current on right hph */ +#define SW_UNSUPPORT_INSERT 0x12 /* 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 7237acbdcbbc..72fad57c3530 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -32,13 +32,16 @@ struct snd_jack_kctl { unsigned int mask_bits; /* only masked status bits are reported via kctl */ }; -static int jack_switch_types[SND_JACK_SWITCH_TYPES] = { +static int 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, }; static int snd_jack_dev_disconnect(struct snd_device *device) @@ -240,7 +243,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, jack->type = type; - for (i = 0; i < SND_JACK_SWITCH_TYPES; i++) + for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++) if (type & (1 << i)) input_set_capability(jack->input_dev, EV_SW, jack_switch_types[i]); |