Skip to content

Commit

Permalink
ASoC: wm8753: Fix enum ctl accesses in a wrong type
Browse files Browse the repository at this point in the history
"DAI Mode" ctl in wm8753 codec driver is 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 92e963f commit 0cad105
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/soc/codecs/wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static int wm8753_get_dai(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);

ucontrol->value.integer.value[0] = wm8753->dai_func;
ucontrol->value.enumerated.item[0] = wm8753->dai_func;
return 0;
}

Expand All @@ -244,15 +244,15 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
u16 ioctl;

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

if (snd_soc_codec_is_active(codec))
return -EBUSY;

ioctl = snd_soc_read(codec, WM8753_IOCTL);

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

if (((ioctl >> 2) & 0x3) == wm8753->dai_func)
return 1;
Expand Down

0 comments on commit 0cad105

Please sign in to comment.