MLK-19662 sound: asoc: add support for recording and hwvad in parallel
authorCosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Mon, 29 Oct 2018 12:15:05 +0000 (14:15 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit808a18aa870d0f98563c0b3076ac87cfdbcefd0e
treeab774e96ef5ec1cce1a03c057f19f88fed8d39b9
parentd84be9ab38c86bcb7b2015284f8fe45a16780345
MLK-19662 sound: asoc: add support for recording and hwvad in parallel

Remove all clock disable from driver suspend/hwvad_disable
to avoid crashing one or another when recording stops or
voice is detected and hwvad is disabled.
Another change done to make this work is to remove atomic
variables that guard mutual exclusion between recording and
VAD.
We have also added a restriction such that recording rate
should be the same as hwvad rate when hwvad is enabled to
avoid changing the mclk rate.
However, the hwvad can be enabled before or after recording
but not when recording is done. On the other hand, recording
can be triggered at any time.
I am not sure we are supposed to support recording and hwvad
in parallel since micfil documentation requires PDM to be
disabled when any initialization or reconfiguration of hwvad
is done. An workaround to make this working is never disabling
the pdm module from hwvad functions and this seems to work,
even we are not following the whole reconfiguration procedure.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit bd0c73a0b4367be6a204667aa9c261a23b13516e)
sound/soc/fsl/fsl_micfil.c
sound/soc/fsl/fsl_micfil.h