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

Commit d13fc85e authored by Mingming Yin's avatar Mingming Yin Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm: qdsp6v2: enhance multi-channel playback support



-Add multi-channel playback support for non standard
 channel mappings such as 3-ch, 4-ch, 5-ch, and 7-ch

Change-Id: I712ef28e9fdb2e35b59dd5fbbaddd9d38a2bad69
Signed-off-by: default avatarMingming Yin <mingming@codeaurora.org>
parent 155357d0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -63,8 +63,11 @@ static bool hdcp_feature_on = true;

/* Supported HDMI Audio channels */
#define MSM_HDMI_AUDIO_CHANNEL_2	2
#define MSM_HDMI_AUDIO_CHANNEL_3	3
#define MSM_HDMI_AUDIO_CHANNEL_4	4
#define MSM_HDMI_AUDIO_CHANNEL_5	5
#define MSM_HDMI_AUDIO_CHANNEL_6	6
#define MSM_HDMI_AUDIO_CHANNEL_7	7
#define MSM_HDMI_AUDIO_CHANNEL_8	8

enum msm_hdmi_supported_audio_sample_rates {
@@ -2057,12 +2060,15 @@ static int hdmi_tx_audio_iframe_setup(struct hdmi_tx_ctrl *hdmi_ctrl,
		switch (num_of_channels) {
		case MSM_HDMI_AUDIO_CHANNEL_2:
			break;
		case MSM_HDMI_AUDIO_CHANNEL_3:
		case MSM_HDMI_AUDIO_CHANNEL_4:
			channel_count = 3;
			break;
		case MSM_HDMI_AUDIO_CHANNEL_5:
		case MSM_HDMI_AUDIO_CHANNEL_6:
			channel_count = 5;
			break;
		case MSM_HDMI_AUDIO_CHANNEL_7:
		case MSM_HDMI_AUDIO_CHANNEL_8:
			channel_count = 7;
			break;
+13 −0
Original line number Diff line number Diff line
@@ -120,13 +120,26 @@ static int msm_hdmi_audio_codec_rx_dai_hw_params(
		return msm_hdmi_audio_codec_return_value;
	}

	/*refer to HDMI spec CEA-861-E: Table 28 Audio InfoFrame Data Byte 4*/
	switch (num_channels) {
	case 2:
		channel_allocation  = 0;
		break;
	case 3:
		channel_allocation  = 0x02;/*default to FL/FR/FC*/
		break;
	case 4:
		channel_allocation  = 0x06;/*default to FL/FR/FC/RC*/
		break;
	case 5:
		channel_allocation  = 0x0A;/*default to FL/FR/FC/RR/RL*/
		break;
	case 6:
		channel_allocation  = 0x0B;
		break;
	case 7:
		channel_allocation  = 0x12;/*default to FL/FR/FC/RL/RR/RRC/RLC*/
		break;
	case 8:
		channel_allocation  = 0x13;
		break;
+13 −0
Original line number Diff line number Diff line
@@ -129,13 +129,26 @@ static int msm_dai_q6_hdmi_hw_params(struct snd_pcm_substream *substream,
		break;
	}

	/*refer to HDMI spec CEA-861-E: Table 28 Audio InfoFrame Data Byte 4*/
	switch (dai_data->channels) {
	case 2:
		dai_data->port_config.hdmi_multi_ch.channel_allocation = 0;
		break;
	case 3:
		dai_data->port_config.hdmi_multi_ch.channel_allocation = 0x02;
		break;
	case 4:
		dai_data->port_config.hdmi_multi_ch.channel_allocation = 0x06;
		break;
	case 5:
		dai_data->port_config.hdmi_multi_ch.channel_allocation = 0x0A;
		break;
	case 6:
		dai_data->port_config.hdmi_multi_ch.channel_allocation = 0x0B;
		break;
	case 7:
		dai_data->port_config.hdmi_multi_ch.channel_allocation = 0x12;
		break;
	case 8:
		dai_data->port_config.hdmi_multi_ch.channel_allocation = 0x13;
		break;