aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-02-29 12:08:00 -0500
committerMark Brown <broonie@kernel.org>2016-02-29 22:05:35 -0500
commit4b606316129571c46381430852c149855ac50477 (patch)
tree458fbfd1bb3a8683a058b98d135b8490908d4963
parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
ASoC: ab8500: Fix enum ctl accesses in a wrong type
"Sidetone Status" and "ANC Status" ctls in ab8500 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>
-rw-r--r--sound/soc/codecs/ab8500-codec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c
index affb192238a4..faae6936bae4 100644
--- a/sound/soc/codecs/ab8500-codec.c
+++ b/sound/soc/codecs/ab8500-codec.c
@@ -1130,7 +1130,7 @@ static int sid_status_control_get(struct snd_kcontrol *kcontrol,
1130 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); 1130 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
1131 1131
1132 mutex_lock(&drvdata->ctrl_lock); 1132 mutex_lock(&drvdata->ctrl_lock);
1133 ucontrol->value.integer.value[0] = drvdata->sid_status; 1133 ucontrol->value.enumerated.item[0] = drvdata->sid_status;
1134 mutex_unlock(&drvdata->ctrl_lock); 1134 mutex_unlock(&drvdata->ctrl_lock);
1135 1135
1136 return 0; 1136 return 0;
@@ -1147,7 +1147,7 @@ static int sid_status_control_put(struct snd_kcontrol *kcontrol,
1147 1147
1148 dev_dbg(codec->dev, "%s: Enter\n", __func__); 1148 dev_dbg(codec->dev, "%s: Enter\n", __func__);
1149 1149
1150 if (ucontrol->value.integer.value[0] != SID_APPLY_FIR) { 1150 if (ucontrol->value.enumerated.item[0] != SID_APPLY_FIR) {
1151 dev_err(codec->dev, 1151 dev_err(codec->dev,
1152 "%s: ERROR: This control supports '%s' only!\n", 1152 "%s: ERROR: This control supports '%s' only!\n",
1153 __func__, enum_sid_state[SID_APPLY_FIR]); 1153 __func__, enum_sid_state[SID_APPLY_FIR]);
@@ -1199,7 +1199,7 @@ static int anc_status_control_get(struct snd_kcontrol *kcontrol,
1199 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); 1199 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
1200 1200
1201 mutex_lock(&drvdata->ctrl_lock); 1201 mutex_lock(&drvdata->ctrl_lock);
1202 ucontrol->value.integer.value[0] = drvdata->anc_status; 1202 ucontrol->value.enumerated.item[0] = drvdata->anc_status;
1203 mutex_unlock(&drvdata->ctrl_lock); 1203 mutex_unlock(&drvdata->ctrl_lock);
1204 1204
1205 return 0; 1205 return 0;
@@ -1220,7 +1220,7 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol,
1220 1220
1221 mutex_lock(&drvdata->ctrl_lock); 1221 mutex_lock(&drvdata->ctrl_lock);
1222 1222
1223 req = ucontrol->value.integer.value[0]; 1223 req = ucontrol->value.enumerated.item[0];
1224 if (req >= ARRAY_SIZE(enum_anc_state)) { 1224 if (req >= ARRAY_SIZE(enum_anc_state)) {
1225 status = -EINVAL; 1225 status = -EINVAL;
1226 goto cleanup; 1226 goto cleanup;