Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 127ee199 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown
Browse files

ASoC: pxa: magician: Fix enum ctl accesses in a wrong type



"Input Select" ctl in magician driver is an enum, while the current
driver accesses wrongly via value.integer.value[].  They have to be
via value.enumerated.item[] instead.

(Meanwhile "Headphone Switch" and "Speaker Switch" are boolean, so
 they should stay to access via value.integer.value[] as is.)

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1457ad0e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -308,17 +308,17 @@ static int magician_set_spk(struct snd_kcontrol *kcontrol,
static int magician_get_input(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_value *ucontrol)
{
	ucontrol->value.integer.value[0] = magician_in_sel;
	ucontrol->value.enumerated.item[0] = magician_in_sel;
	return 0;
}

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

	magician_in_sel = ucontrol->value.integer.value[0];
	magician_in_sel = ucontrol->value.enumerated.item[0];

	switch (magician_in_sel) {
	case MAGICIAN_MIC: