Commits

Weiguang Kong committed 1b5aa60b1aa
MLK-16558: ASoC: fsl_hifi4: add reference counter for hifi4 device When abnormal situation occurs and the current process terminates abnormally, the hifi4 driver can't get the HIFI4_CODEC_CLOSE CMD from user space to release the multi-codec resource, so the current resource can't be used again. Have found that the fsl_hifi4_close() function can be called implicitly when process terminates abnormally, so add a reference counter in fsl_hifi4_open() and fsl_hifi4_close() to check this abnormal situation, when the number is same for opening and closing hifi4 device, the multi-codec should be reinitialized again and the hifi4 driver should send ICM_EXT_MSG_ADDR CMD to hifi4 framework to initialize the multi-codec resources too. Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>