Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sound/soc/sof/ipc4-pcm.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -1336,6 +1336,7 @@ const struct sof_ipc_pcm_ops ipc4_pcm_ops = {
.delay = sof_ipc4_pcm_delay,
.ipc_first_on_start = true,
.platform_stop_during_hw_free = true,
.d0i3_supported_in_s0ix = true,
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS)
.compress_ops = &sof_ipc4_compressed_ops,
#endif
Expand Down
28 changes: 28 additions & 0 deletions sound/soc/sof/ipc4-topology.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -136,6 +136,14 @@ static const struct sof_topology_token ipc4_copier_deep_buffer_tokens[] = {
{SOF_TKN_INTEL_COPIER_DEEP_BUFFER_DMA_MS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 0},
};

static const struct sof_topology_token ipc4_stream_playback_d0i3_tokens[] = {
{SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u32, 0},
};

static const struct sof_topology_token ipc4_stream_capture_d0i3_tokens[] = {
{SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u32, 0},
};

static const struct sof_topology_token ipc4_copier_tokens[] = {
{SOF_TKN_INTEL_COPIER_NODE_TYPE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 0},
};
Expand DownExpand Up@@ -211,6 +219,12 @@ static const struct sof_token_info ipc4_token_list[SOF_TOKEN_COUNT] = {
ipc4_copier_deep_buffer_tokens, ARRAY_SIZE(ipc4_copier_deep_buffer_tokens)},
[SOF_COPIER_TOKENS] = {"IPC4 Copier tokens", ipc4_copier_tokens,
ARRAY_SIZE(ipc4_copier_tokens)},
[SOF_STREAM_PLAYBACK_D0I3_TOKENS] = {"IPC4 Stream playback D0I3 tokens",
ipc4_stream_playback_d0i3_tokens,
ARRAY_SIZE(ipc4_stream_playback_d0i3_tokens)},
[SOF_STREAM_CAPTURE_D0I3_TOKENS] = {"IPC4 Stream capture D0I3 tokens",
ipc4_stream_capture_d0i3_tokens,
ARRAY_SIZE(ipc4_stream_capture_d0i3_tokens)},
[SOF_AUDIO_FMT_NUM_TOKENS] = {"IPC4 Audio format number tokens",
ipc4_audio_fmt_num_tokens, ARRAY_SIZE(ipc4_audio_fmt_num_tokens)},
[SOF_GAIN_TOKENS] = {"Gain tokens", gain_tokens, ARRAY_SIZE(gain_tokens)},
Expand DownExpand Up@@ -680,6 +694,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget)
struct snd_sof_pcm_stream *sps;
struct snd_sof_pcm *spcm;
int node_type = 0;
u32 d0i3 = 0;
int ret, dir;

ipc4_copier = kzalloc_obj(*ipc4_copier);
Expand DownExpand Up@@ -731,6 +746,17 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget)
swidget->tuples,
swidget->num_tuples, sizeof(u32), 1);

/* Parse D0I3 compatibility token for this stream direction */
sof_update_ipc_object(scomp, &d0i3,
dir == SNDRV_PCM_STREAM_PLAYBACK ?
SOF_STREAM_PLAYBACK_D0I3_TOKENS :
SOF_STREAM_CAPTURE_D0I3_TOKENS,
swidget->tuples,
swidget->num_tuples, sizeof(d0i3), 1);
sps->d0i3_compatible = !!d0i3;
dev_dbg(scomp->dev, "PCM '%s' dir %d d0i3_compatible %d\n",
spcm->pcm.pcm_name, dir, sps->d0i3_compatible);

/* Set default DMA buffer size if it is not specified in topology */
if (!sps->dsp_max_burst_size_in_ms) {
struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
Expand DownExpand Up@@ -4265,6 +4291,8 @@ static enum sof_tokens copier_token_list[] = {
SOF_COMP_EXT_TOKENS,

SOF_COPIER_DEEP_BUFFER_TOKENS, /* for AIF copier */
SOF_STREAM_PLAYBACK_D0I3_TOKENS, /* for AIF copier */
SOF_STREAM_CAPTURE_D0I3_TOKENS, /* for AIF copier */
SOF_DAI_TOKENS, /* for DAI copier */
};

Expand Down
6 changes: 6 additions & 0 deletions sound/soc/sof/pcm.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -433,6 +433,12 @@ static int sof_pcm_trigger(struct snd_soc_component *component,
* If DSP D0I3 is allowed during S0iX, set the suspend_ignored flag for
* D0I3-compatible streams to keep the firmware pipeline running
*/
dev_dbg(sdev->dev,
"PCM '%s' dir %d: d0i3_supported_in_s0ix %d, suspend_target %d, d0i3_compatible %d\n",
spcm->pcm.pcm_name, substream->stream,
pcm_ops ? pcm_ops->d0i3_supported_in_s0ix : -1,
sdev->system_suspend_target,
spcm->stream[substream->stream].d0i3_compatible);
if (pcm_ops && pcm_ops->d0i3_supported_in_s0ix &&
sdev->system_suspend_target == SOF_SUSPEND_S0IX &&
spcm->stream[substream->stream].d0i3_compatible) {
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/sof/sof-audio.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -289,6 +289,8 @@ enum sof_tokens {
SOF_OUT_AUDIO_FORMAT_TOKENS,
SOF_COPIER_DEEP_BUFFER_TOKENS,
SOF_COPIER_TOKENS,
SOF_STREAM_PLAYBACK_D0I3_TOKENS,
SOF_STREAM_CAPTURE_D0I3_TOKENS,
SOF_AUDIO_FMT_NUM_TOKENS,
SOF_COPIER_FORMAT_TOKENS,
SOF_GAIN_TOKENS,
Expand Down
Loading