diff options
author | Jyri Sarha <jyri.sarha@intel.com> | 2022-10-31 13:51:39 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-10-31 16:20:20 +0300 |
commit | d8bc54a5f2cb8b3bc2d727badc351b0ad24eb702 (patch) | |
tree | 206b0ca9bc472a0e6b39289c32a711faba4c63ea /sound/soc/sof/sof-client.c | |
parent | ccf06b148fc22e3a964308df1d158c87710a35bd (diff) | |
download | linux-d8bc54a5f2cb8b3bc2d727badc351b0ad24eb702.tar.xz |
ASoC: SOF: client: Add sof_client_ipc_set_get_data()
No need to duplicate set_get_data msg handling in clients.
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-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/sof-client.c')
-rw-r--r-- | sound/soc/sof/sof-client.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c index 125aa2137195..158d2114af45 100644 --- a/sound/soc/sof/sof-client.c +++ b/sound/soc/sof/sof-client.c @@ -265,6 +265,25 @@ int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg, } EXPORT_SYMBOL_NS_GPL(sof_client_ipc_tx_message, SND_SOC_SOF_CLIENT); +int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg, + bool set) +{ + if (cdev->sdev->pdata->ipc_type == SOF_IPC) { + struct sof_ipc_cmd_hdr *hdr = ipc_msg; + + return sof_ipc_set_get_data(cdev->sdev->ipc, ipc_msg, hdr->size, + set); + } else if (cdev->sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + struct sof_ipc4_msg *msg = ipc_msg; + + return sof_ipc_set_get_data(cdev->sdev->ipc, ipc_msg, + msg->data_size, set); + } + + return -EINVAL; +} +EXPORT_SYMBOL_NS_GPL(sof_client_ipc_set_get_data, SND_SOC_SOF_CLIENT); + int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state) { struct auxiliary_driver *adrv; |