diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2022-12-21 11:23:20 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-12-26 00:32:31 +0100 |
commit | caf0f4662e07fcc721d1c85af82aa8a7d57621f3 (patch) | |
tree | dbd7e1809aa5806e2a3fa5a9aad853de1f042f96 /sound/soc/sof/sof-priv.h | |
parent | ASoC: SOF: sof-audio: Update documentation for sof_ipc_tplg_ops (diff) | |
download | linux-caf0f4662e07fcc721d1c85af82aa8a7d57621f3.tar.xz linux-caf0f4662e07fcc721d1c85af82aa8a7d57621f3.zip |
ASoC: SOF: Add helper macro to be used to get an IPC ops
In preparation to a case when the DSP is not used.
In this case the IPC communication itself has no meaning and we might
not even have sdev->ipc allocated at all.
The sof_ipc_get_ops() macro can be used to get a named IPC ops struct or
return NULL if the sdev->ipc is not allocated.
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>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20221221102328.9635-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/sof-priv.h')
-rw-r--r-- | sound/soc/sof/sof-priv.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 6760fd895950..144906c4cb63 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -502,6 +502,10 @@ struct snd_sof_ipc { const struct sof_ipc_ops *ops; }; +/* Helper to retrieve the IPC ops */ +#define sof_ipc_get_ops(sdev, ops_name) \ + (((sdev)->ipc && (sdev)->ipc->ops) ? (sdev)->ipc->ops->ops_name : NULL) + /* * SOF Device Level. */ |