summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@slimlogic.co.uk>2010-09-02 21:30:13 +0100
committerRicardo Perez Olivares <x0081762@ti.com>2010-09-09 15:13:40 -0500
commita6240b889dfd467c30147916fc8624acbb759079 (patch)
tree4713177a3c22ad9c07d424ed842a7ac62d018e1f
parentba7139b3d7fddec7d8bd6b007acc75a0df2fc804 (diff)
HAL0800: make sure read and write mixer use same units.
Read and write mixer must use the same units for gain values. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
-rw-r--r--sound/soc/omap/abe/abe_api.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/soc/omap/abe/abe_api.c b/sound/soc/omap/abe/abe_api.c
index 3ec70e1ca619..3ecb988e086a 100644
--- a/sound/soc/omap/abe/abe_api.c
+++ b/sound/soc/omap/abe/abe_api.c
@@ -263,7 +263,7 @@ EXPORT_SYMBOL(abe_read_hardware_configuration);
* for the delivery of "end of time sequenced tasks" notifications, some are
* originated from the Ping-Pong protocols, some are generated from
* the embedded debugger when the firmware stops on programmable break-points,
- * etc …
+ * etc
*/
abehal_status abe_irq_processing (void)
{
@@ -1600,6 +1600,7 @@ EXPORT_SYMBOL(abe_write_mixer);
abehal_status abe_read_gain (u32 id, u32 *f_g, u32 p)
{
u32 mixer_target, mixer_offset;
+ int i;
_log(id_read_gain,id,(u32)f_g,p)
@@ -1659,6 +1660,16 @@ abehal_status abe_read_gain (u32 id, u32 *f_g, u32 p)
abe_block_copy (COPY_FROM_ABE_TO_HOST, ABE_SMEM, mixer_target,
(u32*)f_g, sizeof(*f_g));
+ for (i = 0; i < sizeof_db2lin_table; i++) {
+ if (abe_db2lin_table[i] == *f_g)
+ goto found;
+ }
+ *f_g = 0;
+ return -1;
+
+found:
+ *f_g = (i * 100) + min_mdb;
+
return 0;
}
EXPORT_SYMBOL(abe_read_gain);