ASoC: msm: Add transcode loopback driver
Add DSP transcode loopback. Userspace can use this driver to support TX to RX audio HW DSP loopback. CRs-Fixed: 2049714 Change-Id: Ie83f5ca2c626c8fffbec4624f3e35c6c179d4c8c Signed-off-by: Siddartha Shaik <sshaik@codeaurora.org>
This commit is contained in:
parent
b7d425e951
commit
c340bec5c7
8 changed files with 836 additions and 24 deletions
|
@ -182,6 +182,12 @@ Optional properties:
|
|||
- qcom,msm-pcm-loopback-low-latency : Flag indicating whether
|
||||
the device node is of type low latency.
|
||||
|
||||
* msm-transcode-loopback
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : "qcom,msm-transcode-loopback"
|
||||
|
||||
* msm-dai-q6
|
||||
|
||||
[First Level Nodes]
|
||||
|
@ -2401,14 +2407,15 @@ Example:
|
|||
qcom,tasha-mclk-clk-freq = <9600000>;
|
||||
asoc-platform = <&pcm0>, <&pcm1>, <&pcm2>, <&voip>, <&voice>,
|
||||
<&loopback>, <&compress>, <&hostless>,
|
||||
<&afe>, <&lsm>, <&routing>, <&cpe>, <&compr>;
|
||||
<&afe>, <&lsm>, <&routing>, <&cpe>, <&compr>,
|
||||
<&trans_loopback>;
|
||||
asoc-platform-names = "msm-pcm-dsp.0", "msm-pcm-dsp.1",
|
||||
"msm-pcm-dsp.2", "msm-voip-dsp",
|
||||
"msm-pcm-voice", "msm-pcm-loopback",
|
||||
"msm-compress-dsp", "msm-pcm-hostless",
|
||||
"msm-pcm-afe", "msm-lsm-client",
|
||||
"msm-pcm-routing", "msm-cpe-lsm",
|
||||
"msm-compr-dsp";
|
||||
"msm-compr-dsp","msm-transcode-loopback";
|
||||
asoc-cpu = <&dai_hdmi>,
|
||||
<&sb_0_rx>, <&sb_0_tx>, <&sb_1_rx>, <&sb_1_tx>,
|
||||
<&sb_2_rx>, <&sb_2_tx>, <&sb_3_rx>, <&sb_3_tx>,
|
||||
|
|
|
@ -44,6 +44,8 @@ struct param_outband {
|
|||
|
||||
#define ADM_MATRIX_ID_COMPRESSED_AUDIO_RX 2
|
||||
|
||||
#define ADM_MATRIX_ID_COMPRESSED_AUDIO_TX 3
|
||||
|
||||
#define ADM_MATRIX_ID_LISTEN_TX 4
|
||||
/* Enumeration for an audio Tx matrix ID.*/
|
||||
#define ADM_MATRIX_ID_AUDIOX 1
|
||||
|
@ -446,6 +448,9 @@ struct adm_param_data_v5 {
|
|||
|
||||
#define ASM_STREAM_CMD_REGISTER_PP_EVENTS 0x00013213
|
||||
#define ASM_STREAM_PP_EVENT 0x00013214
|
||||
#define ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE 0x13333
|
||||
#define ASM_IEC_61937_MEDIA_FMT_EVENT 0x13334
|
||||
|
||||
#define DSP_STREAM_CMD "ADSP Stream Cmd"
|
||||
#define DSP_STREAM_CALLBACK "ADSP Stream Callback Event"
|
||||
#define DSP_STREAM_CALLBACK_QUEUE_SIZE 1024
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#define ADM_PATH_LIVE_REC 0x2
|
||||
#define ADM_PATH_NONLIVE_REC 0x3
|
||||
#define ADM_PATH_COMPRESSED_RX 0x5
|
||||
#define ADM_PATH_COMPRESSED_TX 0x6
|
||||
#include <linux/qdsp6v2/rtac.h>
|
||||
#include <sound/q6afe-v2.h>
|
||||
#include <sound/q6audio-v2.h>
|
||||
|
|
|
@ -4,7 +4,7 @@ snd-soc-qdsp6v2-objs += msm-dai-q6-v2.o msm-pcm-q6-v2.o msm-pcm-routing-v2.o \
|
|||
msm-pcm-voice-v2.o msm-dai-q6-hdmi-v2.o \
|
||||
msm-lsm-client.o msm-pcm-host-voice-v2.o \
|
||||
msm-audio-effects-q6-v2.o msm-pcm-loopback-v2.o \
|
||||
msm-dai-slim.o \
|
||||
msm-dai-slim.o msm-transcode-loopback-q6-v2.o \
|
||||
adsp_err.o
|
||||
obj-$(CONFIG_SND_SOC_QDSP6V2) += snd-soc-qdsp6v2.o msm-pcm-dtmf-v2.o \
|
||||
msm-dai-stub-v2.o
|
||||
|
|
|
@ -1077,7 +1077,10 @@ int msm_pcm_routing_reg_phy_compr_stream(int fe_id, int perf_mode,
|
|||
port_type = MSM_AFE_PORT_TYPE_RX;
|
||||
} else if (stream_type == SNDRV_PCM_STREAM_CAPTURE) {
|
||||
session_type = SESSION_TYPE_TX;
|
||||
path_type = ADM_PATH_LIVE_REC;
|
||||
if (passthr_mode != LEGACY_PCM)
|
||||
path_type = ADM_PATH_COMPRESSED_TX;
|
||||
else
|
||||
path_type = ADM_PATH_LIVE_REC;
|
||||
port_type = MSM_AFE_PORT_TYPE_TX;
|
||||
} else {
|
||||
pr_err("%s: invalid stream type %d\n", __func__, stream_type);
|
||||
|
@ -1514,7 +1517,10 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set)
|
|||
path_type = ADM_PATH_PLAYBACK;
|
||||
} else {
|
||||
session_type = SESSION_TYPE_TX;
|
||||
path_type = ADM_PATH_LIVE_REC;
|
||||
if (passthr_mode != LEGACY_PCM)
|
||||
path_type = ADM_PATH_COMPRESSED_TX;
|
||||
else
|
||||
path_type = ADM_PATH_LIVE_REC;
|
||||
}
|
||||
is_lsm = (val >= MSM_FRONTEND_DAI_LSM1) &&
|
||||
(val <= MSM_FRONTEND_DAI_LSM8);
|
||||
|
@ -6449,6 +6455,9 @@ static const struct snd_kcontrol_new mmul18_mixer_controls[] = {
|
|||
SOC_SINGLE_EXT("PRI_MI2S_TX", MSM_BACKEND_DAI_PRI_MI2S_TX,
|
||||
MSM_FRONTEND_DAI_MULTIMEDIA18, 1, 0, msm_routing_get_audio_mixer,
|
||||
msm_routing_put_audio_mixer),
|
||||
SOC_SINGLE_EXT("QUAT_MI2S_TX", MSM_BACKEND_DAI_QUATERNARY_MI2S_TX,
|
||||
MSM_FRONTEND_DAI_MULTIMEDIA18, 1, 0, msm_routing_get_audio_mixer,
|
||||
msm_routing_put_audio_mixer),
|
||||
SOC_SINGLE_EXT("INTERNAL_FM_TX", MSM_BACKEND_DAI_INT_FM_TX,
|
||||
MSM_FRONTEND_DAI_MULTIMEDIA18, 1, 0, msm_routing_get_audio_mixer,
|
||||
msm_routing_put_audio_mixer),
|
||||
|
@ -11913,6 +11922,7 @@ static const struct snd_soc_dapm_route intercon[] = {
|
|||
{"MultiMedia18 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
|
||||
{"MultiMedia19 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
|
||||
{"MultiMedia8 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
|
||||
{"MultiMedia18 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
|
||||
{"MultiMedia8 Mixer", "INT3_MI2S_TX", "INT3_MI2S_TX"},
|
||||
{"MultiMedia3 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
|
||||
{"MultiMedia5 Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
|
||||
|
|
761
sound/soc/msm/qdsp6v2/msm-transcode-loopback-q6-v2.c
Normal file
761
sound/soc/msm/qdsp6v2/msm-transcode-loopback-q6-v2.c
Normal file
|
@ -0,0 +1,761 @@
|
|||
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/math64.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/msm_audio_ion.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <sound/pcm.h>
|
||||
#include <sound/initval.h>
|
||||
#include <sound/control.h>
|
||||
#include <sound/q6asm-v2.h>
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/timer.h>
|
||||
#include <sound/tlv.h>
|
||||
#include <sound/apr_audio-v2.h>
|
||||
#include <sound/compress_params.h>
|
||||
#include <sound/compress_offload.h>
|
||||
#include <sound/compress_driver.h>
|
||||
|
||||
#include "msm-pcm-routing-v2.h"
|
||||
#include "msm-qti-pp-config.h"
|
||||
|
||||
#define LOOPBACK_SESSION_MAX_NUM_STREAMS 2
|
||||
|
||||
static DEFINE_MUTEX(transcode_loopback_session_lock);
|
||||
|
||||
struct trans_loopback_pdata {
|
||||
struct snd_compr_stream *cstream[MSM_FRONTEND_DAI_MAX];
|
||||
};
|
||||
|
||||
struct loopback_stream {
|
||||
struct snd_compr_stream *cstream;
|
||||
uint32_t codec_format;
|
||||
bool start;
|
||||
};
|
||||
|
||||
enum loopback_session_state {
|
||||
/* One or both streams not opened */
|
||||
LOOPBACK_SESSION_CLOSE = 0,
|
||||
/* Loopback streams opened */
|
||||
LOOPBACK_SESSION_READY,
|
||||
/* Loopback streams opened and formats configured */
|
||||
LOOPBACK_SESSION_START,
|
||||
/* Trigger issued on either of streams when in START state */
|
||||
LOOPBACK_SESSION_RUN
|
||||
};
|
||||
|
||||
struct msm_transcode_loopback {
|
||||
struct loopback_stream source;
|
||||
struct loopback_stream sink;
|
||||
|
||||
struct snd_compr_caps source_compr_cap;
|
||||
struct snd_compr_caps sink_compr_cap;
|
||||
|
||||
uint32_t instance;
|
||||
uint32_t num_streams;
|
||||
int session_state;
|
||||
|
||||
struct mutex lock;
|
||||
|
||||
int session_id;
|
||||
struct audio_client *audio_client;
|
||||
};
|
||||
|
||||
/* Transcode loopback global info struct */
|
||||
static struct msm_transcode_loopback transcode_info;
|
||||
|
||||
static void loopback_event_handler(uint32_t opcode,
|
||||
uint32_t token, uint32_t *payload, void *priv)
|
||||
{
|
||||
struct msm_transcode_loopback *trans =
|
||||
(struct msm_transcode_loopback *)priv;
|
||||
struct snd_soc_pcm_runtime *rtd;
|
||||
struct snd_compr_stream *cstream;
|
||||
struct audio_client *ac;
|
||||
int stream_id;
|
||||
int ret;
|
||||
|
||||
if (!trans || !payload) {
|
||||
pr_err("%s: rtd or payload is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
cstream = trans->source.cstream;
|
||||
ac = trans->audio_client;
|
||||
|
||||
/*
|
||||
* Token for rest of the compressed commands use to set
|
||||
* session id, stream id, dir etc.
|
||||
*/
|
||||
stream_id = q6asm_get_stream_id_from_token(token);
|
||||
|
||||
switch (opcode) {
|
||||
case ASM_IEC_61937_MEDIA_FMT_EVENT:
|
||||
pr_debug("%s: ASM_IEC_61937_MEDIA_FMT_EVENT\n", __func__);
|
||||
rtd = cstream->private_data;
|
||||
if (!rtd) {
|
||||
pr_err("%s: rtd is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = msm_adsp_inform_mixer_ctl(rtd, payload);
|
||||
if (ret) {
|
||||
pr_err("%s: failed to inform mixer ctrl. err = %d\n",
|
||||
__func__, ret);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case APR_BASIC_RSP_RESULT: {
|
||||
switch (payload[0]) {
|
||||
case ASM_SESSION_CMD_RUN_V2:
|
||||
pr_debug("%s: ASM_SESSION_CMD_RUN_V2:", __func__);
|
||||
pr_debug("token 0x%x, stream id %d\n", token,
|
||||
stream_id);
|
||||
break;
|
||||
case ASM_STREAM_CMD_CLOSE:
|
||||
pr_debug("%s: ASM_DATA_CMD_CLOSE:", __func__);
|
||||
pr_debug("token 0x%x, stream id %d\n", token,
|
||||
stream_id);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
pr_debug("%s: Not Supported Event opcode[0x%x]\n",
|
||||
__func__, opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void populate_codec_list(struct msm_transcode_loopback *trans,
|
||||
struct snd_compr_stream *cstream)
|
||||
{
|
||||
struct snd_compr_caps compr_cap;
|
||||
|
||||
pr_debug("%s\n", __func__);
|
||||
|
||||
memset(&compr_cap, 0, sizeof(struct snd_compr_caps));
|
||||
|
||||
if (cstream->direction == SND_COMPRESS_CAPTURE) {
|
||||
compr_cap.direction = SND_COMPRESS_CAPTURE;
|
||||
compr_cap.num_codecs = 3;
|
||||
compr_cap.codecs[0] = SND_AUDIOCODEC_PCM;
|
||||
compr_cap.codecs[1] = SND_AUDIOCODEC_AC3;
|
||||
compr_cap.codecs[2] = SND_AUDIOCODEC_EAC3;
|
||||
memcpy(&trans->source_compr_cap, &compr_cap,
|
||||
sizeof(struct snd_compr_caps));
|
||||
}
|
||||
|
||||
if (cstream->direction == SND_COMPRESS_PLAYBACK) {
|
||||
compr_cap.direction = SND_COMPRESS_PLAYBACK;
|
||||
compr_cap.num_codecs = 1;
|
||||
compr_cap.codecs[0] = SND_AUDIOCODEC_PCM;
|
||||
memcpy(&trans->sink_compr_cap, &compr_cap,
|
||||
sizeof(struct snd_compr_caps));
|
||||
}
|
||||
}
|
||||
|
||||
static int msm_transcode_loopback_open(struct snd_compr_stream *cstream)
|
||||
{
|
||||
int ret = 0;
|
||||
struct snd_compr_runtime *runtime;
|
||||
struct snd_soc_pcm_runtime *rtd;
|
||||
struct msm_transcode_loopback *trans = &transcode_info;
|
||||
struct trans_loopback_pdata *pdata;
|
||||
|
||||
if (cstream == NULL) {
|
||||
pr_err("%s: Invalid substream\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
runtime = cstream->runtime;
|
||||
rtd = snd_pcm_substream_chip(cstream);
|
||||
pdata = snd_soc_platform_get_drvdata(rtd->platform);
|
||||
pdata->cstream[rtd->dai_link->be_id] = cstream;
|
||||
|
||||
mutex_lock(&trans->lock);
|
||||
if (trans->num_streams > LOOPBACK_SESSION_MAX_NUM_STREAMS) {
|
||||
pr_err("msm_transcode_open failed..invalid stream\n");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (cstream->direction == SND_COMPRESS_CAPTURE) {
|
||||
if (trans->source.cstream == NULL) {
|
||||
trans->source.cstream = cstream;
|
||||
trans->num_streams++;
|
||||
} else {
|
||||
pr_err("%s: capture stream already opened\n",
|
||||
__func__);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
} else if (cstream->direction == SND_COMPRESS_PLAYBACK) {
|
||||
if (trans->sink.cstream == NULL) {
|
||||
trans->sink.cstream = cstream;
|
||||
trans->num_streams++;
|
||||
} else {
|
||||
pr_debug("%s: playback stream already opened\n",
|
||||
__func__);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
pr_debug("%s: num stream%d, stream name %s\n", __func__,
|
||||
trans->num_streams, cstream->name);
|
||||
|
||||
populate_codec_list(trans, cstream);
|
||||
|
||||
if (trans->num_streams == LOOPBACK_SESSION_MAX_NUM_STREAMS) {
|
||||
pr_debug("%s: Moving loopback session to READY state %d\n",
|
||||
__func__, trans->session_state);
|
||||
trans->session_state = LOOPBACK_SESSION_READY;
|
||||
}
|
||||
|
||||
runtime->private_data = trans;
|
||||
if (trans->num_streams == 1)
|
||||
msm_adsp_init_mixer_ctl_pp_event_queue(rtd);
|
||||
exit:
|
||||
mutex_unlock(&trans->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void stop_transcoding(struct msm_transcode_loopback *trans)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *soc_pcm_rx;
|
||||
struct snd_soc_pcm_runtime *soc_pcm_tx;
|
||||
|
||||
if (trans->audio_client != NULL) {
|
||||
q6asm_cmd(trans->audio_client, CMD_CLOSE);
|
||||
|
||||
if (trans->sink.cstream != NULL) {
|
||||
soc_pcm_rx = trans->sink.cstream->private_data;
|
||||
msm_pcm_routing_dereg_phy_stream(
|
||||
soc_pcm_rx->dai_link->be_id,
|
||||
SND_COMPRESS_PLAYBACK);
|
||||
}
|
||||
if (trans->source.cstream != NULL) {
|
||||
soc_pcm_tx = trans->source.cstream->private_data;
|
||||
msm_pcm_routing_dereg_phy_stream(
|
||||
soc_pcm_tx->dai_link->be_id,
|
||||
SND_COMPRESS_CAPTURE);
|
||||
}
|
||||
q6asm_audio_client_free(trans->audio_client);
|
||||
trans->audio_client = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int msm_transcode_loopback_free(struct snd_compr_stream *cstream)
|
||||
{
|
||||
struct snd_compr_runtime *runtime = cstream->runtime;
|
||||
struct msm_transcode_loopback *trans = runtime->private_data;
|
||||
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(cstream);
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&trans->lock);
|
||||
|
||||
pr_debug("%s: Transcode loopback end:%d, streams %d\n", __func__,
|
||||
cstream->direction, trans->num_streams);
|
||||
trans->num_streams--;
|
||||
stop_transcoding(trans);
|
||||
|
||||
if (cstream->direction == SND_COMPRESS_PLAYBACK)
|
||||
memset(&trans->sink, 0, sizeof(struct loopback_stream));
|
||||
else if (cstream->direction == SND_COMPRESS_CAPTURE)
|
||||
memset(&trans->source, 0, sizeof(struct loopback_stream));
|
||||
|
||||
trans->session_state = LOOPBACK_SESSION_CLOSE;
|
||||
if (trans->num_streams == 1)
|
||||
msm_adsp_clean_mixer_ctl_pp_event_queue(rtd);
|
||||
mutex_unlock(&trans->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_transcode_loopback_trigger(struct snd_compr_stream *cstream,
|
||||
int cmd)
|
||||
{
|
||||
struct snd_compr_runtime *runtime = cstream->runtime;
|
||||
struct msm_transcode_loopback *trans = runtime->private_data;
|
||||
|
||||
switch (cmd) {
|
||||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
|
||||
if (trans->session_state == LOOPBACK_SESSION_START) {
|
||||
pr_debug("%s: Issue Loopback session %d RUN\n",
|
||||
__func__, trans->instance);
|
||||
q6asm_run_nowait(trans->audio_client, 0, 0, 0);
|
||||
trans->session_state = LOOPBACK_SESSION_RUN;
|
||||
}
|
||||
break;
|
||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
pr_debug("%s: Issue Loopback session %d STOP\n", __func__,
|
||||
trans->instance);
|
||||
if (trans->session_state == LOOPBACK_SESSION_RUN)
|
||||
q6asm_cmd_nowait(trans->audio_client, CMD_PAUSE);
|
||||
trans->session_state = LOOPBACK_SESSION_START;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_transcode_loopback_set_params(struct snd_compr_stream *cstream,
|
||||
struct snd_compr_params *codec_param)
|
||||
{
|
||||
|
||||
struct snd_compr_runtime *runtime = cstream->runtime;
|
||||
struct msm_transcode_loopback *trans = runtime->private_data;
|
||||
struct snd_soc_pcm_runtime *soc_pcm_rx;
|
||||
struct snd_soc_pcm_runtime *soc_pcm_tx;
|
||||
uint32_t bit_width = 16;
|
||||
int ret = 0;
|
||||
|
||||
if (trans == NULL) {
|
||||
pr_err("%s: Invalid param\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&trans->lock);
|
||||
|
||||
if (cstream->direction == SND_COMPRESS_PLAYBACK) {
|
||||
if (codec_param->codec.id == SND_AUDIOCODEC_PCM) {
|
||||
trans->sink.codec_format =
|
||||
FORMAT_LINEAR_PCM;
|
||||
switch (codec_param->codec.format) {
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
bit_width = 32;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
bit_width = 24;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S24_3LE:
|
||||
bit_width = 24;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
default:
|
||||
bit_width = 16;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
pr_debug("%s: unknown sink codec\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
trans->sink.start = true;
|
||||
}
|
||||
|
||||
if (cstream->direction == SND_COMPRESS_CAPTURE) {
|
||||
switch (codec_param->codec.id) {
|
||||
case SND_AUDIOCODEC_PCM:
|
||||
pr_debug("Source SND_AUDIOCODEC_PCM\n");
|
||||
trans->source.codec_format =
|
||||
FORMAT_LINEAR_PCM;
|
||||
break;
|
||||
case SND_AUDIOCODEC_AC3:
|
||||
pr_debug("Source SND_AUDIOCODEC_AC3\n");
|
||||
trans->source.codec_format =
|
||||
FORMAT_AC3;
|
||||
break;
|
||||
case SND_AUDIOCODEC_EAC3:
|
||||
pr_debug("Source SND_AUDIOCODEC_EAC3\n");
|
||||
trans->source.codec_format =
|
||||
FORMAT_EAC3;
|
||||
break;
|
||||
default:
|
||||
pr_debug("%s: unknown source codec\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
trans->source.start = true;
|
||||
}
|
||||
|
||||
pr_debug("%s: trans->source.start %d trans->sink.start %d trans->source.cstream %pK trans->sink.cstream %pK trans->session_state %d\n",
|
||||
__func__, trans->source.start, trans->sink.start,
|
||||
trans->source.cstream, trans->sink.cstream,
|
||||
trans->session_state);
|
||||
|
||||
if ((trans->session_state == LOOPBACK_SESSION_READY) &&
|
||||
trans->source.start && trans->sink.start) {
|
||||
pr_debug("%s: Moving loopback session to start state\n",
|
||||
__func__);
|
||||
trans->session_state = LOOPBACK_SESSION_START;
|
||||
}
|
||||
|
||||
if (trans->session_state == LOOPBACK_SESSION_START) {
|
||||
if (trans->audio_client != NULL) {
|
||||
pr_debug("%s: ASM client already opened, closing\n",
|
||||
__func__);
|
||||
stop_transcoding(trans);
|
||||
}
|
||||
|
||||
trans->audio_client = q6asm_audio_client_alloc(
|
||||
(app_cb)loopback_event_handler, trans);
|
||||
if (!trans->audio_client) {
|
||||
pr_err("%s: Could not allocate memory\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
pr_debug("%s: ASM client allocated, callback %pK\n", __func__,
|
||||
loopback_event_handler);
|
||||
trans->session_id = trans->audio_client->session;
|
||||
trans->audio_client->perf_mode = false;
|
||||
ret = q6asm_open_transcode_loopback(trans->audio_client,
|
||||
bit_width,
|
||||
trans->source.codec_format,
|
||||
trans->sink.codec_format);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: Session transcode loopback open failed\n",
|
||||
__func__);
|
||||
q6asm_audio_client_free(trans->audio_client);
|
||||
trans->audio_client = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pr_debug("%s: Starting ADM open for loopback\n", __func__);
|
||||
soc_pcm_rx = trans->sink.cstream->private_data;
|
||||
soc_pcm_tx = trans->source.cstream->private_data;
|
||||
if (trans->source.codec_format != FORMAT_LINEAR_PCM)
|
||||
msm_pcm_routing_reg_phy_compr_stream(
|
||||
soc_pcm_tx->dai_link->be_id,
|
||||
trans->audio_client->perf_mode,
|
||||
trans->session_id,
|
||||
SNDRV_PCM_STREAM_CAPTURE,
|
||||
true);
|
||||
else
|
||||
msm_pcm_routing_reg_phy_stream(
|
||||
soc_pcm_tx->dai_link->be_id,
|
||||
trans->audio_client->perf_mode,
|
||||
trans->session_id,
|
||||
SNDRV_PCM_STREAM_CAPTURE);
|
||||
|
||||
msm_pcm_routing_reg_phy_stream(
|
||||
soc_pcm_rx->dai_link->be_id,
|
||||
trans->audio_client->perf_mode,
|
||||
trans->session_id,
|
||||
SNDRV_PCM_STREAM_PLAYBACK);
|
||||
pr_debug("%s: Successfully opened ADM sessions\n", __func__);
|
||||
}
|
||||
exit:
|
||||
mutex_unlock(&trans->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_transcode_loopback_get_caps(struct snd_compr_stream *cstream,
|
||||
struct snd_compr_caps *arg)
|
||||
{
|
||||
struct snd_compr_runtime *runtime;
|
||||
struct msm_transcode_loopback *trans;
|
||||
|
||||
if (!arg || !cstream) {
|
||||
pr_err("%s: Invalid arguments\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
runtime = cstream->runtime;
|
||||
trans = runtime->private_data;
|
||||
pr_debug("%s\n", __func__);
|
||||
if (cstream->direction == SND_COMPRESS_CAPTURE)
|
||||
memcpy(arg, &trans->source_compr_cap,
|
||||
sizeof(struct snd_compr_caps));
|
||||
else
|
||||
memcpy(arg, &trans->sink_compr_cap,
|
||||
sizeof(struct snd_compr_caps));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_transcode_stream_cmd_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol);
|
||||
unsigned long fe_id = kcontrol->private_value;
|
||||
struct trans_loopback_pdata *pdata = (struct trans_loopback_pdata *)
|
||||
snd_soc_component_get_drvdata(comp);
|
||||
struct snd_compr_stream *cstream = NULL;
|
||||
struct msm_transcode_loopback *prtd;
|
||||
int ret = 0;
|
||||
struct msm_adsp_event_data *event_data = NULL;
|
||||
|
||||
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
|
||||
pr_err("%s Received invalid fe_id %lu\n",
|
||||
__func__, fe_id);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
cstream = pdata->cstream[fe_id];
|
||||
if (cstream == NULL) {
|
||||
pr_err("%s cstream is null.\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
prtd = cstream->runtime->private_data;
|
||||
if (!prtd) {
|
||||
pr_err("%s: prtd is null.\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (prtd->audio_client == NULL) {
|
||||
pr_err("%s: audio_client is null.\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
event_data = (struct msm_adsp_event_data *)ucontrol->value.bytes.data;
|
||||
if ((event_data->event_type < ADSP_STREAM_PP_EVENT) ||
|
||||
(event_data->event_type >= ADSP_STREAM_EVENT_MAX)) {
|
||||
pr_err("%s: invalid event_type=%d",
|
||||
__func__, event_data->event_type);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ((sizeof(struct msm_adsp_event_data) + event_data->payload_len) >=
|
||||
sizeof(ucontrol->value.bytes.data)) {
|
||||
pr_err("%s param length=%d exceeds limit",
|
||||
__func__, event_data->payload_len);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = q6asm_send_stream_cmd(prtd->audio_client, event_data);
|
||||
if (ret < 0)
|
||||
pr_err("%s: failed to send stream event cmd, err = %d\n",
|
||||
__func__, ret);
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_transcode_stream_cmd_control(
|
||||
struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
const char *mixer_ctl_name = DSP_STREAM_CMD;
|
||||
const char *deviceNo = "NN";
|
||||
char *mixer_str = NULL;
|
||||
int ctl_len = 0, ret = 0;
|
||||
struct snd_kcontrol_new fe_loopback_stream_cmd_config_control[1] = {
|
||||
{
|
||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
||||
.name = "?",
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
|
||||
.info = msm_adsp_stream_cmd_info,
|
||||
.put = msm_transcode_stream_cmd_put,
|
||||
.private_value = 0,
|
||||
}
|
||||
};
|
||||
|
||||
if (!rtd) {
|
||||
pr_err("%s NULL rtd\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ctl_len = strlen(mixer_ctl_name) + 1 + strlen(deviceNo) + 1;
|
||||
mixer_str = kzalloc(ctl_len, GFP_KERNEL);
|
||||
if (!mixer_str) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
snprintf(mixer_str, ctl_len, "%s %d", mixer_ctl_name, rtd->pcm->device);
|
||||
fe_loopback_stream_cmd_config_control[0].name = mixer_str;
|
||||
fe_loopback_stream_cmd_config_control[0].private_value =
|
||||
rtd->dai_link->be_id;
|
||||
pr_debug("%s: Registering new mixer ctl %s\n", __func__, mixer_str);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
fe_loopback_stream_cmd_config_control,
|
||||
ARRAY_SIZE(fe_loopback_stream_cmd_config_control));
|
||||
if (ret < 0)
|
||||
pr_err("%s: failed to add ctl %s. err = %d\n",
|
||||
__func__, mixer_str, ret);
|
||||
|
||||
kfree(mixer_str);
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_transcode_stream_callback_control(
|
||||
struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
const char *mixer_ctl_name = DSP_STREAM_CALLBACK;
|
||||
const char *deviceNo = "NN";
|
||||
char *mixer_str = NULL;
|
||||
int ctl_len = 0, ret = 0;
|
||||
struct snd_kcontrol *kctl;
|
||||
|
||||
struct snd_kcontrol_new fe_loopback_callback_config_control[1] = {
|
||||
{
|
||||
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
|
||||
.name = "?",
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
|
||||
.info = msm_adsp_stream_callback_info,
|
||||
.get = msm_adsp_stream_callback_get,
|
||||
.private_value = 0,
|
||||
}
|
||||
};
|
||||
|
||||
if (!rtd) {
|
||||
pr_err("%s: rtd is NULL\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ctl_len = strlen(mixer_ctl_name) + 1 + strlen(deviceNo) + 1;
|
||||
mixer_str = kzalloc(ctl_len, GFP_KERNEL);
|
||||
if (!mixer_str) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
snprintf(mixer_str, ctl_len, "%s %d", mixer_ctl_name, rtd->pcm->device);
|
||||
fe_loopback_callback_config_control[0].name = mixer_str;
|
||||
fe_loopback_callback_config_control[0].private_value =
|
||||
rtd->dai_link->be_id;
|
||||
pr_debug("%s: Registering new mixer ctl %s\n", __func__, mixer_str);
|
||||
ret = snd_soc_add_platform_controls(rtd->platform,
|
||||
fe_loopback_callback_config_control,
|
||||
ARRAY_SIZE(fe_loopback_callback_config_control));
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed to add ctl %s. err = %d\n",
|
||||
__func__, mixer_str, ret);
|
||||
ret = -EINVAL;
|
||||
goto free_mixer_str;
|
||||
}
|
||||
|
||||
kctl = snd_soc_card_get_kcontrol(rtd->card, mixer_str);
|
||||
if (!kctl) {
|
||||
pr_err("%s: failed to get kctl %s.\n", __func__, mixer_str);
|
||||
ret = -EINVAL;
|
||||
goto free_mixer_str;
|
||||
}
|
||||
|
||||
kctl->private_data = NULL;
|
||||
free_mixer_str:
|
||||
kfree(mixer_str);
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_transcode_loopback_new(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = msm_transcode_stream_cmd_control(rtd);
|
||||
if (rc)
|
||||
pr_err("%s: ADSP Stream Cmd Control open failed\n", __func__);
|
||||
|
||||
rc = msm_transcode_stream_callback_control(rtd);
|
||||
if (rc)
|
||||
pr_err("%s: ADSP Stream callback Control open failed\n",
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct snd_compr_ops msm_transcode_loopback_ops = {
|
||||
.open = msm_transcode_loopback_open,
|
||||
.free = msm_transcode_loopback_free,
|
||||
.trigger = msm_transcode_loopback_trigger,
|
||||
.set_params = msm_transcode_loopback_set_params,
|
||||
.get_caps = msm_transcode_loopback_get_caps,
|
||||
};
|
||||
|
||||
|
||||
static int msm_transcode_loopback_probe(struct snd_soc_platform *platform)
|
||||
{
|
||||
struct trans_loopback_pdata *pdata = NULL;
|
||||
|
||||
pr_debug("%s\n", __func__);
|
||||
pdata = (struct trans_loopback_pdata *)
|
||||
kzalloc(sizeof(struct trans_loopback_pdata),
|
||||
GFP_KERNEL);
|
||||
if (!pdata)
|
||||
return -ENOMEM;
|
||||
|
||||
snd_soc_platform_set_drvdata(platform, pdata);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct snd_soc_platform_driver msm_soc_platform = {
|
||||
.probe = msm_transcode_loopback_probe,
|
||||
.compr_ops = &msm_transcode_loopback_ops,
|
||||
.pcm_new = msm_transcode_loopback_new,
|
||||
};
|
||||
|
||||
static int msm_transcode_dev_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
||||
pr_debug("%s: dev name %s\n", __func__, dev_name(&pdev->dev));
|
||||
if (pdev->dev.of_node)
|
||||
dev_set_name(&pdev->dev, "%s", "msm-transcode-loopback");
|
||||
|
||||
return snd_soc_register_platform(&pdev->dev,
|
||||
&msm_soc_platform);
|
||||
}
|
||||
|
||||
static int msm_transcode_remove(struct platform_device *pdev)
|
||||
{
|
||||
snd_soc_unregister_platform(&pdev->dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id msm_transcode_loopback_dt_match[] = {
|
||||
{.compatible = "qcom,msm-transcode-loopback"},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, msm_transcode_loopback_dt_match);
|
||||
|
||||
static struct platform_driver msm_transcode_loopback_driver = {
|
||||
.driver = {
|
||||
.name = "msm-transcode-loopback",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = msm_transcode_loopback_dt_match,
|
||||
},
|
||||
.probe = msm_transcode_dev_probe,
|
||||
.remove = msm_transcode_remove,
|
||||
};
|
||||
|
||||
static int __init msm_soc_platform_init(void)
|
||||
{
|
||||
memset(&transcode_info, 0, sizeof(struct msm_transcode_loopback));
|
||||
mutex_init(&transcode_info.lock);
|
||||
return platform_driver_register(&msm_transcode_loopback_driver);
|
||||
}
|
||||
module_init(msm_soc_platform_init);
|
||||
|
||||
static void __exit msm_soc_platform_exit(void)
|
||||
{
|
||||
mutex_destroy(&transcode_info.lock);
|
||||
platform_driver_unregister(&msm_transcode_loopback_driver);
|
||||
}
|
||||
module_exit(msm_soc_platform_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Transcode loopback platform driver");
|
||||
MODULE_LICENSE("GPL v2");
|
|
@ -2156,7 +2156,8 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
|
|||
(topology == SRS_TRUMEDIA_TOPOLOGY_ID))
|
||||
topology = DEFAULT_COPP_TOPOLOGY;
|
||||
} else {
|
||||
if (path == ADM_PATH_COMPRESSED_RX)
|
||||
if ((path == ADM_PATH_COMPRESSED_RX) ||
|
||||
(path == ADM_PATH_COMPRESSED_TX))
|
||||
flags = 0;
|
||||
else
|
||||
flags = ADM_LEGACY_DEVICE_SESSION;
|
||||
|
@ -2193,7 +2194,8 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
|
|||
acdb_id);
|
||||
set_bit(ADM_STATUS_CALIBRATION_REQUIRED,
|
||||
(void *)&this_adm.copp.adm_status[port_idx][copp_idx]);
|
||||
if (path != ADM_PATH_COMPRESSED_RX)
|
||||
if ((path != ADM_PATH_COMPRESSED_RX) &&
|
||||
(path != ADM_PATH_COMPRESSED_TX))
|
||||
send_adm_custom_topology();
|
||||
}
|
||||
}
|
||||
|
@ -2465,6 +2467,10 @@ static void route_set_opcode_matrix_id(
|
|||
route->hdr.opcode = ADM_CMD_STREAM_DEVICE_MAP_ROUTINGS_V5;
|
||||
route->matrix_id = ADM_MATRIX_ID_COMPRESSED_AUDIO_RX;
|
||||
break;
|
||||
case ADM_PATH_COMPRESSED_TX:
|
||||
route->hdr.opcode = ADM_CMD_STREAM_DEVICE_MAP_ROUTINGS_V5;
|
||||
route->matrix_id = ADM_MATRIX_ID_COMPRESSED_AUDIO_TX;
|
||||
break;
|
||||
default:
|
||||
pr_err("%s: Wrong path set[%d]\n", __func__, path);
|
||||
break;
|
||||
|
|
|
@ -155,12 +155,37 @@ static int out_cold_index;
|
|||
static char *out_buffer;
|
||||
static char *in_buffer;
|
||||
|
||||
static uint32_t adsp_reg_event_opcode[] = {ASM_STREAM_CMD_REGISTER_PP_EVENTS,
|
||||
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS};
|
||||
static uint32_t adsp_reg_event_opcode[] = {
|
||||
ASM_STREAM_CMD_REGISTER_PP_EVENTS,
|
||||
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS,
|
||||
ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE };
|
||||
|
||||
static uint32_t adsp_raise_event_opcode[] = {ASM_STREAM_PP_EVENT,
|
||||
ASM_STREAM_CMD_ENCDEC_EVENTS};
|
||||
static uint32_t adsp_raise_event_opcode[] = {
|
||||
ASM_STREAM_PP_EVENT,
|
||||
ASM_STREAM_CMD_ENCDEC_EVENTS,
|
||||
ASM_IEC_61937_MEDIA_FMT_EVENT };
|
||||
|
||||
static int is_adsp_reg_event(uint32_t cmd)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(adsp_reg_event_opcode); i++) {
|
||||
if (cmd == adsp_reg_event_opcode[i])
|
||||
return i;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int is_adsp_raise_event(uint32_t cmd)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(adsp_raise_event_opcode); i++) {
|
||||
if (cmd == adsp_raise_event_opcode[i])
|
||||
return i;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void q6asm_set_flag_in_token(union asm_token_struct *asm_token,
|
||||
int flag, int flag_offset)
|
||||
|
@ -1794,6 +1819,7 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
|
|||
case ASM_STREAM_CMD_SET_ENCDEC_PARAM:
|
||||
case ASM_STREAM_CMD_SET_ENCDEC_PARAM_V2:
|
||||
case ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS:
|
||||
case ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE:
|
||||
case ASM_DATA_CMD_REMOVE_INITIAL_SILENCE:
|
||||
case ASM_DATA_CMD_REMOVE_TRAILING_SILENCE:
|
||||
case ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS:
|
||||
|
@ -1807,10 +1833,9 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
|
|||
pr_err("%s: cmd = 0x%x returned error = 0x%x\n",
|
||||
__func__, payload[0], payload[1]);
|
||||
if (wakeup_flag) {
|
||||
if (payload[0] ==
|
||||
ASM_STREAM_CMD_SET_PP_PARAMS_V2
|
||||
|| payload[0] ==
|
||||
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS)
|
||||
if ((is_adsp_reg_event(payload[0]) >= 0)
|
||||
|| (payload[0] ==
|
||||
ASM_STREAM_CMD_SET_PP_PARAMS_V2))
|
||||
atomic_set(&ac->cmd_state_pp,
|
||||
payload[1]);
|
||||
else
|
||||
|
@ -1820,9 +1845,8 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
if (payload[0] == ASM_STREAM_CMD_SET_PP_PARAMS_V2 ||
|
||||
payload[0] ==
|
||||
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS) {
|
||||
if ((is_adsp_reg_event(payload[0]) >= 0) ||
|
||||
(payload[0] == ASM_STREAM_CMD_SET_PP_PARAMS_V2)) {
|
||||
if (atomic_read(&ac->cmd_state_pp) &&
|
||||
wakeup_flag) {
|
||||
atomic_set(&ac->cmd_state_pp, 0);
|
||||
|
@ -2063,13 +2087,11 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
|
|||
break;
|
||||
case ASM_STREAM_PP_EVENT:
|
||||
case ASM_STREAM_CMD_ENCDEC_EVENTS:
|
||||
pr_debug("%s: ASM_STREAM_PP_EVENT payload[0][0x%x] payload[1][0x%x]",
|
||||
case ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE:
|
||||
pr_debug("%s: ASM_STREAM_EVENT payload[0][0x%x] payload[1][0x%x]",
|
||||
__func__, payload[0], payload[1]);
|
||||
for (i = 0; i < ARRAY_SIZE(adsp_raise_event_opcode); i++)
|
||||
if (adsp_raise_event_opcode[i] == data->opcode)
|
||||
break;
|
||||
|
||||
if (i >= ARRAY_SIZE(adsp_raise_event_opcode))
|
||||
i = is_adsp_raise_event(data->opcode);
|
||||
if (i < 0)
|
||||
return 0;
|
||||
|
||||
/* repack payload for asm_stream_pp_event
|
||||
|
|
Loading…
Add table
Reference in a new issue