Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: Intel: hda-loader: add flag to tag ICCMAX stream

The existing code conflates capture stream and ICCMAX stream. This
isn't going to be true any longer when we add support for SDW BPT RX
streams. Add a boolean tag to flag ICCMAX streams.

No functionality change, only future-proofing change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://msgid.link/r/20240404185448.136157-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Pierre-Louis Bossart and committed by
Mark Brown
e9ae5adc fe4a0745

+6 -6
+5 -5
sound/soc/sof/intel/hda-loader.c
··· 46 46 47 47 struct hdac_ext_stream *hda_cl_stream_prepare(struct snd_sof_dev *sdev, unsigned int format, 48 48 unsigned int size, struct snd_dma_buffer *dmab, 49 - int direction) 49 + int direction, bool is_iccmax) 50 50 { 51 51 struct hdac_ext_stream *hext_stream; 52 52 struct hdac_stream *hstream; ··· 73 73 hstream->format_val = format; 74 74 hstream->bufsize = size; 75 75 76 - if (direction == SNDRV_PCM_STREAM_CAPTURE) { 76 + if (is_iccmax) { 77 77 ret = hda_dsp_iccmax_stream_hw_params(sdev, hext_stream, dmab, NULL); 78 78 if (ret < 0) { 79 79 dev_err(sdev->dev, "error: iccmax stream prepare failed: %d\n", ret); ··· 335 335 * the data, so use a buffer of PAGE_SIZE for receiving. 336 336 */ 337 337 iccmax_stream = hda_cl_stream_prepare(sdev, HDA_CL_STREAM_FORMAT, PAGE_SIZE, 338 - &dmab_bdl, SNDRV_PCM_STREAM_CAPTURE); 338 + &dmab_bdl, SNDRV_PCM_STREAM_CAPTURE, true); 339 339 if (IS_ERR(iccmax_stream)) { 340 340 dev_err(sdev->dev, "error: dma prepare for ICCMAX stream failed\n"); 341 341 return PTR_ERR(iccmax_stream); ··· 421 421 /* prepare DMA for code loader stream */ 422 422 hext_stream = hda_cl_stream_prepare(sdev, HDA_CL_STREAM_FORMAT, 423 423 stripped_firmware.size, 424 - &dmab, SNDRV_PCM_STREAM_PLAYBACK); 424 + &dmab, SNDRV_PCM_STREAM_PLAYBACK, false); 425 425 if (IS_ERR(hext_stream)) { 426 426 dev_err(sdev->dev, "error: dma prepare for fw loading failed\n"); 427 427 return PTR_ERR(hext_stream); ··· 538 538 /* prepare DMA for code loader stream */ 539 539 hext_stream = hda_cl_stream_prepare(sdev, HDA_CL_STREAM_FORMAT, 540 540 stripped_firmware.size, 541 - &dmab, SNDRV_PCM_STREAM_PLAYBACK); 541 + &dmab, SNDRV_PCM_STREAM_PLAYBACK, false); 542 542 if (IS_ERR(hext_stream)) { 543 543 dev_err(sdev->dev, "%s: DMA prepare failed\n", __func__); 544 544 return PTR_ERR(hext_stream);
+1 -1
sound/soc/sof/intel/hda.h
··· 705 705 int hda_cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream); 706 706 struct hdac_ext_stream *hda_cl_stream_prepare(struct snd_sof_dev *sdev, unsigned int format, 707 707 unsigned int size, struct snd_dma_buffer *dmab, 708 - int direction); 708 + int direction, bool is_iccmax); 709 709 int hda_cl_cleanup(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab, 710 710 struct hdac_ext_stream *hext_stream); 711 711 int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, bool imr_boot);