Skip to content

Commit

Permalink
ASoC: pxa: tosa: Fix enum ctl accesses in a wrong type
Browse files Browse the repository at this point in the history
"Jack Function" and "Speaker Function" ctls in tosa are enum, while
the current driver accesses wrongly via value.integer.value[].  They
have to be via value.enumerated.item[] instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Mar 1, 2016
1 parent 49a1ba1 commit 419396d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sound/soc/pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static struct snd_soc_ops tosa_ops = {
static int tosa_get_jack(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
ucontrol->value.integer.value[0] = tosa_jack_func;
ucontrol->value.enumerated.item[0] = tosa_jack_func;
return 0;
}

Expand All @@ -104,18 +104,18 @@ static int tosa_set_jack(struct snd_kcontrol *kcontrol,
{
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);

if (tosa_jack_func == ucontrol->value.integer.value[0])
if (tosa_jack_func == ucontrol->value.enumerated.item[0])
return 0;

tosa_jack_func = ucontrol->value.integer.value[0];
tosa_jack_func = ucontrol->value.enumerated.item[0];
tosa_ext_control(&card->dapm);
return 1;
}

static int tosa_get_spk(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
ucontrol->value.integer.value[0] = tosa_spk_func;
ucontrol->value.enumerated.item[0] = tosa_spk_func;
return 0;
}

Expand All @@ -124,10 +124,10 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol,
{
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);

if (tosa_spk_func == ucontrol->value.integer.value[0])
if (tosa_spk_func == ucontrol->value.enumerated.item[0])
return 0;

tosa_spk_func = ucontrol->value.integer.value[0];
tosa_spk_func = ucontrol->value.enumerated.item[0];
tosa_ext_control(&card->dapm);
return 1;
}
Expand Down

0 comments on commit 419396d

Please sign in to comment.