From 8b0abba9d790ffbe6681ef98f0ccb952ffde530e Mon Sep 17 00:00:00 2001 From: Chaithanya Krishna Bacharaju Date: Fri, 11 Jan 2019 19:35:54 +0530 Subject: [PATCH] dsp: Check ec ref rx port against AFE_PORT_INVALID ec ref rx port is defined as integer and it is set to 0xFFFF (AFE_PORT_INVALID) when ec controls are reset. Due to this the current check against -1 (0xFFFFFFFF) in adm open will always return true even after controls are reset. This leads to adm open failures in case no ec ref channels are set as part of record usecase. Avoid this by checking ec ref rx port against AFE_PORT_INVALID. Change-Id: I0d52bbe2a980d495933239315e6bba193a18567e Signed-off-by: Chaithanya Krishna Bacharaju --- dsp/q6adm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dsp/q6adm.c b/dsp/q6adm.c index 688012f727d9..4946987861f2 100644 --- a/dsp/q6adm.c +++ b/dsp/q6adm.c @@ -2895,8 +2895,9 @@ 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 != -1) && - (path != ADM_PATH_PLAYBACK)) { + if (((this_adm.ec_ref_rx & AFE_PORT_INVALID) != + AFE_PORT_INVALID) && + (path != ADM_PATH_PLAYBACK)) { if (this_adm.num_ec_ref_rx_chans != 0) { open_v8.endpoint_id_2 = this_adm.ec_ref_rx;