diff options
author | Ola Lilja <ola.o.lilja@stericsson.com> | 2011-07-05 17:48:08 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:04:56 +0200 |
commit | c1ef9515febd2728205849f5bc9c558bc94227af (patch) | |
tree | 840d25103e6f3fb2b5ef745728e4147575dba58e | |
parent | 74315832545740fa988248f141b7057d243c875a (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>
-rw-r--r-- | sound/soc/codecs/ab8500_audio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/codecs/ab8500_audio.c b/sound/soc/codecs/ab8500_audio.c index 94b87f6c4d2..6d8a8213366 100644 --- a/sound/soc/codecs/ab8500_audio.c +++ b/sound/soc/codecs/ab8500_audio.c @@ -293,7 +293,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; } @@ -308,8 +308,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) { |