Skip to content

Commit 27e322f

Browse files
plbossartbroonie
authored andcommitted
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: Jaska Uimonen <jaska.uimonen@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191024210318.30068-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8c05f6a commit 27e322f

7 files changed

Lines changed: 56 additions & 6 deletions

File tree

‎sound/soc/sof/imx/imx8.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,13 @@ struct snd_sof_dsp_ops sof_imx8_ops = {
388388
/* DAI drivers */
389389
.drv = imx8_dai,
390390
.num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */
391+
392+
/* ALSA HW info flags */
393+
.hw_info = SNDRV_PCM_INFO_MMAP |
394+
SNDRV_PCM_INFO_MMAP_VALID |
395+
SNDRV_PCM_INFO_INTERLEAVED |
396+
SNDRV_PCM_INFO_PAUSE |
397+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP
391398
};
392399
EXPORT_SYMBOL(sof_imx8_ops);
393400

‎sound/soc/sof/intel/apl.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ const struct snd_sof_dsp_ops sof_apl_ops = {
9797
.runtime_resume = hda_dsp_runtime_resume,
9898
.runtime_idle = hda_dsp_runtime_idle,
9999
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
100+
101+
/* ALSA HW info flags */
102+
.hw_info = SNDRV_PCM_INFO_MMAP |
103+
SNDRV_PCM_INFO_MMAP_VALID |
104+
SNDRV_PCM_INFO_INTERLEAVED |
105+
SNDRV_PCM_INFO_PAUSE |
106+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
100107
};
101108
EXPORT_SYMBOL(sof_apl_ops);
102109

‎sound/soc/sof/intel/bdw.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,14 @@ const struct snd_sof_dsp_ops sof_bdw_ops = {
591591

592592
/* DAI drivers */
593593
.drv = bdw_dai,
594-
.num_drv = ARRAY_SIZE(bdw_dai)
594+
.num_drv = ARRAY_SIZE(bdw_dai),
595+
596+
/* ALSA HW info flags */
597+
.hw_info = SNDRV_PCM_INFO_MMAP |
598+
SNDRV_PCM_INFO_MMAP_VALID |
599+
SNDRV_PCM_INFO_INTERLEAVED |
600+
SNDRV_PCM_INFO_PAUSE |
601+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
595602
};
596603
EXPORT_SYMBOL(sof_bdw_ops);
597604

‎sound/soc/sof/intel/byt.c‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,13 @@ const struct snd_sof_dsp_ops sof_tng_ops = {
532532
/* DAI drivers */
533533
.drv = byt_dai,
534534
.num_drv = 3, /* we have only 3 SSPs on byt*/
535+
536+
/* ALSA HW info flags */
537+
.hw_info = SNDRV_PCM_INFO_MMAP |
538+
SNDRV_PCM_INFO_MMAP_VALID |
539+
SNDRV_PCM_INFO_INTERLEAVED |
540+
SNDRV_PCM_INFO_PAUSE |
541+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
535542
};
536543
EXPORT_SYMBOL(sof_tng_ops);
537544

@@ -693,6 +700,13 @@ const struct snd_sof_dsp_ops sof_byt_ops = {
693700
/* DAI drivers */
694701
.drv = byt_dai,
695702
.num_drv = 3, /* we have only 3 SSPs on byt*/
703+
704+
/* ALSA HW info flags */
705+
.hw_info = SNDRV_PCM_INFO_MMAP |
706+
SNDRV_PCM_INFO_MMAP_VALID |
707+
SNDRV_PCM_INFO_INTERLEAVED |
708+
SNDRV_PCM_INFO_PAUSE |
709+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
696710
};
697711
EXPORT_SYMBOL(sof_byt_ops);
698712

@@ -753,6 +767,13 @@ const struct snd_sof_dsp_ops sof_cht_ops = {
753767
.drv = byt_dai,
754768
/* all 6 SSPs may be available for cherrytrail */
755769
.num_drv = ARRAY_SIZE(byt_dai),
770+
771+
/* ALSA HW info flags */
772+
.hw_info = SNDRV_PCM_INFO_MMAP |
773+
SNDRV_PCM_INFO_MMAP_VALID |
774+
SNDRV_PCM_INFO_INTERLEAVED |
775+
SNDRV_PCM_INFO_PAUSE |
776+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
756777
};
757778
EXPORT_SYMBOL(sof_cht_ops);
758779

‎sound/soc/sof/intel/cnl.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ const struct snd_sof_dsp_ops sof_cnl_ops = {
255255
.runtime_resume = hda_dsp_runtime_resume,
256256
.runtime_idle = hda_dsp_runtime_idle,
257257
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
258+
259+
/* ALSA HW info flags */
260+
.hw_info = SNDRV_PCM_INFO_MMAP |
261+
SNDRV_PCM_INFO_MMAP_VALID |
262+
SNDRV_PCM_INFO_INTERLEAVED |
263+
SNDRV_PCM_INFO_PAUSE |
264+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
258265
};
259266
EXPORT_SYMBOL(sof_cnl_ops);
260267

‎sound/soc/sof/pcm.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ static int sof_pcm_open(struct snd_soc_component *component,
440440
struct snd_soc_pcm_runtime *rtd = substream->private_data;
441441
struct snd_pcm_runtime *runtime = substream->runtime;
442442
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
443+
const struct snd_sof_dsp_ops *ops = sof_ops(sdev);
443444
struct snd_sof_pcm *spcm;
444445
struct snd_soc_tplg_stream_caps *caps;
445446
int ret;
@@ -469,11 +470,8 @@ static int sof_pcm_open(struct snd_soc_component *component,
469470
le32_to_cpu(caps->period_size_min));
470471

471472
/* set runtime config */
472-
runtime->hw.info = SNDRV_PCM_INFO_MMAP |
473-
SNDRV_PCM_INFO_MMAP_VALID |
474-
SNDRV_PCM_INFO_INTERLEAVED |
475-
SNDRV_PCM_INFO_PAUSE |
476-
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP;
473+
runtime->hw.info = ops->hw_info; /* platform-specific */
474+
477475
runtime->hw.formats = le64_to_cpu(caps->formats);
478476
runtime->hw.period_bytes_min = le32_to_cpu(caps->period_size_min);
479477
runtime->hw.period_bytes_max = le32_to_cpu(caps->period_size_max);

‎sound/soc/sof/sof-priv.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ struct snd_sof_dsp_ops {
211211
/* DAI ops */
212212
struct snd_soc_dai_driver *drv;
213213
int num_drv;
214+
215+
/* ALSA HW info flags, will be stored in snd_pcm_runtime.hw.info */
216+
u32 hw_info;
214217
};
215218

216219
/* DSP architecture specific callbacks for oops and stack dumps */

0 commit comments

Comments
 (0)