2021-11-17 11:37:25 +02:00
|
|
|
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
|
|
|
|
//
|
|
|
|
// This file is provided under a dual BSD/GPLv2 license. When using or
|
|
|
|
// redistributing this file, you may do so under either license.
|
|
|
|
//
|
|
|
|
// Copyright(c) 2021 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Authors: Vishnuvardhanrao Ravuapati <vishnuvardhanrao.ravulapati@amd.com>
|
|
|
|
// V Sujith Kumar Reddy <Vsujithkumar.Reddy@amd.com>
|
|
|
|
|
|
|
|
/*This file support Host TRACE Logger driver callback for SOF FW */
|
|
|
|
|
|
|
|
#include "acp.h"
|
|
|
|
|
|
|
|
#define ACP_LOGGER_STREAM 8
|
|
|
|
#define NUM_PAGES 16
|
|
|
|
|
|
|
|
int acp_sof_trace_release(struct snd_sof_dev *sdev)
|
|
|
|
{
|
|
|
|
struct acp_dsp_stream *stream;
|
|
|
|
struct acp_dev_data *adata;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
adata = sdev->pdata->hw_pdata;
|
|
|
|
stream = adata->dtrace_stream;
|
|
|
|
ret = acp_dsp_stream_put(sdev, stream);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(sdev->dev, "Failed to release trace stream\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
adata->dtrace_stream = NULL;
|
|
|
|
return 0;
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS(acp_sof_trace_release, "SND_SOC_SOF_AMD_COMMON");
|
2021-11-17 11:37:25 +02:00
|
|
|
|
2022-05-16 13:47:09 +03:00
|
|
|
int acp_sof_trace_init(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
|
2022-01-28 14:36:23 +02:00
|
|
|
struct sof_ipc_dma_trace_params_ext *dtrace_params)
|
2021-11-17 11:37:25 +02:00
|
|
|
{
|
|
|
|
struct acp_dsp_stream *stream;
|
|
|
|
struct acp_dev_data *adata;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
adata = sdev->pdata->hw_pdata;
|
2022-01-28 14:36:23 +02:00
|
|
|
stream = acp_dsp_stream_get(sdev, ACP_LOGGER_STREAM);
|
|
|
|
if (!stream)
|
|
|
|
return -ENODEV;
|
|
|
|
|
2022-05-16 13:47:09 +03:00
|
|
|
stream->dmab = dmab;
|
2021-11-17 11:37:25 +02:00
|
|
|
stream->num_pages = NUM_PAGES;
|
|
|
|
|
|
|
|
ret = acp_dsp_stream_config(sdev, stream);
|
|
|
|
if (ret < 0) {
|
2022-01-28 14:36:23 +02:00
|
|
|
acp_dsp_stream_put(sdev, stream);
|
2021-11-17 11:37:25 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
adata->dtrace_stream = stream;
|
2022-01-28 14:36:23 +02:00
|
|
|
dtrace_params->stream_tag = stream->stream_tag;
|
|
|
|
dtrace_params->buffer.phy_addr = stream->reg_offset;
|
2021-11-17 11:37:25 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 15:59:47 +01:00
|
|
|
EXPORT_SYMBOL_NS(acp_sof_trace_init, "SND_SOC_SOF_AMD_COMMON");
|