From 4162083535585342b2c2ed688833cf2a1b824ac6 Mon Sep 17 00:00:00 2001 From: Dieter Luecking Date: Wed, 14 Nov 2018 15:11:47 +0100 Subject: [PATCH] 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 --- dsp/q6adm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dsp/q6adm.c b/dsp/q6adm.c index b9c11ac6b4c3..265ae939b0d8 100644 --- a/dsp/q6adm.c +++ b/dsp/q6adm.c @@ -2939,6 +2939,10 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology, 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 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology, 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 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology, 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,