summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorOla Lilja <ola.o.lilja@stericsson.com>2011-07-05 17:48:08 +0200
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 16:07:33 +0200
commit36c04dc32e6e43d6c485836e99bbc5095c31812f (patch)
treee4c985567f74c9496a4741aef28ee4f315798c52 /sound
parent0a894396aa9ff75fd83f460af2bf83578fbdea75 (diff)
Ux500 ASoC: Fix FIR-coeffecient limit
The value limit in ALSA-control for sidetone FIR-coeffecients changed to match 2 * 8 bits. ST Ericsson ID: CR345207 ST Ericsson FOSS-OUT ID: trivial ST Ericsson Linux next: N/A Change-Id: I2f56b5c1a9905bfad943c39798b7c856e2ce5f1b Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/26618 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30801 Reviewed-by: Roger NILSSON1 <roger.xr.nilsson@stericsson.com> Tested-by: Roger NILSSON1 <roger.xr.nilsson@stericsson.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/ab8500_audio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/codecs/ab8500_audio.c b/sound/soc/codecs/ab8500_audio.c
index 52b32839f08..9a06007c1bd 100644
--- a/sound/soc/codecs/ab8500_audio.c
+++ b/sound/soc/codecs/ab8500_audio.c
@@ -290,7 +290,7 @@ static int st_fir_value_control_info(struct snd_kcontrol *kcontrol,
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
uinfo->value.integer.min = 0;
- uinfo->value.integer.max = REG_MASK_ALL;
+ uinfo->value.integer.max = (REG_MASK_ALL+1) * (REG_MASK_ALL+1) - 1;
return 0;
}
@@ -305,8 +305,9 @@ static int st_fir_value_control_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
int ret;
- unsigned int val_msb = (int)ucontrol->value.integer.value[0] / 256;
- unsigned int val_lsb = (int)ucontrol->value.integer.value[0] - val_msb * 256;
+ unsigned int val_msb = (int)ucontrol->value.integer.value[0] / (REG_MASK_ALL+1);
+ unsigned int val_lsb = (int)ucontrol->value.integer.value[0] -
+ val_msb * (REG_MASK_ALL+1);
ret = ab8500_codec_write_reg_audio(ab8500_codec, REG_SIDFIRCOEF1, val_msb);
ret |= ab8500_codec_write_reg_audio(ab8500_codec, REG_SIDFIRCOEF2, val_lsb);
if (ret < 0) {