Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c340bec5 authored by Siddartha Shaik's avatar Siddartha Shaik
Browse files

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: default avatarSiddartha Shaik <sshaik@codeaurora.org>
parent b7d425e9
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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>,
+5 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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>
+1 −1
Original line number Diff line number Diff line
@@ -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
+12 −2
Original line number Diff line number Diff line
@@ -1077,6 +1077,9 @@ 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;
		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 {
@@ -1514,6 +1517,9 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set)
			path_type = ADM_PATH_PLAYBACK;
	} else {
		session_type = SESSION_TYPE_TX;
		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) &&
@@ -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"},
Loading