Skip to contentSkip to conversation

Enable audio over HDMI and

PATCH In review Kumar Anurag 6 participants 16 messages Apr 13 – Apr 15

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Enable audio over HDMI and

This series adds the dt and driver changes for enabling audio over HDMI and Displayport.

Kumar Anurag (4):
arm64: dts: qcom: Enable secondary mi2s
arm64: dts: qcom: qcs6490: Enable DP audio
ASoC: qcom: q6dsp: Update bit format support for secondary i2s
ASoC: qcom: sc8280xp: don't force S16_LE in hw_params fixup

 arch/arm64/boot/dts/qcom/kodiak.dtsi         |  5 ++
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 59 ++++++++++++++++++++
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c     |  7 ++-
 sound/soc/qcom/sc8280xp.c                    |  2 -
 4 files changed, 69 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/4 arm64: dts: qcom: Enable secondary mi2s

Enable secondary mi2s to support HDMI audio.

---
 arch/arm64/boot/dts/qcom/kodiak.dtsi         |  5 +++
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 43 ++++++++++++++++++++
 2 files changed, 48 insertions(+)
arch/arm64/boot/dts/qcom/kodiak.dtsi +5 -0
index 6079e67ea829..d1009debc12b 100644
@@ -5827,6 +5827,11 @@ mi2s1_ws: mi2s1-ws-state {
 				function = "mi2s1_ws";
 			};
 
+			mi2s1_mclk: mi2s1-mclk-state {
+				pins = "gpio105";
+				function = "sec_mi2s";
+			};
+
 			pcie0_clkreq_n: pcie0-clkreq-n-state {
 				pins = "gpio88";
 				function = "pcie0_clkreqn";
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +43 -0

64 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v1 1/4] arm64: dts: qcom: Enable secondary mi2s

Quoted 4 lines · Kumar Anurag

Enable secondary mi2s to support HDMI audio.

---

[...]

Quoted 11 lines

+&mi2s1_data0 {

arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +10 -0
+	drive-strength = <8>;
+	bias-disable;
+};
+
+&mi2s1_mclk {
+	drive-strength = <8>;
+	bias-disable;
+	output-high;
+};
+

arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts &lpass_audiocc { · line 1481

Quoted 10 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +10 -0
+&mi2s1_sclk {
+	drive-strength = <8>;
+	bias-disable;
+	output-high;
+};
+
+&mi2s1_ws {
+	drive-strength = <8>;
+	bias-disable;
+	output-high;

For these pins in their "mission mode" function, do we expect these pincfg settings to ever change (i.e. across boards, will the drive-strength/ bias/output properties differ?)

Konrad

#3 lore raw

Re: [PATCH v1 1/4] arm64: dts: qcom: Enable secondary mi2s

In reply to Kumar Anurag
Quoted 1 line · Kumar Anurag

Enable secondary mi2s to support HDMI audio.

Please also correct subject line to mention kodiak.

Quoted 28 lines
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi         |  5 +++
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 43 ++++++++++++++++++++
 2 files changed, 48 insertions(+)
arch/arm64/boot/dts/qcom/kodiak.dtsi +5 -0
index 6079e67ea829..d1009debc12b 100644
@@ -5827,6 +5827,11 @@ mi2s1_ws: mi2s1-ws-state {
 				function = "mi2s1_ws";
 			};
 
+			mi2s1_mclk: mi2s1-mclk-state {
+				pins = "gpio105";
+				function = "sec_mi2s";
+			};
+
 			pcie0_clkreq_n: pcie0-clkreq-n-state {
 				pins = "gpio88";
 				function = "pcie0_clkreqn";
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +0 -0
index e3d2f01881ae..2e4062052828 100644

arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts &i2c0 { · line 675

Quoted 4 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +1 -0
@@ -672,6 +672,7 @@ &i2c0 {
 	lt9611_codec: hdmi-bridge@2b {
 		compatible = "lontium,lt9611uxc";
 		reg = <0x2b>;
+		#sound-dai-cells = <1>;

Separate patch.

Quoted 14 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +3 -0
 		interrupts-extended = <&tlmm 24 IRQ_TYPE_EDGE_FALLING>;
 		reset-gpios = <&pm7250b_gpios 2 GPIO_ACTIVE_HIGH>;
@@ -1110,6 +1111,9 @@ &sound {
 	compatible = "qcom,qcs6490-rb3gen2-sndcard";
 	model = "QCS6490-RB3Gen2";
 
+	pinctrl-0 = <&mi2s1_data0>, <&mi2s1_mclk>, <&mi2s1_sclk>, <&mi2s1_ws>;
+	pinctrl-names = "default";
+
 	audio-routing = "SpkrLeft IN", "WSA_SPK1 OUT",
 			"SpkrRight IN", "WSA_SPK2 OUT",
 			"VA DMIC0", "vdd-micb",

arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts platform { · line 1157

Quoted 5 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +2 -0
@@ -1149,6 +1153,22 @@ platform {
 			sound-dai = <&q6apm>;
 		};
 	};
+
+	mi2s1-playback-dai-link {

Keep the entries sorted. mi2s1 < va

Quoted 47 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +37 -0
+		link-name = "Secondary MI2S Playback";
+
+		codec {
+			sound-dai = <&lt9611_codec 0>;
+		};
+
+		cpu {
+			sound-dai = <&q6apmbedai SECONDARY_MI2S_RX>;
+		};
+
+		platform {
+			sound-dai = <&q6apm>;
+		};
+	};
 };
 
 &swr2 {
@@ -1437,3 +1457,26 @@ &lpass_audiocc {
 	compatible = "qcom,qcm6490-lpassaudiocc";
 	/delete-property/ power-domains;
 };
+
+&mi2s1_data0 {
+	drive-strength = <8>;
+	bias-disable;
+};
+
+&mi2s1_mclk {
+	drive-strength = <8>;
+	bias-disable;
+	output-high;
+};
+
+&mi2s1_sclk {
+	drive-strength = <8>;
+	bias-disable;
+	output-high;
+};
+
+&mi2s1_ws {
+	drive-strength = <8>;
+	bias-disable;
+	output-high;
+};
Signature · 1 line
2.34.1
Signature · 2 lines
With best wishes
Dmitry
#4 lore raw

PATCH 2/4 arm64: dts: qcom: qcs6490: Enable DP audio

In reply to Kumar Anurag

Add new dai link to enable DP audio.

---
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +16 -0
index 2e4062052828..90fd8822dabd 100644
@@ -1169,6 +1169,22 @@ platform {
 			sound-dai = <&q6apm>;
 		};
 	};
+
+	dp-dai-link {
+		link-name = "DisplayPort0 Playback";
+
+		codec {
+			sound-dai = <&mdss_dp>;
+		};
+
+		cpu {
+			sound-dai = <&q6apmbedai DISPLAY_PORT_RX_0>;
+		};
+
+		platform {
+			sound-dai = <&q6apm>;
+		};
+	};
 };
 
 &swr2 {
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH v1 2/4] arm64: dts: qcom: qcs6490: Enable DP audio

In reply to Kumar Anurag
Quoted 1 line · Kumar Anurag

Add new dai link to enable DP audio.

DAI

Also, will this enable audio for the USB-C DP only? Please add support for audio over the mini-DP port (or mention that it's not available in HW).

Quoted 11 lines
---
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +0 -0
index 2e4062052828..90fd8822dabd 100644

arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts platform { · line 1173

Quoted 5 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +2 -0
@@ -1169,6 +1169,22 @@ platform {
 			sound-dai = <&q6apm>;
 		};
 	};
+
+	dp-dai-link {

Still keep it sorted.

Quoted 20 lines
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +14 -0
+		link-name = "DisplayPort0 Playback";
+
+		codec {
+			sound-dai = <&mdss_dp>;
+		};
+
+		cpu {
+			sound-dai = <&q6apmbedai DISPLAY_PORT_RX_0>;
+		};
+
+		platform {
+			sound-dai = <&q6apm>;
+		};
+	};
 };
 
 &swr2 {
Signature · 1 line
2.34.1
Signature · 2 lines
With best wishes
Dmitry
#7 lore raw

PATCH 3/4 ASoC: qcom: q6dsp: Update bit format support for secondary i2s

In reply to Kumar Anurag

Add 32bit for playback and capture over secondary mi2s.

---
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c +5 -2
index 4eed54b071a5..0664f18d7a44 100644
@@ -380,7 +380,9 @@ static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] = {
 			.stream_name = "Secondary MI2S Playback",
 			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
 				 SNDRV_PCM_RATE_16000,
-			.formats = SNDRV_PCM_FMTBIT_S16_LE,
+			.formats = SNDRV_PCM_FMTBIT_S16_LE |
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S32_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min =     8000,
@@ -394,7 +396,8 @@ static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] = {
 			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
 				 SNDRV_PCM_RATE_16000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
-				   SNDRV_PCM_FMTBIT_S24_LE,
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S32_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min =     8000,
Signature · 1 line
2.34.1
#8 lore raw

Re: [PATCH v1 3/4] ASoC: qcom: q6dsp: Update bit format support for secondary i2s

Quoted 4 lines · Kumar Anurag

Add 32bit for playback and capture over secondary mi2s.

---

Would this apply to the other 5 I2S ports as well?

Konrad

maintainer
#9 lore raw

Re: [PATCH v1 3/4] ASoC: qcom: q6dsp: Update bit format support for secondary i2s

In reply to Kumar Anurag

sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] = { · line 385

Quoted 6 lines · Kumar Anurag

Add 32bit for playback and capture over secondary mi2s.

sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c +3 -1
-			.formats = SNDRV_PCM_FMTBIT_S16_LE,
+			.formats = SNDRV_PCM_FMTBIT_S16_LE |
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S32_LE,

The commit message said 32 bit but this is both 24 and 32 bit.

#10 lore raw

Re: [PATCH v1 3/4] ASoC: qcom: q6dsp: Update bit format support for secondary i2s

In reply to Kumar Anurag
Quoted 4 lines · Kumar Anurag

Add 32bit for playback and capture over secondary mi2s.

---

Pretty much simillar changes a are already submitted by " [PATCH v1 0/2]
ASoC: qcom: q6dsp-lpass-ports: Add support for extended sampling rates and PCM formats" https://lkml.org/lkml/2025/11/18/673

--srini

Quoted 28 lines
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c +5 -2
index 4eed54b071a5..0664f18d7a44 100644
@@ -380,7 +380,9 @@ static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] = {
 			.stream_name = "Secondary MI2S Playback",
 			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
 				 SNDRV_PCM_RATE_16000,
-			.formats = SNDRV_PCM_FMTBIT_S16_LE,
+			.formats = SNDRV_PCM_FMTBIT_S16_LE |
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S32_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min =     8000,
@@ -394,7 +396,8 @@ static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] = {
 			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
 				 SNDRV_PCM_RATE_16000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
-				   SNDRV_PCM_FMTBIT_S24_LE,
+				   SNDRV_PCM_FMTBIT_S24_LE |
+				   SNDRV_PCM_FMTBIT_S32_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min =     8000,
#11 lore raw

PATCH 4/4 ASoC: qcom: sc8280xp: don't force S16_LE in hw_params fixup

In reply to Kumar Anurag

The machine driver was unconditionally forcing S16_LE in sc8280xp_be_hw_params_fixup(), which prevents links (e.g. HDMI bridges) that require 32-bit formats from working. Drop the format override and keep only the fixed rate/channels constraints.

---
 sound/soc/qcom/sc8280xp.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/qcom/sc8280xp.c +0 -2
index 7925aa3f63ba..c00eabf200b7 100644
@@ -75,10 +75,8 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
 					SNDRV_PCM_HW_PARAM_RATE);
 	struct snd_interval *channels = hw_param_interval(params,
 					SNDRV_PCM_HW_PARAM_CHANNELS);
-	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
 
 	rate->min = rate->max = 48000;
-	snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
 	channels->min = 2;
 	channels->max = 2;
 	switch (cpu_dai->id) {
Signature · 1 line
2.34.1
maintainer
#12 lore raw

Re: [PATCH v1 4/4] ASoC: qcom: sc8280xp: don't force S16_LE in hw_params fixup

sound/soc/qcom/sc8280xp.c static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, · line 81

Quoted 11 lines · Kumar Anurag

The machine driver was unconditionally forcing S16_LE in sc8280xp_be_hw_params_fixup(), which prevents links (e.g. HDMI bridges) that require 32-bit formats from working. Drop the format override and keep only the fixed rate/channels constraints.

sound/soc/qcom/sc8280xp.c +0 -2
 	struct snd_interval *channels = hw_param_interval(params,
 					SNDRV_PCM_HW_PARAM_CHANNELS);
-	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
 
 	rate->min = rate->max = 48000;
-	snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);

This breaks compressed playback, for compressed streams we need to override the format since the DSP will be converting an input compressed stream to a PCM one. See 9565c9d53c5b (ASoC: qcom: sc8280xp: explicitly set S16LE format in sc8280xp_be_hw_params_fixup()).

#13 lore raw

Re: [PATCH v1 4/4] ASoC: qcom: sc8280xp: don't force S16_LE in hw_params fixup

In reply to Kumar Anurag
Quoted 4 lines · Kumar Anurag

The machine driver was unconditionally forcing S16_LE in sc8280xp_be_hw_params_fixup(), which prevents links (e.g. HDMI bridges) that require 32-bit formats from working. Drop the format override and keep only the fixed rate/channels constraints.

Why the format override is no longer needed? Please add it in the description.

Quoted 10 lines
---
 sound/soc/qcom/sc8280xp.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/qcom/sc8280xp.c +0 -0
index 7925aa3f63ba..c00eabf200b7 100644

sound/soc/qcom/sc8280xp.c static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, · line 81

Quoted 7 lines
sound/soc/qcom/sc8280xp.c +0 -2
@@ -75,10 +75,8 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
 					SNDRV_PCM_HW_PARAM_RATE);
 	struct snd_interval *channels = hw_param_interval(params,
 					SNDRV_PCM_HW_PARAM_CHANNELS);
-	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
 
 	rate->min = rate->max = 48000;
-	snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);

Does compressed playback work after this change? How did you test it?

Will it be possible with this series to have compressed playback via HDMI (with 32-bit format, right?)? You might need to add some functionality for this in topology.

Thanks,
Alexey

#14 lore raw
In reply to Kumar Anurag
Quoted 2 lines · Kumar Anurag

This series adds the dt and driver changes for enabling audio over HDMI and Displayport.

Starting from the cover letter subject. On which platform?

Quoted 16 lines

Kumar Anurag (4):
arm64: dts: qcom: Enable secondary mi2s
arm64: dts: qcom: qcs6490: Enable DP audio
ASoC: qcom: q6dsp: Update bit format support for secondary i2s
ASoC: qcom: sc8280xp: don't force S16_LE in hw_params fixup

 arch/arm64/boot/dts/qcom/kodiak.dtsi         |  5 ++
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 59 ++++++++++++++++++++
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c     |  7 ++-
 sound/soc/qcom/sc8280xp.c                    |  2 -
 4 files changed, 69 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
Signature · 2 lines
With best wishes
Dmitry
#15 lore raw
In reply to Kumar Anurag
Quoted 2 lines · Kumar Anurag

This series adds the dt and driver changes for enabling audio over HDMI and Displayport.

Do we need topology changes or UCM changes for these to work?

Quoted 16 lines

Kumar Anurag (4):
arm64: dts: qcom: Enable secondary mi2s
arm64: dts: qcom: qcs6490: Enable DP audio
ASoC: qcom: q6dsp: Update bit format support for secondary i2s
ASoC: qcom: sc8280xp: don't force S16_LE in hw_params fixup

 arch/arm64/boot/dts/qcom/kodiak.dtsi         |  5 ++
 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 59 ++++++++++++++++++++
 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c     |  7 ++-
 sound/soc/qcom/sc8280xp.c                    |  2 -
 4 files changed, 69 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
Signature · 2 lines
With best wishes
Dmitry