module: Convert symbol namespace to string literal
[linux.git] / sound / soc / sof / amd / acp-trace.c
blob0bd1f5990e8cd70baede5d379bc223d8f3761f8b
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
2 //
3 // This file is provided under a dual BSD/GPLv2 license. When using or
4 // redistributing this file, you may do so under either license.
5 //
6 // Copyright(c) 2021 Advanced Micro Devices, Inc. All rights reserved.
7 //
8 // Authors: Vishnuvardhanrao Ravuapati <vishnuvardhanrao.ravulapati@amd.com>
9 // V Sujith Kumar Reddy <Vsujithkumar.Reddy@amd.com>
11 /*This file support Host TRACE Logger driver callback for SOF FW */
13 #include "acp.h"
15 #define ACP_LOGGER_STREAM 8
16 #define NUM_PAGES 16
18 int acp_sof_trace_release(struct snd_sof_dev *sdev)
20 struct acp_dsp_stream *stream;
21 struct acp_dev_data *adata;
22 int ret;
24 adata = sdev->pdata->hw_pdata;
25 stream = adata->dtrace_stream;
26 ret = acp_dsp_stream_put(sdev, stream);
27 if (ret < 0) {
28 dev_err(sdev->dev, "Failed to release trace stream\n");
29 return ret;
32 adata->dtrace_stream = NULL;
33 return 0;
35 EXPORT_SYMBOL_NS(acp_sof_trace_release, "SND_SOC_SOF_AMD_COMMON");
37 int acp_sof_trace_init(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
38 struct sof_ipc_dma_trace_params_ext *dtrace_params)
40 struct acp_dsp_stream *stream;
41 struct acp_dev_data *adata;
42 int ret;
44 adata = sdev->pdata->hw_pdata;
45 stream = acp_dsp_stream_get(sdev, ACP_LOGGER_STREAM);
46 if (!stream)
47 return -ENODEV;
49 stream->dmab = dmab;
50 stream->num_pages = NUM_PAGES;
52 ret = acp_dsp_stream_config(sdev, stream);
53 if (ret < 0) {
54 acp_dsp_stream_put(sdev, stream);
55 return ret;
58 adata->dtrace_stream = stream;
59 dtrace_params->stream_tag = stream->stream_tag;
60 dtrace_params->buffer.phy_addr = stream->reg_offset;
62 return 0;
64 EXPORT_SYMBOL_NS(acp_sof_trace_init, "SND_SOC_SOF_AMD_COMMON");