Skip to content

Commit 90a2353

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: pcm: Restrict DSP D0i3 during S0ix to IPC3
Introduce a new field in struct sof_ipc_pcm_ops that can be used to restrict DSP D0i3 during S0ix suspend to IPC3. With IPC4, all streams must be stopped before S0ix suspend. Reviewed-by: Uday M Bhat <[email protected]> Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Ranjani Sridharan <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 305539a commit 90a2353

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

sound/soc/sof/ipc3-pcm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,4 +434,5 @@ const struct sof_ipc_pcm_ops ipc3_pcm_ops = {
434434
.trigger = sof_ipc3_pcm_trigger,
435435
.dai_link_fixup = sof_ipc3_pcm_dai_link_fixup,
436436
.reset_hw_params_during_stop = true,
437+
.d0i3_supported_in_s0ix = true,
437438
};

sound/soc/sof/pcm.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,13 @@ static int sof_pcm_trigger(struct snd_soc_component *component,
325325
ipc_first = true;
326326
break;
327327
case SNDRV_PCM_TRIGGER_SUSPEND:
328-
if (sdev->system_suspend_target == SOF_SUSPEND_S0IX &&
328+
/*
329+
* If DSP D0I3 is allowed during S0iX, set the suspend_ignored flag for
330+
* D0I3-compatible streams to keep the firmware pipeline running
331+
*/
332+
if (pcm_ops && pcm_ops->d0i3_supported_in_s0ix &&
333+
sdev->system_suspend_target == SOF_SUSPEND_S0IX &&
329334
spcm->stream[substream->stream].d0i3_compatible) {
330-
/*
331-
* trap the event, not sending trigger stop to
332-
* prevent the FW pipelines from being stopped,
333-
* and mark the flag to ignore the upcoming DAPM
334-
* PM events.
335-
*/
336335
spcm->stream[substream->stream].suspend_ignored = true;
337336
return 0;
338337
}

sound/soc/sof/sof-audio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ struct snd_sof_dai_config_data {
116116
* triggers. The FW keeps the host DMA running in this case and
117117
* therefore the host must do the same and should stop the DMA during
118118
* hw_free.
119+
* @d0i3_supported_in_s0ix: Allow DSP D0I3 during S0iX
119120
*/
120121
struct sof_ipc_pcm_ops {
121122
int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
@@ -135,6 +136,7 @@ struct sof_ipc_pcm_ops {
135136
bool reset_hw_params_during_stop;
136137
bool ipc_first_on_start;
137138
bool platform_stop_during_hw_free;
139+
bool d0i3_supported_in_s0ix;
138140
};
139141

140142
/**

0 commit comments

Comments
 (0)