ASoC: SOF: utils: Add generic function to get the reply for a tx message
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Tue, 16 Nov 2021 15:21:34 +0000 (17:21 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 17 Nov 2021 13:04:48 +0000 (13:04 +0000)
commit8ae77801c81d16a09f6b67a6f8d91255d34f5f2c
tree1944102f218b8e919dadf1a7540fc4a938bb4434
parent7548a391c53cab2af0954d252cc5a9a793fd4c0e
ASoC: SOF: utils: Add generic function to get the reply for a tx message

The code to get the reply for a tx is identical in all but one place:
imx8_get_reply(), imx8m_get_reply(), atom_get_reply(), bdw_get_reply().

hda_dsp_ipc_get_reply() have additional check in place for PROBES and
special handling of PM messages.

Add a generic implementation to the core which can be used as drop in
replacement.

The reply size check is changed to be able to handle cases when the reply
size is not know beforehand (this is the case for PROBES and
DEBUG_MEM_USAGE for example).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc.c
sound/soc/sof/sof-priv.h