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

Commit 8cc69987 authored by Krishnankutty Kolathappilly's avatar Krishnankutty Kolathappilly Committed by Pradnya Chaphekar
Browse files

ASoC: msm: qdsp6v2: Add support for HDMI passthrough



Add support for compressed bitstream passthrough over HDMI
for DD/DDP contents. Use compressed driver to support
passthrough.

Change-Id: I01f9e4fa984a1f45d1f4de5250bed8f95d2a2dd0
Signed-off-by: default avatarKrishnankutty Kolathappilly <kkolat@codeaurora.org>
parent c6297e1e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -23,12 +23,13 @@
#define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324

#define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325

#define ADM_CMD_STREAM_DEVICE_MAP_ROUTINGS_V5 0x0001033D
/* Enumeration for an audio Rx matrix ID.*/
#define ADM_MATRIX_ID_AUDIO_RX              0

#define ADM_MATRIX_ID_AUDIO_TX              1

#define ADM_MATRIX_ID_COMPRESSED_AUDIO_RX   2
/* Enumeration for an audio Tx matrix ID.*/
#define ADM_MATRIX_ID_AUDIOX              1

@@ -2461,6 +2462,7 @@ struct afe_port_cmdrsp_get_param_v2 {
#define NULL_COPP_TOPOLOGY				0x00010312
#define DEFAULT_COPP_TOPOLOGY				0x00010BE3
#define DEFAULT_POPP_TOPOLOGY				0x00010BE4
#define COMPRESSED_PASSTHROUGH_DEFAULT_TOPOLOGY         0x0001076B
#define VPM_TX_SM_ECNS_COPP_TOPOLOGY			0x00010F71
#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY			0x00010F72
#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY		0x00010F75
@@ -7716,4 +7718,10 @@ struct asm_mtmx_strtr_params {
	u32 window_msw;
} __packed;
#define AUDPROC_MODULE_ID_RESAMPLER 0x00010719

enum {
	LEGACY_PCM = 0,
	COMPRESSED_PASSTHROUGH,
	COMPRESSED_PASSTHROUGH_CONVERT,
};
#endif /*_APR_AUDIO_V2_H_ */
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#define ADM_PATH_PLAYBACK 0x1
#define ADM_PATH_LIVE_REC 0x2
#define ADM_PATH_NONLIVE_REC 0x3
#define ADM_PATH_COMPRESSED_RX 0x5
#include <linux/qdsp6v2/rtac.h>
#include <sound/q6afe-v2.h>
#include <sound/q6audio-v2.h>
@@ -38,6 +39,8 @@ enum {
};

#define MAX_COPPS_PER_PORT 0x8
#define ADM_MAX_CHANNELS 8

/* multiple copp per stream. */
struct route_payload {
	unsigned int copp_idx[MAX_COPPS_PER_PORT];
+3 −0
Original line number Diff line number Diff line
@@ -228,6 +228,9 @@ int q6asm_stream_open_write_v2(struct audio_client *ac, uint32_t format,
				uint16_t bits_per_sample, int32_t stream_id,
				bool is_gapless_mode);

int q6asm_open_write_compressed(struct audio_client *ac, uint32_t format,
				uint32_t passthrough_flag);

int q6asm_open_read_write(struct audio_client *ac,
			uint32_t rd_format,
			uint32_t wr_format);
+1 −0
Original line number Diff line number Diff line
@@ -430,6 +430,7 @@ struct snd_codec {
	__u32 ch_mode;
	__u32 format;
	__u32 align;
	__u32 compr_passthr;
	union snd_codec_options options;
	__u32 reserved[3];
};
+52 −14
Original line number Diff line number Diff line
@@ -48,10 +48,15 @@ static int mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE;

#define SAMPLING_RATE_8KHZ 8000
#define SAMPLING_RATE_16KHZ 16000
#define SAMPLING_RATE_32KHZ   32000
#define SAMPLING_RATE_44DOT1KHZ 44100
#define SAMPLING_RATE_48KHZ 48000
#define SAMPLING_RATE_96KHZ 96000
#define SAMPLING_RATE_128KHZ   128000
#define SAMPLING_RATE_176DOT4KHZ  176400
#define SAMPLING_RATE_192KHZ 192000


static int apq8084_auxpcm_rate = 8000;
#define LO_1_SPK_AMP	0x1
#define LO_3_SPK_AMP	0x2
@@ -821,13 +826,24 @@ static char const *slim0_rx_sample_rate_text[] = {"KHZ_48", "KHZ_96",
static const char *const proxy_rx_ch_text[] = {"One", "Two", "Three", "Four",
					      "Five", "Six", "Seven", "Eight"};

static char const *hdmi_rx_sample_rate_text[] = {"KHZ_48", "KHZ_96",
						 "KHZ_192"};
static char const *hdmi_rx_sample_rate_text[] = {"KHZ_32", "KHZ_44_1", "KHZ_48",
						 "KHZ_96", "KHZ_128",
						 "KHZ_176_4", "KHZ_192"};

static const char * const slim1_tx_ch_text[] = {"One", "Two"};
static const char * const slim3_rx_ch_text[] = {"One", "Two"};
static const char *const slim1_rate_text[] = {"8000", "16000", "48000"};

enum {
	HDMI_RATE_32KHZ = 0,
	HDMI_RATE_44DOT1KHZ,
	HDMI_RATE_48KHZ,
	HDMI_RATE_96KHZ,
	HDMI_RATE_128KHZ,
	HDMI_RATE_176DOT4KHZ,
	HDMI_RATE_192KHZ
};

static int slim0_rx_sample_rate_get(struct snd_kcontrol *kcontrol,
	struct snd_ctl_elem_value *ucontrol)
{
@@ -1084,16 +1100,26 @@ static int hdmi_rx_sample_rate_get(struct snd_kcontrol *kcontrol,

	switch (hdmi_rx_sample_rate) {
	case SAMPLING_RATE_192KHZ:
		sample_rate_val = 2;
		sample_rate_val = HDMI_RATE_192KHZ;
		break;
	case SAMPLING_RATE_176DOT4KHZ:
		sample_rate_val = HDMI_RATE_176DOT4KHZ;
		break;
	case SAMPLING_RATE_128KHZ:
		sample_rate_val = HDMI_RATE_128KHZ;
		break;

	case SAMPLING_RATE_96KHZ:
		sample_rate_val = 1;
		sample_rate_val = HDMI_RATE_96KHZ;
		break;
	case SAMPLING_RATE_44DOT1KHZ:
		sample_rate_val = HDMI_RATE_44DOT1KHZ;
		break;
	case SAMPLING_RATE_32KHZ:
		sample_rate_val = HDMI_RATE_32KHZ;
		break;

	case SAMPLING_RATE_48KHZ:
	default:
		sample_rate_val = 0;
		sample_rate_val = HDMI_RATE_48KHZ;
		break;
	}
	ucontrol->value.integer.value[0] = sample_rate_val;
@@ -1108,13 +1134,25 @@ static int hdmi_rx_sample_rate_put(struct snd_kcontrol *kcontrol,
	pr_debug("%s: ucontrol value = %ld\n", __func__,
		 ucontrol->value.integer.value[0]);
	switch (ucontrol->value.integer.value[0]) {
	case 2:
	case HDMI_RATE_192KHZ:
		hdmi_rx_sample_rate = SAMPLING_RATE_192KHZ;
		break;
	case 1:
	case HDMI_RATE_176DOT4KHZ:
		hdmi_rx_sample_rate = SAMPLING_RATE_176DOT4KHZ;
		break;
	case HDMI_RATE_128KHZ:
		hdmi_rx_sample_rate = SAMPLING_RATE_128KHZ;
		break;
	case HDMI_RATE_96KHZ:
		hdmi_rx_sample_rate = SAMPLING_RATE_96KHZ;
		break;
	case 0:
	case HDMI_RATE_44DOT1KHZ:
		hdmi_rx_sample_rate = SAMPLING_RATE_44DOT1KHZ;
		break;
	case HDMI_RATE_32KHZ:
		hdmi_rx_sample_rate = SAMPLING_RATE_32KHZ;
		break;
	case HDMI_RATE_48KHZ:
	default:
		hdmi_rx_sample_rate = SAMPLING_RATE_48KHZ;
	}
@@ -1924,7 +1962,7 @@ static const struct soc_enum msm_snd_enum[] = {
	SOC_ENUM_SINGLE_EXT(2, rx_bit_format_text),
	SOC_ENUM_SINGLE_EXT(3, slim0_rx_sample_rate_text),
	SOC_ENUM_SINGLE_EXT(8, proxy_rx_ch_text),
	SOC_ENUM_SINGLE_EXT(3, hdmi_rx_sample_rate_text),
	SOC_ENUM_SINGLE_EXT(7, hdmi_rx_sample_rate_text),
	SOC_ENUM_SINGLE_EXT(2, slim1_tx_ch_text),
	SOC_ENUM_SINGLE_EXT(3, slim1_rate_text),
	SOC_ENUM_SINGLE_EXT(3, slim3_rx_ch_text),
Loading