dsp: fix configuration of EC reference
The check open_v8.endpoint_id_2 != 0xFFFF can only
be true if changed after initializing open_v8.endpoint_id_2
to 0xFFFF. If not, EC reference will never be configured
correctly. Fixing code to account for that.
Change-Id: I8d2aba19ae1f60ace118c828a98d5fecb149be18
Signed-off-by: Dieter Luecking <dieterl@codeaurora.org>
diff --git a/dsp/q6adm.c b/dsp/q6adm.c
index b9c11ac..265ae93 100644
--- a/dsp/q6adm.c
+++ b/dsp/q6adm.c
@@ -2939,6 +2939,10 @@
open_v8.endpoint_id_2 = 0xFFFF;
open_v8.endpoint_id_3 = 0xFFFF;
+ if (this_adm.ec_ref_rx && (path != ADM_PATH_PLAYBACK)) {
+ open_v8.endpoint_id_2 = this_adm.ec_ref_rx;
+ this_adm.ec_ref_rx = -1;
+ }
open_v8.topology_id = topology;
open_v8.reserved = 0;
@@ -2969,11 +2973,8 @@
if ((this_adm.num_ec_ref_rx_chans != 0)
&& (path != ADM_PATH_PLAYBACK)
&& (open_v8.endpoint_id_2 != 0xFFFF)) {
- open_v8.endpoint_id_2 = this_adm.ec_ref_rx;
- this_adm.ec_ref_rx = -1;
ep2_payload.dev_num_channel =
this_adm.num_ec_ref_rx_chans;
- this_adm.num_ec_ref_rx_chans = 0;
if (this_adm.ec_ref_rx_bit_width != 0) {
ep2_payload.bit_width =
@@ -3019,6 +3020,7 @@
if ((this_adm.num_ec_ref_rx_chans != 0)
&& (path != ADM_PATH_PLAYBACK)
&& (open_v8.endpoint_id_2 != 0xFFFF)) {
+ this_adm.num_ec_ref_rx_chans = 0;
memcpy(adm_params + sizeof(open_v8)
+ ep1_payload_size,
(void *)&ep2_payload,