// 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. // // Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
/* * Hardware interface for generic AMD audio DSP ACP IP
*/
struct acp_dsp_stream *acp_dsp_stream_get(struct snd_sof_dev *sdev, int tag)
{ struct acp_dev_data *adata = sdev->pdata->hw_pdata; struct acp_dsp_stream *stream = adata->stream_buf; int i;
for (i = 0; i < ACP_MAX_STREAM; i++, stream++) { if (stream->active) continue;
/* return stream if tag not specified*/ if (!tag) {
stream->active = 1; return stream;
}
/* check if this is the requested stream tag */ if (stream->stream_tag == tag) {
stream->active = 1; return stream;
}
}
dev_err(sdev->dev, "stream %d active or no inactive stream\n", tag); return NULL;
}
EXPORT_SYMBOL_NS(acp_dsp_stream_get, "SND_SOC_SOF_AMD_COMMON");
int acp_dsp_stream_put(struct snd_sof_dev *sdev, struct acp_dsp_stream *acp_stream)
{ struct acp_dev_data *adata = sdev->pdata->hw_pdata; struct acp_dsp_stream *stream = adata->stream_buf; int i;
/* Free an active stream */ for (i = 0; i < ACP_MAX_STREAM; i++, stream++) { if (stream == acp_stream) {
stream->active = 0; return0;
}
}
dev_err(sdev->dev, "Cannot find active stream tag %d\n", acp_stream->stream_tag); return -EINVAL;
}
EXPORT_SYMBOL_NS(acp_dsp_stream_put, "SND_SOC_SOF_AMD_COMMON");
int acp_dsp_stream_init(struct snd_sof_dev *sdev)
{ struct acp_dev_data *adata = sdev->pdata->hw_pdata; int i;
for (i = 0; i < ACP_MAX_STREAM; i++) {
adata->stream_buf[i].sdev = sdev;
adata->stream_buf[i].active = 0;
adata->stream_buf[i].stream_tag = i + 1;
} return0;
}
EXPORT_SYMBOL_NS(acp_dsp_stream_init, "SND_SOC_SOF_AMD_COMMON");
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.