Skip to content

Commit

Permalink
ALSA: Rename jack switch table in preparation for button support
Browse files Browse the repository at this point in the history
Avoids confusion when we have button support.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Mar 17, 2010
1 parent 57d5488 commit 1c6e555
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sound/core/jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <sound/jack.h>
#include <sound/core.h>

static int jack_types[] = {
static int jack_switch_types[] = {
SW_HEADPHONE_INSERT,
SW_MICROPHONE_INSERT,
SW_LINEOUT_INSERT,
Expand Down Expand Up @@ -112,10 +112,10 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,

jack->type = type;

for (i = 0; i < ARRAY_SIZE(jack_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_types[i]);
jack_switch_types[i]);

err = snd_device_new(card, SNDRV_DEV_JACK, jack, &ops);
if (err < 0)
Expand Down Expand Up @@ -163,10 +163,11 @@ void snd_jack_report(struct snd_jack *jack, int status)
if (!jack)
return;

for (i = 0; i < ARRAY_SIZE(jack_types); i++) {
for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++) {
int testbit = 1 << i;
if (jack->type & testbit)
input_report_switch(jack->input_dev, jack_types[i],
input_report_switch(jack->input_dev,
jack_switch_types[i],
status & testbit);
}

Expand Down

0 comments on commit 1c6e555

Please sign in to comment.