ASoC: SOF: Intel: hda-loader: Add support for split library loading
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fri, 15 Sep 2023 11:40:18 +0000 (14:40 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 15 Sep 2023 12:15:33 +0000 (13:15 +0100)
commit5a8a9d70ecac3acbd49e70ad8f85153c0315643e
tree14a0e9825c01f721baa802d6a30cb63cdfa9d889
parent4f0f3c774947fdd3c4236cef9372b329c276845c
ASoC: SOF: Intel: hda-loader: Add support for split library loading

There is a certain sequence needs to be followed when configuring the HDA
DMA in host and DSP.
The firmware provides a way to handle this two stage sequencing by
splitting the library loading into two stage:
1st stage: LOAD_LIBRARY_PREPARE message
           the lib_id is 0, used to configure the DMA on DSP side
2nd stage: LOAD_LIBRARY message
           both dma_id and lib_id is valid, used for the actual transfer of
           the library

In case a firmware without support for this two stage loading is used then
the second stage message will trigger the loading and the first stage will
return with error, which is ignored by the kernel.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-loader.c