Commit c5232c01 authored by Keyon Jie's avatar Keyon Jie Committed by Mark Brown

ASoC: SOF: topology: parse and store d0i3_compatible flag

Parses the token from tplg file and store it to snd_sof_pcm_stream
d0i3_compatible flag, which can be used later for d0ix transition
management.
Signed-off-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191025224122.7718-10-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4a949409
......@@ -2307,6 +2307,7 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index,
{
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct snd_soc_tplg_stream_caps *caps;
struct snd_soc_tplg_private *private = &pcm->priv;
struct snd_sof_pcm *spcm;
int stream = SNDRV_PCM_STREAM_PLAYBACK;
int ret = 0;
......@@ -2329,10 +2330,22 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index,
dai_drv->dobj.private = spcm;
list_add(&spcm->list, &sdev->pcm_list);
ret = sof_parse_tokens(scomp, spcm, stream_tokens,
ARRAY_SIZE(stream_tokens), private->array,
le32_to_cpu(private->size));
if (ret) {
dev_err(sdev->dev, "error: parse stream tokens failed %d\n",
le32_to_cpu(private->size));
return ret;
}
/* do we need to allocate playback PCM DMA pages */
if (!spcm->pcm.playback)
goto capture;
dev_vdbg(sdev->dev, "tplg: pcm %s stream tokens: playback d0i3:%d\n",
spcm->pcm.pcm_name, spcm->stream[0].d0i3_compatible);
caps = &spcm->pcm.caps[stream];
/* allocate playback page table buffer */
......@@ -2360,6 +2373,9 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index,
if (!spcm->pcm.capture)
return ret;
dev_vdbg(sdev->dev, "tplg: pcm %s stream tokens: capture d0i3:%d\n",
spcm->pcm.pcm_name, spcm->stream[1].d0i3_compatible);
caps = &spcm->pcm.caps[stream];
/* allocate capture page table buffer */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment