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>
This commit is contained in:
parent
ccf06b148f
commit
d8bc54a5f2
|
@ -84,6 +84,14 @@ int sof_ipc_tx_message(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes
|
|||
}
|
||||
EXPORT_SYMBOL(sof_ipc_tx_message);
|
||||
|
||||
/* IPC set or get data from host to DSP */
|
||||
int sof_ipc_set_get_data(struct snd_sof_ipc *ipc, void *msg_data,
|
||||
size_t msg_bytes, bool set)
|
||||
{
|
||||
return ipc->ops->set_get_data(ipc->sdev, msg_data, msg_bytes, set);
|
||||
}
|
||||
EXPORT_SYMBOL(sof_ipc_set_get_data);
|
||||
|
||||
/*
|
||||
* send IPC message from host to DSP without modifying the DSP state.
|
||||
* This will be used for IPC's that can be handled by the DSP
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -37,6 +37,8 @@ struct sof_client_dev {
|
|||
|
||||
int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg,
|
||||
void *reply_data, size_t reply_bytes);
|
||||
int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg,
|
||||
bool set);
|
||||
|
||||
struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev);
|
||||
struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev);
|
||||
|
|
|
@ -680,6 +680,8 @@ static inline void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev)
|
|||
}
|
||||
int sof_ipc_tx_message(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
|
||||
void *reply_data, size_t reply_bytes);
|
||||
int sof_ipc_set_get_data(struct snd_sof_ipc *ipc, void *msg_data,
|
||||
size_t msg_bytes, bool set);
|
||||
int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
|
||||
void *reply_data, size_t reply_bytes);
|
||||
int sof_ipc_send_msg(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes,
|
||||
|
|
Loading…
Reference in New Issue