소스 검색

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 <[email protected]>
Chaithanya Krishna Bacharaju 6 년 전
부모
커밋
8b0abba9d7
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      dsp/q6adm.c

+ 3 - 2
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;