diff options
author | Sebastien Guiriec <s-guiriec@ti.com> | 2011-07-13 02:54:44 -0500 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-08-03 17:43:00 -0700 |
commit | b00dc7412c2841bacf83456c218a17fdd694d0ed (patch) | |
tree | 12adc38766c37addba727d2f1018a1d5202da9c8 /sound/soc | |
parent | a196bac8df4d7def1f0f3f3930ff6cc3d8ad9b67 (diff) | |
download | kernel_samsung_tuna-b00dc7412c2841bacf83456c218a17fdd694d0ed.zip kernel_samsung_tuna-b00dc7412c2841bacf83456c218a17fdd694d0ed.tar.gz kernel_samsung_tuna-b00dc7412c2841bacf83456c218a17fdd694d0ed.tar.bz2 |
ASoC: ABE DSP: Fixes for firmware equalizer parsing
Fixes firmware parsing for equalizer coefficients stage and parameters
passed to ABE HAL to write equalizer coefficients.
Change-Id: I796b75f27c094d769ec586068ca8b242b0701157
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/omap/omap-abe-dsp.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/soc/omap/omap-abe-dsp.c b/sound/soc/omap/omap-abe-dsp.c index ecc855a..52b9214 100644 --- a/sound/soc/omap/omap-abe-dsp.c +++ b/sound/soc/omap/omap-abe-dsp.c @@ -748,18 +748,22 @@ static int abe_put_equalizer(struct snd_kcontrol *kcontrol, struct soc_enum *eqc = (struct soc_enum *)kcontrol->private_value; u16 val = ucontrol->value.enumerated.item[0]; abe_equ_t equ_params; - int size; + int len; - if (val >= the_abe->hdr.num_equ) + if (eqc->reg >= the_abe->hdr.num_equ) return -EINVAL; - equ_params.equ_length = the_abe->equ_texts[eqc->reg].coeff; - size = the_abe->equ_texts[eqc->reg].coeff * sizeof(s32); - memcpy(equ_params.coef.type1, the_abe->equ[eqc->reg] + val * size, size); + if (val >= the_abe->equ_texts[eqc->reg].count) + return -EINVAL; + + len = the_abe->equ_texts[eqc->reg].coeff; + equ_params.equ_length = len; + memcpy(equ_params.coef.type1, the_abe->equ[eqc->reg] + val * len, + len * sizeof(u32)); the_abe->equ_profile[eqc->reg] = val; pm_runtime_get_sync(the_abe->dev); - abe_write_equalizer(eqc->reg, &equ_params); + abe_write_equalizer(eqc->reg + 1, &equ_params); pm_runtime_put_sync(the_abe->dev); return 1; @@ -2380,7 +2384,7 @@ static int abe_probe(struct snd_soc_platform *platform) /* initialise coefficient equalizers */ for (i = 1; i < abe->hdr.num_equ; i++) { abe->equ[i] = abe->equ[i - 1] + - abe->equ_texts[i - 1].count * abe->equ_texts[i - 1].coeff * sizeof(s32); + abe->equ_texts[i - 1].count * abe->equ_texts[i - 1].coeff; } /* store ABE firmware for later context restore */ |