Commit 27e322fa authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASoC: SOF: define INFO_ flags in dsp_ops

Currently the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP are defined
in the SOF PCM core, which doesn't scale. To account for platform
variations, these flags need to be set in DSP ops.

This patch only moves the definitions and does not change any
functionality.
Reviewed-by: default avatarJaska Uimonen <jaska.uimonen@intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191024210318.30068-2-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8c05f6af
...@@ -388,6 +388,13 @@ struct snd_sof_dsp_ops sof_imx8_ops = { ...@@ -388,6 +388,13 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
/* DAI drivers */ /* DAI drivers */
.drv = imx8_dai, .drv = imx8_dai,
.num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */ .num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP
}; };
EXPORT_SYMBOL(sof_imx8_ops); EXPORT_SYMBOL(sof_imx8_ops);
......
...@@ -97,6 +97,13 @@ const struct snd_sof_dsp_ops sof_apl_ops = { ...@@ -97,6 +97,13 @@ const struct snd_sof_dsp_ops sof_apl_ops = {
.runtime_resume = hda_dsp_runtime_resume, .runtime_resume = hda_dsp_runtime_resume,
.runtime_idle = hda_dsp_runtime_idle, .runtime_idle = hda_dsp_runtime_idle,
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume, .set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
}; };
EXPORT_SYMBOL(sof_apl_ops); EXPORT_SYMBOL(sof_apl_ops);
......
...@@ -591,7 +591,14 @@ const struct snd_sof_dsp_ops sof_bdw_ops = { ...@@ -591,7 +591,14 @@ const struct snd_sof_dsp_ops sof_bdw_ops = {
/* DAI drivers */ /* DAI drivers */
.drv = bdw_dai, .drv = bdw_dai,
.num_drv = ARRAY_SIZE(bdw_dai) .num_drv = ARRAY_SIZE(bdw_dai),
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
}; };
EXPORT_SYMBOL(sof_bdw_ops); EXPORT_SYMBOL(sof_bdw_ops);
......
...@@ -532,6 +532,13 @@ const struct snd_sof_dsp_ops sof_tng_ops = { ...@@ -532,6 +532,13 @@ const struct snd_sof_dsp_ops sof_tng_ops = {
/* DAI drivers */ /* DAI drivers */
.drv = byt_dai, .drv = byt_dai,
.num_drv = 3, /* we have only 3 SSPs on byt*/ .num_drv = 3, /* we have only 3 SSPs on byt*/
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
}; };
EXPORT_SYMBOL(sof_tng_ops); EXPORT_SYMBOL(sof_tng_ops);
...@@ -693,6 +700,13 @@ const struct snd_sof_dsp_ops sof_byt_ops = { ...@@ -693,6 +700,13 @@ const struct snd_sof_dsp_ops sof_byt_ops = {
/* DAI drivers */ /* DAI drivers */
.drv = byt_dai, .drv = byt_dai,
.num_drv = 3, /* we have only 3 SSPs on byt*/ .num_drv = 3, /* we have only 3 SSPs on byt*/
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
}; };
EXPORT_SYMBOL(sof_byt_ops); EXPORT_SYMBOL(sof_byt_ops);
...@@ -753,6 +767,13 @@ const struct snd_sof_dsp_ops sof_cht_ops = { ...@@ -753,6 +767,13 @@ const struct snd_sof_dsp_ops sof_cht_ops = {
.drv = byt_dai, .drv = byt_dai,
/* all 6 SSPs may be available for cherrytrail */ /* all 6 SSPs may be available for cherrytrail */
.num_drv = ARRAY_SIZE(byt_dai), .num_drv = ARRAY_SIZE(byt_dai),
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
}; };
EXPORT_SYMBOL(sof_cht_ops); EXPORT_SYMBOL(sof_cht_ops);
......
...@@ -255,6 +255,13 @@ const struct snd_sof_dsp_ops sof_cnl_ops = { ...@@ -255,6 +255,13 @@ const struct snd_sof_dsp_ops sof_cnl_ops = {
.runtime_resume = hda_dsp_runtime_resume, .runtime_resume = hda_dsp_runtime_resume,
.runtime_idle = hda_dsp_runtime_idle, .runtime_idle = hda_dsp_runtime_idle,
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume, .set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
/* ALSA HW info flags */
.hw_info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
}; };
EXPORT_SYMBOL(sof_cnl_ops); EXPORT_SYMBOL(sof_cnl_ops);
......
...@@ -440,6 +440,7 @@ static int sof_pcm_open(struct snd_soc_component *component, ...@@ -440,6 +440,7 @@ static int sof_pcm_open(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
const struct snd_sof_dsp_ops *ops = sof_ops(sdev);
struct snd_sof_pcm *spcm; struct snd_sof_pcm *spcm;
struct snd_soc_tplg_stream_caps *caps; struct snd_soc_tplg_stream_caps *caps;
int ret; int ret;
...@@ -469,11 +470,8 @@ static int sof_pcm_open(struct snd_soc_component *component, ...@@ -469,11 +470,8 @@ static int sof_pcm_open(struct snd_soc_component *component,
le32_to_cpu(caps->period_size_min)); le32_to_cpu(caps->period_size_min));
/* set runtime config */ /* set runtime config */
runtime->hw.info = SNDRV_PCM_INFO_MMAP | runtime->hw.info = ops->hw_info; /* platform-specific */
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP;
runtime->hw.formats = le64_to_cpu(caps->formats); runtime->hw.formats = le64_to_cpu(caps->formats);
runtime->hw.period_bytes_min = le32_to_cpu(caps->period_size_min); runtime->hw.period_bytes_min = le32_to_cpu(caps->period_size_min);
runtime->hw.period_bytes_max = le32_to_cpu(caps->period_size_max); runtime->hw.period_bytes_max = le32_to_cpu(caps->period_size_max);
......
...@@ -211,6 +211,9 @@ struct snd_sof_dsp_ops { ...@@ -211,6 +211,9 @@ struct snd_sof_dsp_ops {
/* DAI ops */ /* DAI ops */
struct snd_soc_dai_driver *drv; struct snd_soc_dai_driver *drv;
int num_drv; int num_drv;
/* ALSA HW info flags, will be stored in snd_pcm_runtime.hw.info */
u32 hw_info;
}; };
/* DSP architecture specific callbacks for oops and stack dumps */ /* DSP architecture specific callbacks for oops and stack dumps */
......
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