diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2022-10-27 15:35:30 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-10-28 13:04:51 +0100 |
commit | 8da5bceb8c4a8d5c06807b32cea94b278e925d22 (patch) | |
tree | 98152f317a64e661ac870b817d0a496a287ba90a | |
parent | bf2d764b84abfd880eee50d6982dade9224d1734 (diff) | |
download | lwn-8da5bceb8c4a8d5c06807b32cea94b278e925d22.tar.gz lwn-8da5bceb8c4a8d5c06807b32cea94b278e925d22.zip |
ASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer
There is no real reason to filter out this allocation at build
time. Let's allocate it always, so that we can have a more dynamic way
of disabling HDaudio codec support without having to recompile.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sof/intel/hda-stream.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index c858f30c08f9..59a3c0c9c21f 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -854,15 +854,16 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev) return -ENOMEM; } -#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) - /* mem alloc for the CORB/RIRB ringbuffers */ + /* + * mem alloc for the CORB/RIRB ringbuffers - this will be used only for + * HDAudio codecs + */ ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev, PAGE_SIZE, &bus->rb); if (ret < 0) { dev_err(sdev->dev, "error: RB alloc failed\n"); return -ENOMEM; } -#endif /* create capture streams */ for (i = 0; i < num_capture; i++) { @@ -995,11 +996,9 @@ void hda_dsp_stream_free(struct snd_sof_dev *sdev) if (bus->posbuf.area) snd_dma_free_pages(&bus->posbuf); -#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) - /* free position buffer */ + /* free CORB/RIRB buffer - only used for HDaudio codecs */ if (bus->rb.area) snd_dma_free_pages(&bus->rb); -#endif list_for_each_entry_safe(s, _s, &bus->stream_list, list) { /* TODO: decouple */ |