diff options
author | Margarita Olaya Cabrera <magi.olaya@ti.com> | 2010-10-11 17:17:44 -0500 |
---|---|---|
committer | Ricardo Perez Olivares <x0081762@ti.com> | 2010-10-12 17:48:08 -0500 |
commit | ba1f4b6700d4a4668d3aaae7c89b415ced884c1e (patch) | |
tree | be67ec048d8a21a479c0e51c52f2bb51b77a0ee6 | |
parent | 42b49ec33324e974ce2e66ca9a11ccd92480a486 (diff) |
ASoC: ABE DSP: Fix main port algorithm
The algorithm to select a valid port for synchro only selected
the port when status was different to running then selection
was not correct when called from disable_data_transfer.
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
-rw-r--r-- | sound/soc/omap/abe/abe_lib.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/soc/omap/abe/abe_lib.c b/sound/soc/omap/abe/abe_lib.c index fb1b1d8bb9ce..b63d6f54d263 100644 --- a/sound/soc/omap/abe/abe_lib.c +++ b/sound/soc/omap/abe/abe_lib.c @@ -500,11 +500,8 @@ void abe_gain_offset(u32 id, u32 *mixer_offset) */ u32 abe_valid_port_for_synchro(u32 id) { - if ((abe_port[id].protocol.protocol_switch == - DMAREQ_PORT_PROT) || - (abe_port[id].protocol.protocol_switch == - PINGPONG_PORT_PROT) || - (abe_port[id].status != OMAP_ABE_PORT_ACTIVITY_RUNNING)) + if ((abe_port[id].protocol.protocol_switch == DMAREQ_PORT_PROT) || + (abe_port[id].protocol.protocol_switch == PINGPONG_PORT_PROT)) return 0; else return 1; @@ -512,14 +509,16 @@ u32 abe_valid_port_for_synchro(u32 id) void abe_decide_main_port(u32 id) { u32 i; + if (abe_valid_port_for_synchro(id)) { for (i = 0; i < (LAST_PORT_ID - 1); i++) { - printk("Port (%d,%d) %d\n", i, abe_port_priority[i], - abe_port[abe_port_priority[i]].status); if (abe_port[abe_port_priority[i]].status == - OMAP_ABE_PORT_ACTIVITY_RUNNING) + OMAP_ABE_PORT_ACTIVITY_RUNNING) break; } - abe_select_main_port(abe_port_priority[i]); + + if (i < (LAST_PORT_ID - 1)) + id = abe_port_priority[i]; + abe_select_main_port(id); } } |