18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license. When using or 48c2ecf20Sopenharmony_ci * redistributing this file, you may do so under either license. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Copyright(c) 2019-2020 Intel Corporation. All rights reserved. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Author: Cezary Rojewski <cezary.rojewski@intel.com> 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef __SOF_PROBE_H 128c2ecf20Sopenharmony_ci#define __SOF_PROBE_H 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include <sound/sof/header.h> 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistruct snd_sof_dev; 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#define SOF_PROBE_INVALID_NODE_ID UINT_MAX 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_cistruct sof_probe_dma { 218c2ecf20Sopenharmony_ci unsigned int stream_tag; 228c2ecf20Sopenharmony_ci unsigned int dma_buffer_size; 238c2ecf20Sopenharmony_ci} __packed; 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_cienum sof_connection_purpose { 268c2ecf20Sopenharmony_ci SOF_CONNECTION_PURPOSE_EXTRACT = 1, 278c2ecf20Sopenharmony_ci SOF_CONNECTION_PURPOSE_INJECT, 288c2ecf20Sopenharmony_ci}; 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_cistruct sof_probe_point_desc { 318c2ecf20Sopenharmony_ci unsigned int buffer_id; 328c2ecf20Sopenharmony_ci unsigned int purpose; 338c2ecf20Sopenharmony_ci unsigned int stream_tag; 348c2ecf20Sopenharmony_ci} __packed; 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_cistruct sof_ipc_probe_dma_add_params { 378c2ecf20Sopenharmony_ci struct sof_ipc_cmd_hdr hdr; 388c2ecf20Sopenharmony_ci unsigned int num_elems; 398c2ecf20Sopenharmony_ci struct sof_probe_dma dma[]; 408c2ecf20Sopenharmony_ci} __packed; 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_cistruct sof_ipc_probe_info_params { 438c2ecf20Sopenharmony_ci struct sof_ipc_reply rhdr; 448c2ecf20Sopenharmony_ci unsigned int num_elems; 458c2ecf20Sopenharmony_ci union { 468c2ecf20Sopenharmony_ci struct sof_probe_dma dma[0]; 478c2ecf20Sopenharmony_ci struct sof_probe_point_desc desc[0]; 488c2ecf20Sopenharmony_ci }; 498c2ecf20Sopenharmony_ci} __packed; 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_cistruct sof_ipc_probe_dma_remove_params { 528c2ecf20Sopenharmony_ci struct sof_ipc_cmd_hdr hdr; 538c2ecf20Sopenharmony_ci unsigned int num_elems; 548c2ecf20Sopenharmony_ci unsigned int stream_tag[]; 558c2ecf20Sopenharmony_ci} __packed; 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_cistruct sof_ipc_probe_point_add_params { 588c2ecf20Sopenharmony_ci struct sof_ipc_cmd_hdr hdr; 598c2ecf20Sopenharmony_ci unsigned int num_elems; 608c2ecf20Sopenharmony_ci struct sof_probe_point_desc desc[]; 618c2ecf20Sopenharmony_ci} __packed; 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_cistruct sof_ipc_probe_point_remove_params { 648c2ecf20Sopenharmony_ci struct sof_ipc_cmd_hdr hdr; 658c2ecf20Sopenharmony_ci unsigned int num_elems; 668c2ecf20Sopenharmony_ci unsigned int buffer_id[]; 678c2ecf20Sopenharmony_ci} __packed; 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciint sof_ipc_probe_init(struct snd_sof_dev *sdev, 708c2ecf20Sopenharmony_ci u32 stream_tag, size_t buffer_size); 718c2ecf20Sopenharmony_ciint sof_ipc_probe_deinit(struct snd_sof_dev *sdev); 728c2ecf20Sopenharmony_ciint sof_ipc_probe_dma_info(struct snd_sof_dev *sdev, 738c2ecf20Sopenharmony_ci struct sof_probe_dma **dma, size_t *num_dma); 748c2ecf20Sopenharmony_ciint sof_ipc_probe_dma_add(struct snd_sof_dev *sdev, 758c2ecf20Sopenharmony_ci struct sof_probe_dma *dma, size_t num_dma); 768c2ecf20Sopenharmony_ciint sof_ipc_probe_dma_remove(struct snd_sof_dev *sdev, 778c2ecf20Sopenharmony_ci unsigned int *stream_tag, size_t num_stream_tag); 788c2ecf20Sopenharmony_ciint sof_ipc_probe_points_info(struct snd_sof_dev *sdev, 798c2ecf20Sopenharmony_ci struct sof_probe_point_desc **desc, size_t *num_desc); 808c2ecf20Sopenharmony_ciint sof_ipc_probe_points_add(struct snd_sof_dev *sdev, 818c2ecf20Sopenharmony_ci struct sof_probe_point_desc *desc, size_t num_desc); 828c2ecf20Sopenharmony_ciint sof_ipc_probe_points_remove(struct snd_sof_dev *sdev, 838c2ecf20Sopenharmony_ci unsigned int *buffer_id, size_t num_buffer_id); 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci#endif 86