From 8e30e086e5003d2efe1636fa0faa14bca0b6c12f Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Thu, 13 Aug 2026 22:29:06 +0300 Subject: [PATCH] ASoC: SOF: ipc4: add D0I3 stream compatibility support for S0ix Enable ipc4 D0I3 stream compatibility support for S0ix by removing d0i3_supported_in_s0ix, the feature gating flag in struct sof_ipc_pcm_ops. Since both ipc3 an ipc4 now support the feature, there is no need for the flag anymore. However, since in ipc4 the d0i3_compatible flag is also used with deep-buffer capture support, we need to separate that case from the Wake on Voice support. We do it by checking the streams dsp_max_burst_size_in_ms. After this change the suspend_ignored logic in pcm.c applies also to IPC4 streams, allowing the DSP to remain in D0i3 during S0ix when D0I3-compatible streams are active (e.g. wake-on-voice keyword detection). Signed-off-by: Jyri Sarha --- sound/soc/sof/ipc3-pcm.c | 1 - sound/soc/sof/pcm.c | 7 +++---- sound/soc/sof/sof-audio.h | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sound/soc/sof/ipc3-pcm.c b/sound/soc/sof/ipc3-pcm.c index 42f93e596598fd..b95e888c0adb84 100644 --- a/sound/soc/sof/ipc3-pcm.c +++ b/sound/soc/sof/ipc3-pcm.c @@ -431,7 +431,6 @@ const struct sof_ipc_pcm_ops ipc3_pcm_ops = { .trigger = sof_ipc3_pcm_trigger, .dai_link_fixup = sof_ipc3_pcm_dai_link_fixup, .reset_hw_params_during_stop = true, - .d0i3_supported_in_s0ix = true, #if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS) .compress_ops = &sof_ipc3_compressed_ops, #endif diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 42738f12fa3390..9462a706c3cd67 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -430,11 +430,10 @@ static int sof_pcm_trigger(struct snd_soc_component *component, break; case SNDRV_PCM_TRIGGER_SUSPEND: /* - * If DSP D0I3 is allowed during S0iX, set the suspend_ignored flag for - * D0I3-compatible streams to keep the firmware pipeline running + * Set the suspend_ignored flag for D0I3-compatible + * streams to keep the firmware pipeline running */ - if (pcm_ops && pcm_ops->d0i3_supported_in_s0ix && - sdev->system_suspend_target == SOF_SUSPEND_S0IX && + if (sdev->system_suspend_target == SOF_SUSPEND_S0IX && spcm->stream[substream->stream].d0i3_compatible) { spcm->stream[substream->stream].suspend_ignored = true; return 0; diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h index b60246fd5869b1..0d3650f7a67002 100644 --- a/sound/soc/sof/sof-audio.h +++ b/sound/soc/sof/sof-audio.h @@ -121,7 +121,6 @@ struct snd_sof_dai_config_data { * triggers. The FW keeps the host DMA running in this case and * therefore the host must do the same and should stop the DMA during * hw_free. - * @d0i3_supported_in_s0ix: Allow DSP D0I3 during S0iX * @compress_ops: Pointer to ops for compressed streams */ struct sof_ipc_pcm_ops { @@ -143,7 +142,6 @@ struct sof_ipc_pcm_ops { bool reset_hw_params_during_stop; bool ipc_first_on_start; bool platform_stop_during_hw_free; - bool d0i3_supported_in_s0ix; const struct snd_compress_ops *compress_ops; };