Skip to content

Commit

Permalink
ASoC: wm_adsp: Fix enum ctl accesses in a wrong type
Browse files Browse the repository at this point in the history
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: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Mar 1, 2016
1 parent 92e963f commit 15c6657
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/soc/codecs/wm_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 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;
}
Expand All @@ -599,18 +599,18 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
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;

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

mutex_lock(&dsp[e->shift_l].pwr_lock);

if (dsp[e->shift_l].running || dsp[e->shift_l].compr)
ret = -EBUSY;
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);

Expand Down

0 comments on commit 15c6657

Please sign in to comment.