Commit 15c66570 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: wm_adsp: Fix enum ctl accesses in a wrong type

The firmware ctls like "DSP1 Firmware" in wm_adsp codec driver are
enum, while the current driver accesses wrongly via
value.integer.value[].  They have to be via value.enumerated.item[]
instead.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
parent 92e963f5
...@@ -586,7 +586,7 @@ static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol, ...@@ -586,7 +586,7 @@ static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec); struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
ucontrol->value.integer.value[0] = dsp[e->shift_l].fw; ucontrol->value.enumerated.item[0] = dsp[e->shift_l].fw;
return 0; return 0;
} }
...@@ -599,10 +599,10 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol, ...@@ -599,10 +599,10 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec); struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
int ret = 0; int ret = 0;
if (ucontrol->value.integer.value[0] == dsp[e->shift_l].fw) if (ucontrol->value.enumerated.item[0] == dsp[e->shift_l].fw)
return 0; return 0;
if (ucontrol->value.integer.value[0] >= WM_ADSP_NUM_FW) if (ucontrol->value.enumerated.item[0] >= WM_ADSP_NUM_FW)
return -EINVAL; return -EINVAL;
mutex_lock(&dsp[e->shift_l].pwr_lock); mutex_lock(&dsp[e->shift_l].pwr_lock);
...@@ -610,7 +610,7 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol, ...@@ -610,7 +610,7 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
if (dsp[e->shift_l].running || dsp[e->shift_l].compr) if (dsp[e->shift_l].running || dsp[e->shift_l].compr)
ret = -EBUSY; ret = -EBUSY;
else else
dsp[e->shift_l].fw = ucontrol->value.integer.value[0]; dsp[e->shift_l].fw = ucontrol->value.enumerated.item[0];
mutex_unlock(&dsp[e->shift_l].pwr_lock); mutex_unlock(&dsp[e->shift_l].pwr_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment