diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2022-01-28 14:36:23 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-02-08 13:38:04 +0000 |
commit | bab05b508ebfde32a14880696a13820d54510fcb (patch) | |
tree | 19fae9832c040369efd558317f9c69f158f76703 /sound/soc/sof/amd | |
parent | 91e716b2a4f997cafb017c04351c2751fc820637 (diff) | |
download | lwn-bab05b508ebfde32a14880696a13820d54510fcb.tar.gz lwn-bab05b508ebfde32a14880696a13820d54510fcb.zip |
ASoC: SOF: dma-trace: Pass pointer to params_ext struct in trace_init()
Instead of passing a pointer to the stream_tag within the
struct sof_ipc_dma_trace_params_ext, pass the pointer to the containing
struct.
AMD needs to update buffer.phy_addr (and don't really use the stream_tag)
for the trace implementation.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220128123623.23569-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/amd')
-rw-r--r-- | sound/soc/sof/amd/acp-trace.c | 38 | ||||
-rw-r--r-- | sound/soc/sof/amd/acp.h | 3 |
2 files changed, 11 insertions, 30 deletions
diff --git a/sound/soc/sof/amd/acp-trace.c b/sound/soc/sof/amd/acp-trace.c index fa4da8947186..903b6cc3dda3 100644 --- a/sound/soc/sof/amd/acp-trace.c +++ b/sound/soc/sof/amd/acp-trace.c @@ -34,51 +34,31 @@ int acp_sof_trace_release(struct snd_sof_dev *sdev) } EXPORT_SYMBOL_NS(acp_sof_trace_release, SND_SOC_SOF_AMD_COMMON); -static int acp_sof_trace_prepare(struct snd_sof_dev *sdev, - struct sof_ipc_dma_trace_params_ext *params) +int acp_sof_trace_init(struct snd_sof_dev *sdev, + struct sof_ipc_dma_trace_params_ext *dtrace_params) { struct acp_dsp_stream *stream; struct acp_dev_data *adata; int ret; adata = sdev->pdata->hw_pdata; - stream = adata->dtrace_stream; + stream = acp_dsp_stream_get(sdev, ACP_LOGGER_STREAM); + if (!stream) + return -ENODEV; + stream->dmab = &sdev->dmatb; stream->num_pages = NUM_PAGES; ret = acp_dsp_stream_config(sdev, stream); if (ret < 0) { - dev_err(sdev->dev, "Failed to configure trace stream\n"); + acp_dsp_stream_put(sdev, stream); return ret; } - params->buffer.phy_addr = stream->reg_offset; - params->stream_tag = stream->stream_tag; - - return 0; -} - -int acp_sof_trace_init(struct snd_sof_dev *sdev, u32 *stream_tag) -{ - struct sof_ipc_dma_trace_params_ext *params; - struct acp_dsp_stream *stream; - struct acp_dev_data *adata; - int ret; - - adata = sdev->pdata->hw_pdata; - stream = acp_dsp_stream_get(sdev, ACP_LOGGER_STREAM); - if (!stream) - return -ENODEV; - adata->dtrace_stream = stream; - params = container_of(stream_tag, struct sof_ipc_dma_trace_params_ext, stream_tag); - ret = acp_sof_trace_prepare(sdev, params); - if (ret < 0) { - acp_dsp_stream_put(sdev, stream); - return ret; - } + dtrace_params->stream_tag = stream->stream_tag; + dtrace_params->buffer.phy_addr = stream->reg_offset; - *stream_tag = stream->stream_tag; return 0; } EXPORT_SYMBOL_NS(acp_sof_trace_init, SND_SOC_SOF_AMD_COMMON); diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index a2f8e4219066..7ceb8bee0d8f 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -210,7 +210,8 @@ extern const struct snd_sof_dsp_ops sof_renoir_ops; int snd_amd_acp_find_config(struct pci_dev *pci); /* Trace */ -int acp_sof_trace_init(struct snd_sof_dev *sdev, u32 *stream_tag); +int acp_sof_trace_init(struct snd_sof_dev *sdev, + struct sof_ipc_dma_trace_params_ext *dtrace_params); int acp_sof_trace_release(struct snd_sof_dev *sdev); struct sof_amd_acp_desc { |