ASoC: SOF: sof-client: Add API to get the ipc_type
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fri, 6 May 2022 13:26:43 +0000 (16:26 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 9 May 2022 17:17:58 +0000 (18:17 +0100)
Provide a way for the client drivers to query the ipc_type used by the
firmware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220506132647.18690-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-client.c
sound/soc/sof/sof-client.h

index 18839a8a03c34cf9a866299ac86a0de1db15a298..ce002815aa44890a5bd7678d9ce6af1ab2dfdefc 100644 (file)
@@ -327,6 +327,14 @@ size_t sof_client_get_ipc_max_payload_size(struct sof_client_dev *cdev)
 }
 EXPORT_SYMBOL_NS_GPL(sof_client_get_ipc_max_payload_size, SND_SOC_SOF_CLIENT);
 
+enum sof_ipc_type sof_client_get_ipc_type(struct sof_client_dev *cdev)
+{
+       struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
+
+       return sdev->pdata->ipc_type;
+}
+EXPORT_SYMBOL_NS_GPL(sof_client_get_ipc_type, SND_SOC_SOF_CLIENT);
+
 /* module refcount management of SOF core */
 int sof_client_core_module_get(struct sof_client_dev *cdev)
 {
index 4b5787156775eec758b3455aa5e974f4c1d297d9..46b215d9200f5421c52c54af120fc7d9a220402c 100644 (file)
@@ -42,6 +42,7 @@ struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev);
 struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev);
 const struct sof_ipc_fw_version *sof_client_get_fw_version(struct sof_client_dev *cdev);
 size_t sof_client_get_ipc_max_payload_size(struct sof_client_dev *cdev);
+enum sof_ipc_type sof_client_get_ipc_type(struct sof_client_dev *cdev);
 
 /* module refcount management of SOF core */
 int sof_client_core_module_get(struct sof_client_dev *cdev);