OSDN Git Service

ASoC: SOF: mediatek: mt8195 suspend check dsp idle
authorYC Hung <yc.hung@mediatek.com>
Mon, 6 Jun 2022 21:02:12 +0000 (16:02 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 6 Jun 2022 21:08:25 +0000 (22:08 +0100)
commit078f28fee5aa417169d8e8906815c684beddbe74
treeb7cebb1f68e510b2eb597c30aa380d7785948819
parent0bf4276cc7883d65e594926c1159d4c0712d02e7
ASoC: SOF: mediatek: mt8195 suspend check dsp idle

During suspend flow, sof_suspend will be called and the pm_ops->ctx_save
callback notifies DSP of the upcoming power down.

Upon receipt of the ctx_save IPC, the DSP will start the D3 transition.
Before the DSP enter idle, an interrupt is generated to notify the host of
the power state change.

Since the host and DSP are two different processors, there could be a
race condition, which can be avoided by polling with 1s timeout and 500us
intervals

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220606210212.146626-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/mediatek/mt8195/mt8195.c
sound/soc/sof/mediatek/mt8195/mt8195.h