Ver Fonte

ASoC: msm: qdsp6v2: Add S24_3LE support to DP driver

Add support for HDMI and DP for S24_3LE bit format.
This allows playback of 24bit audio on the external
device.

Change-Id: Ia6e1148b2e5d13cc0ff6f2372d61c83c3e704255
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Ben Romberger há 7 anos atrás
pai
commit
8e4368d3dd
3 ficheiros alterados com 16 adições e 5 exclusões
  1. 2 1
      asoc/codecs/msm_hdmi_codec_rx.c
  2. 6 2
      asoc/msm-dai-q6-hdmi-v2.c
  3. 8 2
      asoc/sdm845.c

+ 2 - 1
asoc/codecs/msm_hdmi_codec_rx.c

@@ -489,7 +489,8 @@ static struct snd_soc_dai_driver msm_ext_disp_audio_codec_rx_dais[] = {
 			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
 				 SNDRV_PCM_RATE_192000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
-				   SNDRV_PCM_FMTBIT_S24_LE,
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S24_3LE,
 		},
 		.ops = &msm_ext_disp_audio_codec_rx_dai_ops,
 	},

+ 6 - 2
asoc/msm-dai-q6-hdmi-v2.c

@@ -217,6 +217,7 @@ static int msm_dai_q6_hdmi_hw_params(struct snd_pcm_substream *substream,
 		dai_data->port_config.hdmi_multi_ch.bit_width = 16;
 		break;
 	case SNDRV_PCM_FORMAT_S24_LE:
+	case SNDRV_PCM_FORMAT_S24_3LE:
 		dai_data->port_config.hdmi_multi_ch.bit_width = 24;
 		break;
 	}
@@ -435,7 +436,9 @@ static struct snd_soc_dai_driver msm_dai_q6_hdmi_hdmi_rx_dai = {
 			 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
 			 SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
 			 SNDRV_PCM_RATE_192000,
-		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
+		.formats = SNDRV_PCM_FMTBIT_S16_LE |
+			   SNDRV_PCM_FMTBIT_S24_LE |
+			   SNDRV_PCM_FMTBIT_S24_3LE,
 		.channels_min = 2,
 		.channels_max = 8,
 		.rate_max = 192000,
@@ -457,7 +460,8 @@ static struct snd_soc_dai_driver msm_dai_q6_display_port_rx_dai[] = {
 				 SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
 				 SNDRV_PCM_RATE_192000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
-				   SNDRV_PCM_FMTBIT_S24_LE,
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S24_3LE,
 			.channels_min = 2,
 			.channels_max = 8,
 			.rate_max =     192000,

+ 8 - 2
asoc/sdm845.c

@@ -408,7 +408,8 @@ static const char *const slim_tx_ch_text[] = {"One", "Two", "Three", "Four",
 static const char *const vi_feed_ch_text[] = {"One", "Two"};
 static char const *bit_format_text[] = {"S16_LE", "S24_LE", "S24_3LE",
 					  "S32_LE"};
-static char const *ext_disp_bit_format_text[] = {"S16_LE", "S24_LE"};
+static char const *ext_disp_bit_format_text[] = {"S16_LE", "S24_LE",
+						 "S24_3LE"};
 static char const *slim_sample_rate_text[] = {"KHZ_8", "KHZ_16",
 					"KHZ_32", "KHZ_44P1", "KHZ_48",
 					"KHZ_88P2", "KHZ_96", "KHZ_176P4",
@@ -1420,10 +1421,12 @@ static int ext_disp_rx_format_get(struct snd_kcontrol *kcontrol,
 		return idx;
 
 	switch (ext_disp_rx_cfg[idx].bit_format) {
+	case SNDRV_PCM_FORMAT_S24_3LE:
+		ucontrol->value.integer.value[0] = 2;
+		break;
 	case SNDRV_PCM_FORMAT_S24_LE:
 		ucontrol->value.integer.value[0] = 1;
 		break;
-
 	case SNDRV_PCM_FORMAT_S16_LE:
 	default:
 		ucontrol->value.integer.value[0] = 0;
@@ -1445,6 +1448,9 @@ static int ext_disp_rx_format_put(struct snd_kcontrol *kcontrol,
 		return idx;
 
 	switch (ucontrol->value.integer.value[0]) {
+	case 2:
+		ext_disp_rx_cfg[idx].bit_format = SNDRV_PCM_FORMAT_S24_3LE;
+		break;
 	case 1:
 		ext_disp_rx_cfg[idx].bit_format = SNDRV_PCM_FORMAT_S24_LE;
 		break;