From 36c04dc32e6e43d6c485836e99bbc5095c31812f Mon Sep 17 00:00:00 2001 From: Ola Lilja Date: Tue, 5 Jul 2011 17:48:08 +0200 Subject: 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 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/26618 Reviewed-by: QATEST Reviewed-by: Jonas ABERG Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30801 Reviewed-by: Roger NILSSON1 Tested-by: Roger NILSSON1 --- sound/soc/codecs/ab8500_audio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sound') 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) { -- cgit v1.2.3