Skip to content

Commit 9e32894

Browse files
committed
ASoC: SOF: clients: Add API to get the SOF firmware version
Clients might need to be aware of the SOF firmware version in case the IPC message format differs between revisions. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 20c9323 commit 9e32894

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

sound/soc/sof/sof-client.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,14 @@ struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev)
223223
}
224224
EXPORT_SYMBOL_NS_GPL(sof_client_get_dma_dev, SND_SOC_SOF_CLIENT);
225225

226+
const struct sof_ipc_fw_version *sof_client_get_fw_version(struct sof_client_dev *cdev)
227+
{
228+
struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
229+
230+
return &sdev->fw_ready.version;
231+
}
232+
EXPORT_SYMBOL_NS_GPL(sof_client_get_fw_version, SND_SOC_SOF_CLIENT);
233+
226234
/* IPC event handling */
227235
void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *full_msg)
228236
{

sound/soc/sof/sof-client.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/list.h>
99
#include <sound/sof.h>
1010

11+
struct sof_ipc_fw_version;
1112
struct sof_ipc_cmd_hdr;
1213
struct snd_sof_dev;
1314
struct dentry;
@@ -39,6 +40,7 @@ int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg,
3940

4041
struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev);
4142
struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev);
43+
const struct sof_ipc_fw_version *sof_client_get_fw_version(struct sof_client_dev *cdev);
4244

4345
/* IPC notification */
4446
typedef void (*sof_client_event_callback)(struct sof_client_dev *cdev,

0 commit comments

Comments
 (0)