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>
This commit is contained in:
parent
9710603b49
commit
545e868e05
2 changed files with 9 additions and 3 deletions
|
@ -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)
|
||||
|
||||
/*
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Add table
Reference in a new issue