OSDN Git Service

ASoC: SOF: client: Add sof_client_ipc4_find_module() function
authorJyri Sarha <jyri.sarha@intel.com>
Mon, 31 Oct 2022 10:51:40 +0000 (12:51 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 31 Oct 2022 13:20:21 +0000 (13:20 +0000)
Add sof_client_ipc4_find_module() for calling
sof_ipc4_find_module_by_uuid() in sof client code.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-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 158d211..9017f08 100644 (file)
@@ -16,6 +16,7 @@
 #include "ops.h"
 #include "sof-client.h"
 #include "sof-priv.h"
+#include "ipc4-priv.h"
 
 /**
  * struct sof_ipc_event_entry - IPC client event description
@@ -284,6 +285,20 @@ int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg,
 }
 EXPORT_SYMBOL_NS_GPL(sof_client_ipc_set_get_data, SND_SOC_SOF_CLIENT);
 
+#ifdef CONFIG_SND_SOC_SOF_INTEL_IPC4
+struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c, const guid_t *uuid)
+{
+       struct snd_sof_dev *sdev = c->sdev;
+
+       if (sdev->pdata->ipc_type == SOF_INTEL_IPC4)
+               return sof_ipc4_find_module_by_uuid(sdev, uuid);
+       dev_err(sdev->dev, "Only supported with IPC4\n");
+
+       return NULL;
+}
+EXPORT_SYMBOL_NS_GPL(sof_client_ipc4_find_module, SND_SOC_SOF_CLIENT);
+#endif
+
 int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state)
 {
        struct auxiliary_driver *adrv;
index 136edc3..2589714 100644 (file)
@@ -13,6 +13,8 @@ struct sof_ipc_cmd_hdr;
 struct snd_sof_dev;
 struct dentry;
 
+struct sof_ipc4_fw_module;
+
 /**
  * struct sof_client_dev - SOF client device
  * @auxdev:    auxiliary device
@@ -40,6 +42,8 @@ int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg,
 int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg,
                                bool set);
 
+struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c, const guid_t *u);
+
 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);