diff options
Diffstat (limited to 'sound/soc/sof/sof-client-probes-ipc3.c')
| -rw-r--r-- | sound/soc/sof/sof-client-probes-ipc3.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/sound/soc/sof/sof-client-probes-ipc3.c b/sound/soc/sof/sof-client-probes-ipc3.c index ef768db5f04d..a78ec0954a61 100644 --- a/sound/soc/sof/sof-client-probes-ipc3.c +++ b/sound/soc/sof/sof-client-probes-ipc3.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only // -// Copyright(c) 2019-2022 Intel Corporation. All rights reserved. +// Copyright(c) 2019-2022 Intel Corporation // // Author: Cezary Rojewski <cezary.rojewski@intel.com> // @@ -65,7 +65,6 @@ static int ipc3_probes_init(struct sof_client_dev *cdev, u32 stream_tag, { struct sof_ipc_probe_dma_add_params *msg; size_t size = struct_size(msg, dma, 1); - struct sof_ipc_reply reply; int ret; msg = kmalloc(size, GFP_KERNEL); @@ -77,7 +76,7 @@ static int ipc3_probes_init(struct sof_client_dev *cdev, u32 stream_tag, msg->dma[0].stream_tag = stream_tag; msg->dma[0].dma_buffer_size = buffer_size; - ret = sof_client_ipc_tx_message(cdev, msg, &reply, sizeof(reply)); + ret = sof_client_ipc_tx_message_no_reply(cdev, msg); kfree(msg); return ret; } @@ -93,18 +92,19 @@ static int ipc3_probes_init(struct sof_client_dev *cdev, u32 stream_tag, static int ipc3_probes_deinit(struct sof_client_dev *cdev) { struct sof_ipc_cmd_hdr msg; - struct sof_ipc_reply reply; msg.size = sizeof(msg); msg.cmd = SOF_IPC_GLB_PROBE | SOF_IPC_PROBE_DEINIT; - return sof_client_ipc_tx_message(cdev, &msg, &reply, sizeof(reply)); + return sof_client_ipc_tx_message_no_reply(cdev, &msg); } static int ipc3_probes_info(struct sof_client_dev *cdev, unsigned int cmd, - void **params, size_t *num_params) + void **params, size_t *num_params, + enum sof_probe_info_type type) { size_t max_msg_size = sof_client_get_ipc_max_payload_size(cdev); + struct device *dev = &cdev->auxdev.dev; struct sof_ipc_probe_info_params msg = {{{0}}}; struct sof_ipc_probe_info_params *reply; size_t bytes; @@ -113,6 +113,11 @@ static int ipc3_probes_info(struct sof_client_dev *cdev, unsigned int cmd, *params = NULL; *num_params = 0; + if (type != PROBES_INFO_ACTIVE_PROBES) { + dev_err(dev, "%s: info type %u not supported", __func__, type); + return -EOPNOTSUPP; + } + reply = kzalloc(max_msg_size, GFP_KERNEL); if (!reply) return -ENOMEM; @@ -144,21 +149,25 @@ exit: } /** - * ipc3_probes_points_info - retrieve list of active probe points + * ipc3_probes_points_info - retrieve list of probe points * @cdev: SOF client device * @desc: Returned list of active probes * @num_desc: Returned count of active probes + * @type: Either PROBES_INFO_ACTIVE_PROBES or PROBES_INFO_AVAILABE_PROBES + * + * If type is PROBES_INFO_ACTIVE_PROBES, host sends PROBE_POINT_INFO + * request to obtain list of active probe points, valid for + * disconnection when given probe is no longer required. * - * Host sends PROBE_POINT_INFO request to obtain list of active probe - * points, valid for disconnection when given probe is no longer - * required. + * Type PROBES_INFO_AVAILABE_PROBES is not yet supported. */ static int ipc3_probes_points_info(struct sof_client_dev *cdev, struct sof_probe_point_desc **desc, - size_t *num_desc) + size_t *num_desc, + enum sof_probe_info_type type) { return ipc3_probes_info(cdev, SOF_IPC_PROBE_POINT_INFO, - (void **)desc, num_desc); + (void **)desc, num_desc, type); } /** @@ -180,7 +189,6 @@ static int ipc3_probes_points_add(struct sof_client_dev *cdev, { struct sof_ipc_probe_point_add_params *msg; size_t size = struct_size(msg, desc, num_desc); - struct sof_ipc_reply reply; int ret; msg = kmalloc(size, GFP_KERNEL); @@ -191,7 +199,7 @@ static int ipc3_probes_points_add(struct sof_client_dev *cdev, msg->hdr.cmd = SOF_IPC_GLB_PROBE | SOF_IPC_PROBE_POINT_ADD; memcpy(&msg->desc[0], desc, size - sizeof(*msg)); - ret = sof_client_ipc_tx_message(cdev, msg, &reply, sizeof(reply)); + ret = sof_client_ipc_tx_message_no_reply(cdev, msg); kfree(msg); return ret; } @@ -211,7 +219,6 @@ static int ipc3_probes_points_remove(struct sof_client_dev *cdev, { struct sof_ipc_probe_point_remove_params *msg; size_t size = struct_size(msg, buffer_id, num_buffer_id); - struct sof_ipc_reply reply; int ret; msg = kmalloc(size, GFP_KERNEL); @@ -222,7 +229,7 @@ static int ipc3_probes_points_remove(struct sof_client_dev *cdev, msg->hdr.cmd = SOF_IPC_GLB_PROBE | SOF_IPC_PROBE_POINT_REMOVE; memcpy(&msg->buffer_id[0], buffer_id, size - sizeof(*msg)); - ret = sof_client_ipc_tx_message(cdev, msg, &reply, sizeof(reply)); + ret = sof_client_ipc_tx_message_no_reply(cdev, msg); kfree(msg); return ret; } |
