ASoC: mediatek: mt8195: add sof be ops to check audio active
authorYC Hung <yc.hung@mediatek.com>
Fri, 9 Dec 2022 03:10:53 +0000 (11:10 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 12 Dec 2022 15:44:23 +0000 (15:44 +0000)
commit83f1b7f39af73b01edf098fe3141404670703281
treeb2d04c5e88504022f814ff7eacf2602d46527f49
parente85b1f5a9769ac30f4d2f6fb1cdcd9570c38e0c1
ASoC: mediatek: mt8195: add sof be ops to check audio active

In MT8195 SOF design, both DSP and audio driver would access audio
registers. Before DSP accesses audio registers, audio power and clock
should be enabled. DSP will hang up if DSP access audio register but
audio power and clock are disabled. Therefore, we add audio pm runtime
active checking before accessing audio registers in SOF BE's callback
hw_params function to avoid this situation.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20221209031053.8444-1-yc.hung@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8195/mt8195-mt6359.c