~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/sof/amd/acp-trace.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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>
 10 
 11 /*This file support Host TRACE Logger driver callback for SOF FW */
 12 
 13 #include "acp.h"
 14 
 15 #define ACP_LOGGER_STREAM       8
 16 #define NUM_PAGES               16
 17 
 18 int acp_sof_trace_release(struct snd_sof_dev *sdev)
 19 {
 20         struct acp_dsp_stream *stream;
 21         struct acp_dev_data *adata;
 22         int ret;
 23 
 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;
 30         }
 31 
 32         adata->dtrace_stream = NULL;
 33         return 0;
 34 }
 35 EXPORT_SYMBOL_NS(acp_sof_trace_release, SND_SOC_SOF_AMD_COMMON);
 36 
 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)
 39 {
 40         struct acp_dsp_stream *stream;
 41         struct acp_dev_data *adata;
 42         int ret;
 43 
 44         adata = sdev->pdata->hw_pdata;
 45         stream = acp_dsp_stream_get(sdev, ACP_LOGGER_STREAM);
 46         if (!stream)
 47                 return -ENODEV;
 48 
 49         stream->dmab = dmab;
 50         stream->num_pages = NUM_PAGES;
 51 
 52         ret = acp_dsp_stream_config(sdev, stream);
 53         if (ret < 0) {
 54                 acp_dsp_stream_put(sdev, stream);
 55                 return ret;
 56         }
 57 
 58         adata->dtrace_stream = stream;
 59         dtrace_params->stream_tag = stream->stream_tag;
 60         dtrace_params->buffer.phy_addr = stream->reg_offset;
 61 
 62         return 0;
 63 }
 64 EXPORT_SYMBOL_NS(acp_sof_trace_init, SND_SOC_SOF_AMD_COMMON);
 65 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php