From f55db62ec6a17a50cc3f82729c7aaee82dc56033 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Tue, 5 Nov 2019 06:44:30 +0800 Subject: [PATCH] ASoC: SOF: PM: add state machine to comments Add Audio DSP state machine with comments, be noticed that the 'D0<-->runtime D0I3' part is not implemented yet. Signed-off-by: Keyon Jie --- sound/soc/sof/pm.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index 1436cb201fa0..0fd5567237a8 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -431,6 +431,38 @@ int snd_sof_set_d0_substate(struct snd_sof_dev *sdev, } EXPORT_SYMBOL(snd_sof_set_d0_substate); +/* + * Audio DSP states may transform as below:- + * + * D0I3 compatible stream + * Runtime +---------------------+ opened only, timeout + * suspend | +--------------------+ + * +------------+ D0(active) | | + * | | <---------------+ | + * | +--------> | | | + * | |Runtime +--^--+---------^--+--+ The last | | + * | |resume | | | | opened D0I3 | | + * | | | | | | compatible | | + * | | resume| | | | stream closed | | + * | | from | | D3 | | | | + * | | D3 | |suspend | | d0i3 | | + * | | | | | |suspend | | + * | | | | | | | | + * | | | | | | | | + * +-v---+-----------+--v-------+ | | +------+----v----+ + * | | | +-----------> | + * | D3 (suspended) | | | D0I3 +-----+ + * | | +--------------+ | | + * | | resume from | | | + * +-------------------^--------+ d0i3 suspend +----------------+ | + * | | + * | D3 suspend | + * +------------------------------------------------+ + * + * d0i3_suspend = s0_suspend && D0I3 stream opened, + * D3 suspend = !d0i3_suspend, + */ + int snd_sof_resume(struct device *dev) { struct snd_sof_dev *sdev = dev_get_drvdata(dev);