diff mbox series

[4/8] ASoC: SOF: sof-client: Add API to get the ipc_type

Message ID 20220506132647.18690-5-peter.ujfalusi@linux.intel.com
State Accepted
Commit cdf8233d2cd2e55c8bc409e5b4fbdb181a1dea2b
Headers show
Series [1/8] ASoC: SOF: sof-client: Add API to get the maximum IPC payload size | expand

Commit Message

Peter Ujfalusi May 6, 2022, 1:26 p.m. UTC
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>
---
 sound/soc/sof/sof-client.c | 8 ++++++++
 sound/soc/sof/sof-client.h | 1 +
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c
index 18839a8a03c3..ce002815aa44 100644
--- a/sound/soc/sof/sof-client.c
+++ b/sound/soc/sof/sof-client.c
@@ -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)
 {
diff --git a/sound/soc/sof/sof-client.h b/sound/soc/sof/sof-client.h
index 4b5787156775..46b215d9200f 100644
--- a/sound/soc/sof/sof-client.h
+++ b/sound/soc/sof/sof-client.h
@@ -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);