MLK-20100 sound: asoc: make hwvad work after system suspend/resume
authorCosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Wed, 31 Oct 2018 15:00:02 +0000 (17:00 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commitf78a8b87af91583914adb6b95e1319ade91865dc
tree3f40c9659ebcd30ecaab153de5ff2ab4008dee76
parentd8d61973362ad2a1e824c8690c7ac2c95414e78f
MLK-20100 sound: asoc: make hwvad work after system suspend/resume

Implemented system suspend resume functions to call hwvad enable/disable
then do runtime_force_suspend/resume.
Since hwvad can run independently, when user calls enable/disable, we
will have to increment/decrement usage counter by calling
runtime_*_sync but to avoid doing this when disable/enable is called
from system_suspend/resume since we called pm_runtime functions - this
is why we have added the sync parameter in enable/disable_hwvad.
However, we ignore the busy flag because the module wasn't designed to
work with arecord and hwvad in parralel and we only print a warning.
Since hwvad and recording share the same clock and initialization
procedures require module to be disabled, the busy flag will be set
when having both features enabled.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit a73d9054a42b159e68b56b93f8834b121e82cde5)
sound/soc/fsl/fsl_micfil.c
sound/soc/fsl/fsl_micfil.h