Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ userspace/root/usr/share/fonts/*.woff2 filter=lfs diff=lfs merge=lfs -text
kernel/firmware/**/*.mbn filter=lfs diff=lfs merge=lfs -text
kernel/firmware/**/*.bin filter=lfs diff=lfs merge=lfs -text
kernel/firmware/**/*.tlv filter=lfs diff=lfs merge=lfs -text
kernel/firmware/**/*.mdt filter=lfs diff=lfs merge=lfs -text
kernel/firmware/**/*.b[0-9][0-9] filter=lfs diff=lfs merge=lfs -text
14 changes: 14 additions & 0 deletions kernel/configs/vamos.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ CONFIG_QCOM_PDR_HELPERS=y
CONFIG_RPMSG_CHAR=y
CONFIG_RESET_QCOM_PDC=y

# Audio (ADSP QDSP6 -> Secondary MI2S)
CONFIG_QCOM_APR=y
CONFIG_QCOM_PD_MAPPER=y
CONFIG_QCOM_Q6V5_PAS=y
CONFIG_SOUNDWIRE=y
CONFIG_SOUNDWIRE_QCOM=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y
CONFIG_SND_SOC_QCOM=y
CONFIG_SND_SOC_QDSP6=y
CONFIG_SND_SOC_SDM845=y
CONFIG_SND_SOC_SPDIF=y

# PPP (for USB LTE modem data connection)
CONFIG_PPP=y
CONFIG_PPP_ASYNC=y
Expand Down
82 changes: 82 additions & 0 deletions kernel/dts/sdm845-comma-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <dt-bindings/arm/qcom,ids.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
#include "sdm845.dtsi"
#include "pm8998.dtsi"
#include "pmi8998.dtsi"
Expand Down Expand Up @@ -47,6 +49,16 @@

vin-supply = <&vph_pwr>;
};

spkr_codec: audio-codec-0 {
compatible = "linux,spdif-dit";
#sound-dai-cells = <0>;
};

mic_codec: audio-codec-1 {
compatible = "linux,spdif-dir";
#sound-dai-cells = <0>;
};
};

&apps_rsc {
Expand Down Expand Up @@ -520,3 +532,73 @@

status = "okay";
};

&adsp_pas {
firmware-name = "qcom/sdm845/adsp.mbn";

status = "okay";
};

&q6afedai {
dai@18 {
reg = <SECONDARY_MI2S_RX>;
qcom,sd-lines = <1>;
};
};

&q6asmdai {
dai@0 {
reg = <MSM_FRONTEND_DAI_MULTIMEDIA1>;
direction = <Q6ASM_DAI_RX>;
};

dai@1 {
reg = <MSM_FRONTEND_DAI_MULTIMEDIA2>;
direction = <Q6ASM_DAI_TX>;
};
};

&sound {
compatible = "qcom,sdm845-sndcard";
pinctrl-names = "default";
clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
clock-names = "mclk";

mm1-dai-link {
link-name = "MultiMedia1";
cpu {
sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
};
};

mm2-dai-link {
link-name = "MultiMedia2";
cpu {
sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
};
};

speaker-dai-link {
link-name = "Secondary MI2S Playback";
cpu {
sound-dai = <&q6afedai SECONDARY_MI2S_RX>;
};

platform {
sound-dai = <&q6routing>;
};

codec {
sound-dai = <&spkr_codec>;
};
};
};

&tlmm {
sec_mi2s_active: sec-mi2s-active-state {
pins = "gpio80", "gpio81", "gpio82", "gpio83";
function = "sec_mi2s";
drive-strength = <8>;
bias-disable;
};
};
27 changes: 27 additions & 0 deletions kernel/dts/sdm845-comma-mici.dts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,33 @@
data-lanes = <0>;
};

&q6afedai {
dai@19 {
reg = <SECONDARY_MI2S_TX>;
qcom,sd-lines = <0>;
};
};

&sound {
model = "comma-mici";
pinctrl-0 = <&sec_mi2s_active>;

mic-dai-link {
link-name = "Secondary MI2S Capture";
cpu {
sound-dai = <&q6afedai SECONDARY_MI2S_TX>;
};

platform {
sound-dai = <&q6routing>;
};

codec {
sound-dai = <&mic_codec>;
};
};
};

&uart3 {
status = "okay";
};
Expand Down
36 changes: 36 additions & 0 deletions kernel/dts/sdm845-comma-tizi.dts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,42 @@
data-lanes = <0 1 2 3>;
};

&q6afedai {
dai@21 {
reg = <TERTIARY_MI2S_TX>;
qcom,sd-lines = <0 1>;
};
};

&sound {
model = "comma-tizi";
pinctrl-0 = <&sec_mi2s_active &ter_mi2s_active>;

mic-dai-link {
link-name = "Tertiary MI2S Capture";
cpu {
sound-dai = <&q6afedai TERTIARY_MI2S_TX>;
};

platform {
sound-dai = <&q6routing>;
};

codec {
sound-dai = <&mic_codec>;
};
};
};

&tlmm {
ter_mi2s_active: ter-mi2s-active-state {
pins = "gpio75", "gpio76", "gpio77", "gpio78";
function = "ter_mi2s";
drive-strength = <8>;
bias-disable;
};
};

&wifi {
qcom,calibration-variant = "comma-tizi";
};
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b00
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b01
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b02
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b03
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b04
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b05
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b06
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b07
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b08
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b09
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b10
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b11
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b12
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.b13
Git LFS file not shown
3 changes: 3 additions & 0 deletions kernel/firmware/qcom/sdm845/adsp.mdt
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From: Trey Moen <trey@moen.ai>
Date: Fri, 3 Jul 2026 22:30:00 -0700
Subject: [PATCH] ASoC: soc-dai: guard NULL dai ops in
snd_soc_dai_set_stream/get_stream

DAI drivers are allowed to register without a snd_soc_dai_ops struct
(e.g. the linux,spdif-dit/dir dummy codecs), and every accessor in
soc-dai.c checks dai->driver->ops before dereferencing it.
snd_soc_dai_set_stream() and snd_soc_dai_get_stream() do not, so a
machine driver calling them on such a codec DAI oopses. This happens on
sdm845 cards where qcom_snd_sdw_startup() runs for every DAI link: an
MI2S backend using spdif-dit/dir as its codec crashes on PCM open with
a NULL dereference at offsetof(struct snd_soc_dai_ops, set_stream).

Check ops for NULL and fall back to the existing -ENOTSUPP paths,
matching the convention used by the other DAI ops wrappers.
---
include/sound/soc-dai.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 224396927..aa78cea66 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -559,7 +559,7 @@ static inline void *snd_soc_dai_get_drvdata(struct snd_soc_dai *dai)
static inline int snd_soc_dai_set_stream(struct snd_soc_dai *dai,
void *stream, int direction)
{
- if (dai->driver->ops->set_stream)
+ if (dai->driver->ops && dai->driver->ops->set_stream)
return dai->driver->ops->set_stream(dai, stream, direction);
else
return -ENOTSUPP;
@@ -579,7 +579,7 @@ static inline int snd_soc_dai_set_stream(struct snd_soc_dai *dai,
static inline void *snd_soc_dai_get_stream(struct snd_soc_dai *dai,
int direction)
{
- if (dai->driver->ops->get_stream)
+ if (dai->driver->ops && dai->driver->ops->get_stream)
return dai->driver->ops->get_stream(dai, direction);
else
return ERR_PTR(-ENOTSUPP);
--
2.53.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From: Trey Moen <trey@moen.ai>
Date: Fri, 3 Jul 2026 23:30:00 -0700
Subject: [PATCH] ASoC: qdsp6: q6asm-dai: constrain audio buffer IOVAs to the
ADSP shared-mem aperture

The downstream msm-audio-ion driver maps all ASM shared-memory buffers
through the apps SMMU into a fixed IOVA window, MSM_AUDIO_ION_VA_START
0x10000000 with MSM_AUDIO_ION_VA_LEN 0x0FFFFFFF, i.e. IOVAs never
exceed 29 bits. Downstream-era ADSP firmware (AVS 2.8, as shipped on
the comma four) validates the SID-indexed address of
ASM_CMD_SHARED_MEM_MAP_REGIONS against that pre-configured aperture
and NAKs the map when the address lies outside it. Mainline dma-iommu
allocates IOVAs top-down from the 32-bit DMA limit (~0xfffxxxxx),
which such firmware rejects, so every PCM prepare fails with
"Audio Start: Buffer Allocation failed rc = -22".

Cap the q6asm-dai DMA mask at 29 bits when an SMMU is in use so the
top-down IOVA allocator hands out addresses just below 0x20000000,
inside the window the DSP accepts. Firmware that accepts full 32-bit
IOVAs is unaffected beyond the narrower allocation range, which is far
larger than any realistic set of concurrently mapped audio buffers.
---
sound/soc/qcom/qdsp6/q6asm-dai.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index b616ce316..1520b7840 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -1298,11 +1298,16 @@ static int q6asm_dai_probe(struct platform_device *pdev)
return -ENOMEM;

rc = of_parse_phandle_with_fixed_args(node, "iommus", 1, 0, &args);
- if (rc < 0)
+ if (rc < 0) {
pdata->sid = -1;
- else
+ } else {
pdata->sid = args.args[0] & SID_MASK_DEFAULT;

+ rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(29));
+ if (rc)
+ return rc;
+ }
+
dev_set_drvdata(dev, pdata);

rc = of_q6asm_parse_dai_data(dev, pdata);
--
2.53.0
Loading
Loading