* [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware
@ 2026-12-04 15:53 Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 01/19] ASoC: qcom: lpass-cpu: fix RXTX WRDMA current address register readability Neil Armstrong
` (18 more replies)
0 siblings, 19 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong, Sashiko, Krzysztof Kozlowski
This patchset is part of a serie adding the necessary plumbing to
drive the SM8650 audio interfaces directly from Linux.
This is required for boards like the Valve Deckard that boot Linux at EL2
without the ADSP audio firmware, meaning the audio interfaces must be driven
directly by the application processor through lpass-cpu.
Without the ADSP firmware, the LPASS clocks, memory zones and audio
controlers must be controlled by Linux
To support this, the series introduces the following changes:
- ASoC LPASS core: Prepares the lpass and lpass-cdc-dma drivers to
handle multiple LPAIFs for I2S ports, allocates and maps LPM buffer
memory for DAIs, and adds support for the optional WSA interface
and Senary/Septenary MI2S ports.
- ASoC SM8650: Introduces the SM8650 lpass-cpu variant and allows the
sc8280xp machine driver to be used with lpass-cpu to keep sound card
bindings working.
The patchset starts with 2 fixes reported on the v1 patchset by Sashiko.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v3:
- Rebased on next-20261203
- Return error when fetching wsa irq instead of -ENODEV
- Link to v2: https://patch.msgid.link/20261124-topic-sm8650-el2-v2-0-174e159f0f69@linaro.org
Changes in v2:
- Added 2 fixes reported by Sashiko
- Add WSA regmaps callbacks instead of reusing the RXTX ones
- Fix irq disable for WSA like it was fixed for RXTX & VA
- Check IRQSTAT regmap read return
- Add missing LPASS_CDC_DMA_WSA_TX4 case in lpass-cdc-dma
- Only enable mem1 at first for initial WSA support
- Fail initializing lpass-cpu daiops when no I2S dai is registered in DT
- Add va_enable along wsa_enable to check if VA dai is registered in DT
- Move MI2S lpm prealloc in a separate function and handle VA clock
- Use proper offset for LPASS_CDC_DMA_RX0 and LPASS_CDC_DMA_TX0
- Only allocate VA memory if VA is enabled
- Use correct size for remain LPM memory check
- Use VA mem clock if MI2S uses VA LPAIF
- Check mem clock set_rate and enable return values
- Add missing set_bit(chan) for rxtx and wsa channels in sm8650 lpass
- Use LPASS_RXTX_CDC_LPM for lpass-rxtx-lpaif
- Correct rxtx/wsa dma channels count
- Fix reusing the sc8280xp card with lpass-cpu by detecting non-dynamic DAIs
- Link to v1: https://patch.msgid.link/20261113-topic-sm8650-el2-v1-0-5183f6aab9fc@linaro.org
To: Srinivas Kandagatla <srini@kernel.org>
To: Liam Girdwood <lgirdwood@gmail.com>
To: Mark Brown <broonie@kernel.org>
To: Jaroslav Kysela <perex@perex.cz>
To: Takashi Iwai <tiwai@suse.com>
To: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
To: Venkata Prasad Potturu <quic_potturu@quicinc.com>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Rohit kumar <quic_rohkumar@quicinc.com>
Cc: linux-sound@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Neil Armstrong (19):
ASoC: qcom: lpass-cpu: fix RXTX WRDMA current address register readability
ASoC: qcom: lpass-platform: disable the RXTX & VA DMA interrupts on stop
ASoC: dt-bindings: qcom,lpass: add Senary & Septenary MI2S ids
ASoC: dt-bindings: qcom,lpass: add WSA RX and TX channels ids
ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used
ASoC: dt-bindings: qcom,lpass-cpu: document the SM8650 LPASS
ASoC: codecs: lpass-wsa-macro: handle the macro & dcodec power domains
ASoC: qcom: lpass-cpu: get the optional codec_mem3 clock
ASoC: qcom: lpass: add support for optional WSA interface
ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA
ASoC: qcom: lpass: prepare to handle multiple lpaifs for i2s
ASoC: qcom: lpass: add support for MI2S_SENARY & MI2S_SEPTENARY
ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs
ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs
ASoC: qcom: lpass: allocate LPM buffer memory to DAIs
ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory
ASoC: qcom: add SM8650 LPASS CPU driver
ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai
ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu
.../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 74 ++-
.../bindings/sound/qcom,lpass-rx-macro.yaml | 17 +-
.../bindings/sound/qcom,lpass-tx-macro.yaml | 20 +-
.../bindings/sound/qcom,lpass-va-macro.yaml | 13 +-
.../bindings/sound/qcom,lpass-wsa-macro.yaml | 29 +-
include/dt-bindings/sound/qcom,lpass.h | 24 +
sound/soc/codecs/lpass-wsa-macro.c | 9 +
sound/soc/qcom/Kconfig | 12 +
sound/soc/qcom/Makefile | 2 +
sound/soc/qcom/common.c | 45 +-
sound/soc/qcom/common.h | 9 +
sound/soc/qcom/lpass-apq8016.c | 9 +-
sound/soc/qcom/lpass-cdc-dma.c | 48 +-
sound/soc/qcom/lpass-cpu.c | 463 ++++++++++++---
sound/soc/qcom/lpass-lpaif-reg.h | 51 +-
sound/soc/qcom/lpass-platform.c | 501 ++++++++++++++--
sound/soc/qcom/lpass-sc7180.c | 10 +-
sound/soc/qcom/lpass-sc7280.c | 10 +-
sound/soc/qcom/lpass-sm8650.c | 653 +++++++++++++++++++++
sound/soc/qcom/lpass.h | 199 ++++++-
sound/soc/qcom/sc8280xp.c | 88 +++
sound/soc/qcom/sdw.c | 42 +-
22 files changed, 2071 insertions(+), 257 deletions(-)
---
base-commit: 0b5bb03d26a268f2606e3f574b277a1105136328
change-id: 20261113-topic-sm8650-el2-c6caf4237ca7
Best regards,
--
Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v3 01/19] ASoC: qcom: lpass-cpu: fix RXTX WRDMA current address register readability
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 02/19] ASoC: qcom: lpass-platform: disable the RXTX & VA DMA interrupts on stop Neil Armstrong
` (17 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong, Sashiko
__lpass_rxtx_regmap_accessible() checks the RXTX WRDMA current address
register without adding rxtx_wrdma_channel_start to the channel index
while all the other RXTX WRDMA registers do, so the current address
register of the last WRDMA channels is not readable and
lpass_platform_pcmops_pointer() fails with -EIO on those capture
channels.
Add rxtx_wrdma_channel_start like for the other RXTX WRDMA registers.
Fixes: b138706225c9 ("ASoC: qcom: Add regmap config support for codec dma driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/r/sashiko-outbox-213518@kernel.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 81eebfabcc9f..5fb20e284afe 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -843,7 +843,8 @@ static bool __lpass_rxtx_regmap_accessible(struct device *dev, unsigned int reg,
LPASS_CDC_DMA_TX3))
return true;
if (rw == LPASS_REG_READ) {
- if (reg == LPAIF_CDC_RXTX_WRDMACURR_REG(v, i, LPASS_CDC_DMA_RX0))
+ if (reg == LPAIF_CDC_RXTX_WRDMACURR_REG(v, i + v->rxtx_wrdma_channel_start,
+ LPASS_CDC_DMA_TX3))
return true;
}
if (reg == LPAIF_CDC_RXTX_WRDMAPER_REG(v, i + v->rxtx_wrdma_channel_start,
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 02/19] ASoC: qcom: lpass-platform: disable the RXTX & VA DMA interrupts on stop
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 01/19] ASoC: qcom: lpass-cpu: fix RXTX WRDMA current address register readability Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 03/19] ASoC: dt-bindings: qcom,lpass: add Senary & Septenary MI2S ids Neil Armstrong
` (16 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong, Sashiko
On SNDRV_PCM_TRIGGER_STOP, SUSPEND and PAUSE_PUSH, the RXTX and VA codec
DMA cases set val_irqen to LPAIF_IRQ_ALL(ch), so the channel interrupts
are kept enabled instead of being disabled like for the MI2S and HDMI
DMAs. Once the stream is closed the substream is cleared, and the
interrupt handlers ignore the pending interrupts of the channel
without clearing them.
Disable the channel interrupts on stop, and drop the irq clear
register setup which is unused on stop.
Fixes: 7d7209557b67 ("ASoC: qcom: Add support for codec dma driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/r/sashiko-outbox-213518@kernel.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-platform.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 594cdd21c3d3..7dfcae4e6fda 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -814,12 +814,9 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
return ret;
}
- reg_irqclr = LPAIF_RXTX_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
- val_irqclr = LPAIF_IRQ_ALL(ch);
-
reg_irqen = LPAIF_RXTX_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST);
val_mask = LPAIF_IRQ_ALL(ch);
- val_irqen = LPAIF_IRQ_ALL(ch);
+ val_irqen = 0;
break;
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
ret = regmap_fields_write(dmactl->dyncclk, id, LPAIF_DMACTL_DYNCLK_OFF);
@@ -829,12 +826,9 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
return ret;
}
- reg_irqclr = LPAIF_VA_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
- val_irqclr = LPAIF_IRQ_ALL(ch);
-
reg_irqen = LPAIF_VA_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST);
val_mask = LPAIF_IRQ_ALL(ch);
- val_irqen = LPAIF_IRQ_ALL(ch);
+ val_irqen = 0;
break;
default:
dev_err(soc_runtime->dev, "%s: invalid %d interface\n", __func__, dai_id);
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 03/19] ASoC: dt-bindings: qcom,lpass: add Senary & Septenary MI2S ids
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 01/19] ASoC: qcom: lpass-cpu: fix RXTX WRDMA current address register readability Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 02/19] ASoC: qcom: lpass-platform: disable the RXTX & VA DMA interrupts on stop Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 04/19] ASoC: dt-bindings: qcom,lpass: add WSA RX and TX channels ids Neil Armstrong
` (15 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong, Krzysztof Kozlowski
Some SoCs like SM8650 have Senary & Septenary MI2S interfaces, which can't
be referenced by the LPASS CPU DAI ids.
Add the MI2S_SENARY & MI2S_SEPTENARY DAI ids.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
include/dt-bindings/sound/qcom,lpass.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/dt-bindings/sound/qcom,lpass.h b/include/dt-bindings/sound/qcom,lpass.h
index a9404c3b8884..22f5e1fcc8a6 100644
--- a/include/dt-bindings/sound/qcom,lpass.h
+++ b/include/dt-bindings/sound/qcom,lpass.h
@@ -41,6 +41,9 @@
#define LPASS_CDC_DMA_VA_TX7 32
#define LPASS_CDC_DMA_VA_TX8 33
+#define MI2S_SENARY 34
+#define MI2S_SEPTENARY 35
+
#define LPASS_MCLK0 0
#endif /* __DT_QCOM_LPASS_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 04/19] ASoC: dt-bindings: qcom,lpass: add WSA RX and TX channels ids
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (2 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 03/19] ASoC: dt-bindings: qcom,lpass: add Senary & Septenary MI2S ids Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 05/19] ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used Neil Armstrong
` (14 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong, Krzysztof Kozlowski
Add the bindings to connect to the Qualcomm WSA interfaces.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
include/dt-bindings/sound/qcom,lpass.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/dt-bindings/sound/qcom,lpass.h b/include/dt-bindings/sound/qcom,lpass.h
index 22f5e1fcc8a6..5d8db5195dad 100644
--- a/include/dt-bindings/sound/qcom,lpass.h
+++ b/include/dt-bindings/sound/qcom,lpass.h
@@ -44,6 +44,27 @@
#define MI2S_SENARY 34
#define MI2S_SEPTENARY 35
+#define LPASS_CDC_DMA_WSA_RX0 36
+#define LPASS_CDC_DMA_WSA_RX1 37
+#define LPASS_CDC_DMA_WSA_RX2 38
+#define LPASS_CDC_DMA_WSA_RX3 39
+#define LPASS_CDC_DMA_WSA_RX4 40
+#define LPASS_CDC_DMA_WSA_RX5 41
+#define LPASS_CDC_DMA_WSA_RX6 42
+#define LPASS_CDC_DMA_WSA_RX7 43
+#define LPASS_CDC_DMA_WSA_RX8 44
+#define LPASS_CDC_DMA_WSA_RX9 45
+
+#define LPASS_CDC_DMA_WSA_TX0 46
+#define LPASS_CDC_DMA_WSA_TX1 47
+#define LPASS_CDC_DMA_WSA_TX2 48
+#define LPASS_CDC_DMA_WSA_TX3 49
+#define LPASS_CDC_DMA_WSA_TX4 50
+#define LPASS_CDC_DMA_WSA_TX5 51
+#define LPASS_CDC_DMA_WSA_TX6 52
+#define LPASS_CDC_DMA_WSA_TX7 53
+#define LPASS_CDC_DMA_WSA_TX8 54
+
#define LPASS_MCLK0 0
#endif /* __DT_QCOM_LPASS_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 05/19] ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (3 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 04/19] ASoC: dt-bindings: qcom,lpass: add WSA RX and TX channels ids Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 16:20 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 06/19] ASoC: dt-bindings: qcom,lpass-cpu: document the SM8650 LPASS Neil Armstrong
` (13 subsequent siblings)
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong, Krzysztof Kozlowski
On platforms where the ADSP is not used and the RX/TX/VA/WSA macros
are entirely handled by the OS, the macros blocks requires a different
set of clocks and power-domains to replace the clocks exposed by the
ADSP firmware interface.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
.../bindings/sound/qcom,lpass-rx-macro.yaml | 17 ++++++++-----
.../bindings/sound/qcom,lpass-tx-macro.yaml | 20 +++++++++------
.../bindings/sound/qcom,lpass-va-macro.yaml | 13 ++++++----
.../bindings/sound/qcom,lpass-wsa-macro.yaml | 29 ++++++++++++++++------
4 files changed, 52 insertions(+), 27 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml
index 5e1940fc3e9f..fc00ce1e739f 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml
@@ -134,14 +134,19 @@ allOf:
then:
properties:
clocks:
- minItems: 4
+ minItems: 3
maxItems: 4
clock-names:
- items:
- - const: mclk
- - const: macro
- - const: dcodec
- - const: fsgen
+ oneOf:
+ - items: # for ADSP based platforms
+ - const: mclk
+ - const: macro
+ - const: dcodec
+ - const: fsgen
+ - items: # for ADSP bypass based platforms
+ - const: mclk
+ - const: macro
+ - const: fsgen
unevaluatedProperties: false
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
index 6f5648a973cd..093343f96f67 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
@@ -42,11 +42,11 @@ properties:
const: 0
clocks:
- minItems: 3
+ minItems: 2
maxItems: 5
clock-names:
- minItems: 3
+ minItems: 2
maxItems: 5
clock-output-names:
@@ -138,14 +138,18 @@ allOf:
then:
properties:
clocks:
- minItems: 4
+ minItems: 2
maxItems: 4
clock-names:
- items:
- - const: mclk
- - const: macro
- - const: dcodec
- - const: fsgen
+ oneOf:
+ - items: # for ADSP based platforms
+ - const: mclk
+ - const: macro
+ - const: dcodec
+ - const: fsgen
+ - items: # for ADSP bypass based platforms
+ - const: mclk
+ - const: fsgen
unevaluatedProperties: false
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
index a5466e61b0b1..3f8d0b4cbde2 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
@@ -163,13 +163,16 @@ allOf:
then:
properties:
clocks:
- minItems: 3
+ minItems: 1
maxItems: 3
clock-names:
- items:
- - const: mclk
- - const: macro
- - const: dcodec
+ oneOf:
+ - items: # for ADSP based platforms
+ - const: mclk
+ - const: macro
+ - const: dcodec
+ - items: # for ADSP bypass based platforms
+ - const: mclk
unevaluatedProperties: false
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml
index 9fedd80532e2..432839f05c58 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml
@@ -38,16 +38,24 @@ properties:
const: 0
clocks:
- minItems: 4
+ minItems: 3
maxItems: 6
clock-names:
- minItems: 4
+ minItems: 3
maxItems: 6
clock-output-names:
maxItems: 1
+ power-domains:
+ maxItems: 2
+
+ power-domain-names:
+ items:
+ - const: macro
+ - const: dcodec
+
qcom,dmic-sample-rate:
description: dmic sample rate
$ref: /schemas/types.yaml#/definitions/uint32
@@ -93,14 +101,19 @@ allOf:
then:
properties:
clocks:
- minItems: 4
+ minItems: 3
maxItems: 4
clock-names:
- items:
- - const: mclk
- - const: macro
- - const: dcodec
- - const: fsgen
+ oneOf:
+ - items: # for ADSP based platforms
+ - const: mclk
+ - const: macro
+ - const: dcodec
+ - const: fsgen
+ - items: # for ADSP bypass based platforms
+ - const: mclk
+ - const: macro
+ - const: fsgen
unevaluatedProperties: false
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 06/19] ASoC: dt-bindings: qcom,lpass-cpu: document the SM8650 LPASS
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (4 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 05/19] ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 07/19] ASoC: codecs: lpass-wsa-macro: handle the macro & dcodec power domains Neil Armstrong
` (12 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong, Krzysztof Kozlowski
The SM8650 LPASS can be driven by Linux through lpass-cpu, with extra LPAIF
instances, LPMs and clocks compared to the other SoCs.
Document the SM8650 LPASS CPU registers, clocks and interrupts.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
.../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 74 ++++++++++++++++++++--
1 file changed, 68 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml
index 3a559bd07a79..f431173a0e88 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml
@@ -23,32 +23,33 @@ properties:
- qcom,apq8016-lpass-cpu
- qcom,sc7180-lpass-cpu
- qcom,sc7280-lpass-cpu
+ - qcom,sm8650-lpass-cpu
reg:
minItems: 1
- maxItems: 6
+ maxItems: 8
description: LPAIF core registers
reg-names:
minItems: 1
- maxItems: 6
+ maxItems: 8
clocks:
minItems: 3
- maxItems: 10
+ maxItems: 16
clock-names:
minItems: 1
- maxItems: 10
+ maxItems: 16
interrupts:
minItems: 1
- maxItems: 4
+ maxItems: 6
description: LPAIF DMA buffer interrupt
interrupt-names:
minItems: 1
- maxItems: 4
+ maxItems: 6
qcom,adsp:
$ref: /schemas/types.yaml#/definitions/phandle
@@ -59,6 +60,8 @@ properties:
maxItems: 3
description: Phandle to apps_smmu node with sid mask
+ dma-coherent: true
+
power-domains:
maxItems: 1
@@ -241,6 +244,65 @@ allOf:
- iommus
- power-domains
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: qcom,sm8650-lpass-cpu
+
+ then:
+ properties:
+ clocks:
+ minItems: 16
+ maxItems: 16
+ clock-names:
+ items:
+ - const: aon_cc_audio_hm_h
+ - const: core_cc_sysnoc_mport_core
+ - const: core_cc_ext_mclk0
+ - const: core_cc_ext_if0_ibit
+ - const: core_cc_ext_if1_ibit
+ - const: aon_cc_ext_if1_ibit
+ - const: audio_cc_ext_if1_ibit
+ - const: audio_cc_ext_if2_ibit
+ - const: audio_cc_ext_if4_ibit
+ - const: audio_cc_ext_if5_ibit
+ - const: audio_cc_codec_mem
+ - const: audio_cc_codec_mem0
+ - const: audio_cc_codec_mem1
+ - const: audio_cc_codec_mem2
+ - const: audio_cc_codec_mem3
+ - const: aon_cc_va_mem0
+ reg:
+ minItems: 8
+ maxItems: 8
+ reg-names:
+ items:
+ - const: lpass-hdmiif
+ - const: lpass-lpaif
+ - const: lpass-rxtx-cdc-dma-lpm
+ - const: lpass-rxtx-lpaif
+ - const: lpass-va-lpaif
+ - const: lpass-va-cdc-dma-lpm
+ - const: lpass-wsa-lpaif
+ - const: lpass-aud-lpaif
+ interrupts:
+ minItems: 6
+ maxItems: 6
+ interrupt-names:
+ items:
+ - const: lpass-irq-lpaif
+ - const: lpass-irq-hdmi
+ - const: lpass-irq-vaif
+ - const: lpass-irq-rxtxif
+ - const: lpass-irq-wsaif
+ - const: lpass-irq-audif
+ power-domain-names: false
+
+ required:
+ - iommus
+ - power-domains
+
examples:
- |
#include <dt-bindings/sound/sc7180-lpass.h>
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 07/19] ASoC: codecs: lpass-wsa-macro: handle the macro & dcodec power domains
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (5 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 06/19] ASoC: dt-bindings: qcom,lpass-cpu: document the SM8650 LPASS Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 08/19] ASoC: qcom: lpass-cpu: get the optional codec_mem3 clock Neil Armstrong
` (11 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
When the LPASS is not handled by the ADSP firmware, the WSA macro lies
in the LPASS core and audio power domains like the RX, TX and VA
macros, so attach and power them with lpass_macro_pds_init() like
the other macro drivers.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/codecs/lpass-wsa-macro.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index f9646d1c09dd..3a4decb478b8 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -419,6 +419,7 @@ struct wsa_macro {
struct clk *macro;
struct clk *dcodec;
struct clk *fsgen;
+ struct lpass_macro *pds;
struct clk_hw hw;
};
#define to_wsa_macro(_hw) container_of(_hw, struct wsa_macro, hw)
@@ -2767,6 +2768,14 @@ static int wsa_macro_probe(struct platform_device *pdev)
if (IS_ERR(wsa->fsgen))
return dev_err_probe(dev, PTR_ERR(wsa->fsgen), "unable to get fsgen clock\n");
+ wsa->pds = lpass_macro_pds_init(dev);
+ if (IS_ERR(wsa->pds))
+ return PTR_ERR(wsa->pds);
+
+ ret = devm_add_action_or_reset(dev, lpass_macro_pds_exit_action, wsa->pds);
+ if (ret)
+ return ret;
+
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
return PTR_ERR(base);
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 08/19] ASoC: qcom: lpass-cpu: get the optional codec_mem3 clock
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (6 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 07/19] ASoC: codecs: lpass-wsa-macro: handle the macro & dcodec power domains Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 09/19] ASoC: qcom: lpass: add support for optional WSA interface Neil Armstrong
` (10 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
Some SoCs like SM8650 have a 4th codec LPM block, gated by its own
codec_mem3 clock, which the driver doesn't get.
Get the optional audio_cc_codec_mem3 clock with the other codec DMA clocks.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cpu.c | 4 ++++
sound/soc/qcom/lpass.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 5fb20e284afe..308910744223 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -1072,6 +1072,10 @@ static int of_lpass_cdc_dma_clks_parse(struct device *dev,
if (IS_ERR(data->codec_mem2))
return PTR_ERR(data->codec_mem2);
+ data->codec_mem3 = devm_clk_get_optional(dev, "audio_cc_codec_mem3");
+ if (IS_ERR(data->codec_mem3))
+ return PTR_ERR(data->codec_mem3);
+
data->va_mem0 = devm_clk_get(dev, "aon_cc_va_mem0");
if (IS_ERR(data->va_mem0))
return PTR_ERR(data->va_mem0);
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 68b71039b981..4231466928d4 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -107,6 +107,7 @@ struct lpass_data {
struct clk *codec_mem0;
struct clk *codec_mem1;
struct clk *codec_mem2;
+ struct clk *codec_mem3;
struct clk *va_mem0;
/* MI2S SD lines to use for playback/capture */
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 09/19] ASoC: qcom: lpass: add support for optional WSA interface
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (7 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 08/19] ASoC: qcom: lpass-cpu: get the optional codec_mem3 clock Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 16:49 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 10/19] ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA Neil Armstrong
` (9 subsequent siblings)
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
Newer SoCs have an additional WSA LPAIF used to driver and
additional soundwire bus dedicated to Speakers.
Add the necessary plumbing which is very similar to the
RXTX support used to driver the WCD soundwire bus.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cpu.c | 123 ++++++++++++++++++++++++++
sound/soc/qcom/lpass-lpaif-reg.h | 51 +++++++++--
sound/soc/qcom/lpass-platform.c | 183 +++++++++++++++++++++++++++++++++++++++
sound/soc/qcom/lpass.h | 64 ++++++++++++++
4 files changed, 416 insertions(+), 5 deletions(-)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 308910744223..db7a0752edb2 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -964,6 +964,98 @@ static bool lpass_va_regmap_volatile(struct device *dev, unsigned int reg)
return false;
}
+static bool __lpass_wsa_regmap_accessible(struct device *dev, unsigned int reg, bool rw)
+{
+ struct lpass_data *drvdata = dev_get_drvdata(dev);
+ const struct lpass_variant *v = drvdata->variant;
+ int i;
+
+ for (i = 0; i < v->wsa_irq_ports; ++i) {
+ if (reg == LPAIF_WSA_IRQCLEAR_REG(v, i))
+ return true;
+ if (reg == LPAIF_WSA_IRQEN_REG(v, i))
+ return true;
+ if (reg == LPAIF_WSA_IRQSTAT_REG(v, i))
+ return true;
+ }
+
+ for (i = 0; i < v->wsa_rdma_channels; ++i) {
+ if (reg == LPAIF_CDC_WSA_RDMACTL_REG(v, i, LPASS_CDC_DMA_WSA_RX0))
+ return true;
+ if (reg == LPAIF_CDC_WSA_RDMABASE_REG(v, i, LPASS_CDC_DMA_WSA_RX0))
+ return true;
+ if (reg == LPAIF_CDC_WSA_RDMABUFF_REG(v, i, LPASS_CDC_DMA_WSA_RX0))
+ return true;
+ if (rw == LPASS_REG_READ) {
+ if (reg == LPAIF_CDC_WSA_RDMACURR_REG(v, i, LPASS_CDC_DMA_WSA_RX0))
+ return true;
+ }
+ if (reg == LPAIF_CDC_WSA_RDMAPER_REG(v, i, LPASS_CDC_DMA_WSA_RX0))
+ return true;
+ if (reg == LPAIF_CDC_WSA_RDMA_INTF_REG(v, i, LPASS_CDC_DMA_WSA_RX0))
+ return true;
+ }
+
+ for (i = 0; i < v->wsa_wrdma_channels; ++i) {
+ if (reg == LPAIF_CDC_WSA_WRDMACTL_REG(v, i + v->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0))
+ return true;
+ if (reg == LPAIF_CDC_WSA_WRDMABASE_REG(v, i + v->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0))
+ return true;
+ if (reg == LPAIF_CDC_WSA_WRDMABUFF_REG(v, i + v->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0))
+ return true;
+ if (rw == LPASS_REG_READ) {
+ if (reg == LPAIF_CDC_WSA_WRDMACURR_REG(v, i + v->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0))
+ return true;
+ }
+ if (reg == LPAIF_CDC_WSA_WRDMAPER_REG(v, i + v->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0))
+ return true;
+ if (reg == LPAIF_CDC_WSA_WRDMA_INTF_REG(v, i + v->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0))
+ return true;
+ }
+ return false;
+}
+
+static bool lpass_wsa_regmap_writeable(struct device *dev, unsigned int reg)
+{
+ return __lpass_wsa_regmap_accessible(dev, reg, LPASS_REG_WRITE);
+}
+
+static bool lpass_wsa_regmap_readable(struct device *dev, unsigned int reg)
+{
+ return __lpass_wsa_regmap_accessible(dev, reg, LPASS_REG_READ);
+}
+
+static bool lpass_wsa_regmap_volatile(struct device *dev, unsigned int reg)
+{
+ struct lpass_data *drvdata = dev_get_drvdata(dev);
+ const struct lpass_variant *v = drvdata->variant;
+ int i;
+
+ for (i = 0; i < v->wsa_irq_ports; ++i) {
+ if (reg == LPAIF_WSA_IRQCLEAR_REG(v, i))
+ return true;
+ if (reg == LPAIF_WSA_IRQSTAT_REG(v, i))
+ return true;
+ }
+
+ for (i = 0; i < v->wsa_rdma_channels; ++i)
+ if (reg == LPAIF_CDC_WSA_RDMACURR_REG(v, i, LPASS_CDC_DMA_WSA_RX0))
+ return true;
+
+ for (i = 0; i < v->wsa_wrdma_channels; ++i)
+ if (reg == LPAIF_CDC_WSA_WRDMACURR_REG(v, i + v->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0))
+ return true;
+
+ return false;
+}
+
static struct regmap_config lpass_rxtx_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
@@ -984,6 +1076,16 @@ static struct regmap_config lpass_va_regmap_config = {
.cache_type = REGCACHE_FLAT,
};
+static struct regmap_config lpass_wsa_regmap_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .writeable_reg = lpass_wsa_regmap_writeable,
+ .readable_reg = lpass_wsa_regmap_readable,
+ .volatile_reg = lpass_wsa_regmap_volatile,
+ .cache_type = REGCACHE_FLAT,
+};
+
static unsigned int of_lpass_cpu_parse_sd_lines(struct device *dev,
struct device_node *node,
const char *name)
@@ -1046,6 +1148,8 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
data->hdmi_port_enable = 1;
} else if (is_cdc_dma_port(id)) {
data->codec_dma_enable = 1;
+ if (is_wsa_cdc_dma_port(id))
+ data->wsa_enable = 1;
} else {
data->mi2s_playback_sd_mode[id] =
of_lpass_cpu_parse_sd_lines(dev, node,
@@ -1125,6 +1229,13 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
if (IS_ERR(drvdata->va_lpaif))
return PTR_ERR(drvdata->va_lpaif);
+ if (drvdata->wsa_enable) {
+ drvdata->wsa_lpaif =
+ devm_platform_ioremap_resource_byname(pdev, "lpass-wsa-lpaif");
+ if (IS_ERR(drvdata->wsa_lpaif))
+ return PTR_ERR(drvdata->wsa_lpaif);
+ }
+
lpass_rxtx_regmap_config.max_register = LPAIF_CDC_RXTX_WRDMAPER_REG(variant,
variant->rxtx_wrdma_channels +
variant->rxtx_wrdma_channel_start, LPASS_CDC_DMA_TX3);
@@ -1143,6 +1254,18 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
if (IS_ERR(drvdata->va_lpaif_map))
return PTR_ERR(drvdata->va_lpaif_map);
+ if (drvdata->wsa_enable) {
+ lpass_wsa_regmap_config.max_register = LPAIF_CDC_WSA_WRDMAPER_REG(variant,
+ variant->wsa_wrdma_channels +
+ variant->wsa_wrdma_channel_start,
+ LPASS_CDC_DMA_WSA_TX0);
+
+ drvdata->wsa_lpaif_map = devm_regmap_init_mmio(dev, drvdata->wsa_lpaif,
+ &lpass_wsa_regmap_config);
+ if (IS_ERR(drvdata->wsa_lpaif_map))
+ return PTR_ERR(drvdata->wsa_lpaif_map);
+ }
+
ret = of_lpass_cdc_dma_clks_parse(dev, drvdata);
if (ret) {
dev_err(dev, "failed to get cdc dma clocks %d\n", ret);
diff --git a/sound/soc/qcom/lpass-lpaif-reg.h b/sound/soc/qcom/lpass-lpaif-reg.h
index 6d9d9d1f6a4d..faea5a0ce5ea 100644
--- a/sound/soc/qcom/lpass-lpaif-reg.h
+++ b/sound/soc/qcom/lpass-lpaif-reg.h
@@ -82,6 +82,14 @@
#define LPAIF_RXTX_IRQSTAT_REG(v, port) LPAIF_RXTX_IRQ_REG_ADDR(v, 0x4, port)
#define LPAIF_RXTX_IRQCLEAR_REG(v, port) LPAIF_RXTX_IRQ_REG_ADDR(v, 0xC, port)
+/* LPAIF WSA IRQ */
+#define LPAIF_WSA_IRQ_REG_ADDR(v, addr, port) \
+ (v->wsa_irq_reg_base + (addr) + v->wsa_irq_reg_stride * (port))
+
+#define LPAIF_WSA_IRQEN_REG(v, port) LPAIF_WSA_IRQ_REG_ADDR(v, 0x0, port)
+#define LPAIF_WSA_IRQSTAT_REG(v, port) LPAIF_WSA_IRQ_REG_ADDR(v, 0x4, port)
+#define LPAIF_WSA_IRQCLEAR_REG(v, port) LPAIF_WSA_IRQ_REG_ADDR(v, 0xC, port)
+
/* LPAIF VA IRQ */
#define LPAIF_VA_IRQ_REG_ADDR(v, addr, port) \
(v->va_irq_reg_base + (addr) + v->va_irq_reg_stride * (port))
@@ -182,7 +190,9 @@
#define LPAIF_CDC_RDMA_REG_ADDR(v, addr, chan, dai_id) \
(is_rxtx_cdc_dma_port(dai_id) ? \
(v->rxtx_rdma_reg_base + (addr) + v->rxtx_rdma_reg_stride * (chan)) : \
- (v->va_rdma_reg_base + (addr) + v->va_rdma_reg_stride * (chan)))
+ (is_wsa_cdc_dma_port(dai_id) ? \
+ (v->wsa_rdma_reg_base + (addr) + v->wsa_rdma_reg_stride * (chan)) : \
+ (v->va_rdma_reg_base + (addr) + v->va_rdma_reg_stride * (chan))))
#define LPAIF_CDC_RXTX_RDMACTL_REG(v, chan, dai_id) \
LPAIF_CDC_RDMA_REG_ADDR(v, 0x00, (chan), dai_id)
@@ -205,12 +215,28 @@
#define LPAIF_CDC_VA_RDMA_INTF_REG(v, chan, dai_id) \
LPAIF_CDC_RDMA_REG_ADDR(v, 0x50, (chan), dai_id)
+#define LPAIF_CDC_WSA_RDMACTL_REG(v, chan, dai_id) \
+ LPAIF_CDC_RDMA_REG_ADDR(v, 0x00, (chan), dai_id)
+#define LPAIF_CDC_WSA_RDMABASE_REG(v, chan, dai_id) \
+ LPAIF_CDC_RDMA_REG_ADDR(v, 0x04, (chan), dai_id)
+#define LPAIF_CDC_WSA_RDMABUFF_REG(v, chan, dai_id) \
+ LPAIF_CDC_RDMA_REG_ADDR(v, 0x08, (chan), dai_id)
+#define LPAIF_CDC_WSA_RDMACURR_REG(v, chan, dai_id) \
+ LPAIF_CDC_RDMA_REG_ADDR(v, 0x0C, (chan), dai_id)
+#define LPAIF_CDC_WSA_RDMAPER_REG(v, chan, dai_id) \
+ LPAIF_CDC_RDMA_REG_ADDR(v, 0x10, (chan), dai_id)
+#define LPAIF_CDC_WSA_RDMA_INTF_REG(v, chan, dai_id) \
+ LPAIF_CDC_RDMA_REG_ADDR(v, 0x50, (chan), dai_id)
+
#define LPAIF_CDC_WRDMA_REG_ADDR(v, addr, chan, dai_id) \
(is_rxtx_cdc_dma_port(dai_id) ? \
(v->rxtx_wrdma_reg_base + (addr) + \
v->rxtx_wrdma_reg_stride * (chan - v->rxtx_wrdma_channel_start)) : \
- (v->va_wrdma_reg_base + (addr) + \
- v->va_wrdma_reg_stride * (chan - v->va_wrdma_channel_start)))
+ (is_wsa_cdc_dma_port(dai_id) ? \
+ (v->wsa_wrdma_reg_base + (addr) + \
+ v->wsa_wrdma_reg_stride * (chan - v->wsa_wrdma_channel_start)) : \
+ (v->va_wrdma_reg_base + (addr) + \
+ v->va_wrdma_reg_stride * (chan - v->va_wrdma_channel_start))))
#define LPAIF_CDC_RXTX_WRDMACTL_REG(v, chan, dai_id) \
LPAIF_CDC_WRDMA_REG_ADDR(v, 0x00, (chan), dai_id)
@@ -238,13 +264,28 @@
#define LPAIF_CDC_VA_WRDMA_INTF_REG(v, chan, dai_id) \
LPAIF_CDC_WRDMA_REG_ADDR(v, 0x50, (chan), dai_id)
+#define LPAIF_CDC_WSA_WRDMACTL_REG(v, chan, dai_id) \
+ LPAIF_CDC_WRDMA_REG_ADDR(v, 0x00, (chan), dai_id)
+#define LPAIF_CDC_WSA_WRDMABASE_REG(v, chan, dai_id) \
+ LPAIF_CDC_WRDMA_REG_ADDR(v, 0x04, (chan), dai_id)
+#define LPAIF_CDC_WSA_WRDMABUFF_REG(v, chan, dai_id) \
+ LPAIF_CDC_WRDMA_REG_ADDR(v, 0x08, (chan), dai_id)
+#define LPAIF_CDC_WSA_WRDMACURR_REG(v, chan, dai_id) \
+ LPAIF_CDC_WRDMA_REG_ADDR(v, 0x0C, (chan), dai_id)
+#define LPAIF_CDC_WSA_WRDMAPER_REG(v, chan, dai_id) \
+ LPAIF_CDC_WRDMA_REG_ADDR(v, 0x10, (chan), dai_id)
+#define LPAIF_CDC_WSA_WRDMA_INTF_REG(v, chan, dai_id) \
+ LPAIF_CDC_WRDMA_REG_ADDR(v, 0x50, (chan), dai_id)
+
#define __LPAIF_CDC_RDDMA_REG(v, chan, dir, reg, dai_id) \
(is_rxtx_cdc_dma_port(dai_id) ? LPAIF_CDC_RXTX_RDMA##reg##_REG(v, chan, dai_id) : \
- LPAIF_CDC_VA_RDMA##reg##_REG(v, chan, dai_id))
+ (is_wsa_cdc_dma_port(dai_id) ? LPAIF_CDC_WSA_RDMA##reg##_REG(v, chan, dai_id) : \
+ LPAIF_CDC_VA_RDMA##reg##_REG(v, chan, dai_id)))
#define __LPAIF_CDC_WRDMA_REG(v, chan, dir, reg, dai_id) \
(is_rxtx_cdc_dma_port(dai_id) ? LPAIF_CDC_RXTX_WRDMA##reg##_REG(v, chan, dai_id) : \
- LPAIF_CDC_VA_WRDMA##reg##_REG(v, chan, dai_id))
+ (is_wsa_cdc_dma_port(dai_id) ? LPAIF_CDC_WSA_WRDMA##reg##_REG(v, chan, dai_id) : \
+ LPAIF_CDC_VA_WRDMA##reg##_REG(v, chan, dai_id)))
#define __LPAIF_CDC_DMA_REG(v, chan, dir, reg, dai_id) \
((dir == SNDRV_PCM_STREAM_PLAYBACK) ? \
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 7dfcae4e6fda..902c13c6f2e6 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -97,6 +97,30 @@ static const struct snd_pcm_hardware lpass_platform_va_hardware = {
.fifo_size = 0,
};
+static const struct snd_pcm_hardware lpass_platform_wsa_hardware = {
+ .info = SNDRV_PCM_INFO_MMAP |
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_PAUSE |
+ SNDRV_PCM_INFO_RESUME,
+ .formats = SNDRV_PCM_FMTBIT_S16 |
+ SNDRV_PCM_FMTBIT_S24 |
+ SNDRV_PCM_FMTBIT_S32,
+ .rates = SNDRV_PCM_RATE_8000_192000,
+ .rate_min = 8000,
+ .rate_max = 192000,
+ .channels_min = 1,
+ .channels_max = 8,
+ .buffer_bytes_max = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE,
+ .period_bytes_max = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE /
+ LPASS_PLATFORM_PERIODS,
+ .period_bytes_min = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE /
+ LPASS_PLATFORM_PERIODS,
+ .periods_min = LPASS_PLATFORM_PERIODS,
+ .periods_max = LPASS_PLATFORM_PERIODS,
+ .fifo_size = 0,
+};
+
static int lpass_platform_alloc_rxtx_dmactl_fields(struct device *dev,
struct regmap *map)
{
@@ -141,6 +165,33 @@ static int lpass_platform_alloc_va_dmactl_fields(struct device *dev,
&v->va_wrdma_intf, LPASS_CDC_DMA_REGISTER_FIELDS_MAX);
}
+static int lpass_platform_alloc_wsa_dmactl_fields(struct device *dev,
+ struct regmap *map)
+{
+ struct lpass_data *drvdata = dev_get_drvdata(dev);
+ const struct lpass_variant *v = drvdata->variant;
+ struct lpaif_dmactl *rd_dmactl, *wr_dmactl;
+ int rval;
+
+ rd_dmactl = devm_kzalloc(dev, sizeof(*rd_dmactl), GFP_KERNEL);
+ if (!rd_dmactl)
+ return -ENOMEM;
+
+ wr_dmactl = devm_kzalloc(dev, sizeof(*wr_dmactl), GFP_KERNEL);
+ if (!wr_dmactl)
+ return -ENOMEM;
+
+ drvdata->wsa_rd_dmactl = rd_dmactl;
+ drvdata->wsa_wr_dmactl = wr_dmactl;
+
+ rval = devm_regmap_field_bulk_alloc(dev, map, &rd_dmactl->intf,
+ &v->wsa_rdma_intf, LPASS_CDC_DMA_REGISTER_FIELDS_MAX);
+ if (rval)
+ return rval;
+
+ return devm_regmap_field_bulk_alloc(dev, map, &wr_dmactl->intf,
+ &v->wsa_wrdma_intf, LPASS_CDC_DMA_REGISTER_FIELDS_MAX);
+}
static int lpass_platform_alloc_dmactl_fields(struct device *dev,
struct regmap *map)
@@ -235,6 +286,11 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
map = drvdata->va_lpaif_map;
drvdata->va_substream[dma_ch] = substream;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ map = drvdata->wsa_lpaif_map;
+ drvdata->wsa_substream[dma_ch] = substream;
+ break;
default:
break;
}
@@ -263,6 +319,12 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
runtime->dma_bytes = lpass_platform_va_hardware.buffer_bytes_max;
snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ snd_soc_set_runtime_hwparams(substream, &lpass_platform_wsa_hardware);
+ runtime->dma_bytes = lpass_platform_wsa_hardware.buffer_bytes_max;
+ snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
+ break;
default:
break;
}
@@ -305,6 +367,10 @@ static int lpass_platform_pcmops_close(struct snd_soc_component *component,
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
drvdata->va_substream[data->dma_ch] = NULL;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ drvdata->wsa_substream[data->dma_ch] = NULL;
+ break;
default:
break;
}
@@ -343,6 +409,12 @@ static struct lpaif_dmactl *__lpass_get_dmactl_handle(const struct snd_pcm_subst
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
dmactl = drvdata->va_wr_dmactl;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ dmactl = drvdata->wsa_rd_dmactl;
+ break;
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ dmactl = drvdata->wsa_wr_dmactl;
+ break;
}
return dmactl;
@@ -378,6 +450,12 @@ static int __lpass_get_id(const struct snd_pcm_substream *substream,
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
id = pcm_data->dma_ch - v->va_wrdma_channel_start;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ id = pcm_data->dma_ch;
+ break;
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ id = pcm_data->dma_ch - v->wsa_wrdma_channel_start;
+ break;
}
return id;
@@ -405,6 +483,10 @@ static struct regmap *__lpass_get_regmap_handle(const struct snd_pcm_substream *
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
map = drvdata->va_lpaif_map;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ map = drvdata->wsa_lpaif_map;
+ break;
}
return map;
@@ -489,6 +571,8 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0:
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
break;
default:
dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai_id);
@@ -754,6 +838,21 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
val_mask = LPAIF_IRQ_ALL(ch);
val_irqen = LPAIF_IRQ_ALL(ch);
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ ret = regmap_fields_write(dmactl->dyncclk, id, LPAIF_DMACTL_DYNCLK_ON);
+ if (ret) {
+ dev_err(soc_runtime->dev,
+ "error writing to rdmactl reg field: %d\n", ret);
+ return ret;
+ }
+ reg_irqclr = LPAIF_WSA_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
+ val_irqclr = LPAIF_IRQ_ALL(ch);
+
+ reg_irqen = LPAIF_WSA_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST);
+ val_mask = LPAIF_IRQ_ALL(ch);
+ val_irqen = LPAIF_IRQ_ALL(ch);
+ break;
default:
dev_err(soc_runtime->dev, "%s: invalid %d interface\n", __func__, dai_id);
return -EINVAL;
@@ -830,6 +929,19 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
val_mask = LPAIF_IRQ_ALL(ch);
val_irqen = 0;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ ret = regmap_fields_write(dmactl->dyncclk, id, LPAIF_DMACTL_DYNCLK_OFF);
+ if (ret) {
+ dev_err(soc_runtime->dev,
+ "error writing to rdmactl reg field: %d\n", ret);
+ return ret;
+ }
+
+ reg_irqen = LPAIF_WSA_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST);
+ val_mask = LPAIF_IRQ_ALL(ch);
+ val_irqen = 0;
+ break;
default:
dev_err(soc_runtime->dev, "%s: invalid %d interface\n", __func__, dai_id);
return -EINVAL;
@@ -956,6 +1068,12 @@ static irqreturn_t lpass_dma_interrupt_handler(
reg = LPAIF_VA_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
val = 0;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ map = drvdata->wsa_lpaif_map;
+ reg = LPAIF_WSA_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
+ val = 0;
+ break;
default:
dev_err(soc_runtime->dev, "%s: invalid %d interface\n",
__func__, dai_id);
@@ -1117,6 +1235,35 @@ static irqreturn_t lpass_platform_vaif_irq(int irq, void *data)
return IRQ_HANDLED;
}
+static irqreturn_t lpass_platform_wsaif_irq(int irq, void *data)
+{
+ struct lpass_data *drvdata = data;
+ const struct lpass_variant *v = drvdata->variant;
+ unsigned int irqs;
+ irqreturn_t rv;
+ int chan;
+
+ rv = regmap_read(drvdata->wsa_lpaif_map,
+ LPAIF_WSA_IRQSTAT_REG(v, LPAIF_IRQ_PORT_HOST), &irqs);
+ if (rv) {
+ pr_err("error reading from wsa irqstat reg: %d\n", rv);
+ return IRQ_NONE;
+ }
+
+ /* Handle per channel interrupts */
+ for (chan = 0; chan < LPASS_MAX_CDC_DMA_CHANNELS; chan++) {
+ if (irqs & LPAIF_IRQ_ALL(chan) && drvdata->wsa_substream[chan]) {
+ rv = lpass_dma_interrupt_handler(
+ drvdata->wsa_substream[chan],
+ drvdata, chan, irqs);
+ if (rv != IRQ_HANDLED)
+ return rv;
+ }
+ }
+
+ return IRQ_HANDLED;
+}
+
static int lpass_platform_prealloc_cdc_dma_buffer(struct snd_soc_component *component,
struct snd_pcm *pcm, int dai_id)
{
@@ -1149,6 +1296,14 @@ static int lpass_platform_prealloc_cdc_dma_buffer(struct snd_soc_component *comp
buf->bytes = lpass_platform_va_hardware.buffer_bytes_max;
buf->addr = drvdata->va_cdc_dma_lpm_buf;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ buf->bytes = lpass_platform_wsa_hardware.buffer_bytes_max;
+ buf->addr = drvdata->rxtx_cdc_dma_lpm_buf + LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ break;
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ buf->bytes = lpass_platform_wsa_hardware.buffer_bytes_max;
+ buf->addr = drvdata->rxtx_cdc_dma_lpm_buf + LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 3;
+ break;
default:
break;
}
@@ -1352,6 +1507,34 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
"error initializing va dmactl fields: %d\n", ret);
return ret;
}
+
+ if (drvdata->wsa_enable) {
+ ret = regmap_write(drvdata->wsa_lpaif_map,
+ LPAIF_WSA_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST), 0x0);
+ if (ret) {
+ dev_err(&pdev->dev, "error writing to wsa irqen reg: %d\n", ret);
+ return ret;
+ }
+ drvdata->wsaif_irq = platform_get_irq_byname(pdev, "lpass-irq-wsaif");
+ if (drvdata->wsaif_irq < 0)
+ return drvdata->wsaif_irq;
+
+ ret = devm_request_irq(&pdev->dev, drvdata->wsaif_irq,
+ lpass_platform_wsaif_irq, 0,
+ "lpass-irq-wsaif", drvdata);
+ if (ret) {
+ dev_err(&pdev->dev, "wsa irq request failed: %d\n", ret);
+ return ret;
+ }
+
+ ret = lpass_platform_alloc_wsa_dmactl_fields(&pdev->dev,
+ drvdata->wsa_lpaif_map);
+ if (ret) {
+ dev_err(&pdev->dev,
+ "error initializing wsa dmactl fields: %d\n", ret);
+ return ret;
+ }
+ }
}
if (drvdata->hdmi_port_enable) {
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 4231466928d4..46ae02e67403 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -46,6 +46,8 @@ static inline bool is_cdc_dma_port(int dai_id)
case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
return true;
}
return false;
@@ -61,6 +63,16 @@ static inline bool is_rxtx_cdc_dma_port(int dai_id)
return false;
}
+static inline bool is_wsa_cdc_dma_port(int dai_id)
+{
+ switch (dai_id) {
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ return true;
+ }
+ return false;
+}
+
struct lpaif_i2sctl {
struct regmap_field *loopback;
struct regmap_field *spken;
@@ -119,12 +131,14 @@ struct lpass_data {
int hdmi_port_enable;
int codec_dma_enable;
+ int wsa_enable;
/* low-power audio interface (LPAIF) registers */
void __iomem *lpaif;
void __iomem *hdmiif;
void __iomem *rxtx_lpaif;
void __iomem *va_lpaif;
+ void __iomem *wsa_lpaif;
u32 rxtx_cdc_dma_lpm_buf;
u32 va_cdc_dma_lpm_buf;
@@ -134,12 +148,14 @@ struct lpass_data {
struct regmap *hdmiif_map;
struct regmap *rxtx_lpaif_map;
struct regmap *va_lpaif_map;
+ struct regmap *wsa_lpaif_map;
/* interrupts from the low-power audio interface (LPAIF) */
int lpaif_irq;
int hdmiif_irq;
int rxtxif_irq;
int vaif_irq;
+ int wsaif_irq;
/* SOC specific variations in the LPASS IP integration */
const struct lpass_variant *variant;
@@ -149,12 +165,14 @@ struct lpass_data {
unsigned long hdmi_dma_ch_bit_map;
unsigned long rxtx_dma_ch_bit_map;
unsigned long va_dma_ch_bit_map;
+ unsigned long wsa_dma_ch_bit_map;
/* used it for handling interrupt per dma channel */
struct snd_pcm_substream *substream[LPASS_MAX_DMA_CHANNELS];
struct snd_pcm_substream *hdmi_substream[LPASS_MAX_HDMI_DMA_CHANNELS];
struct snd_pcm_substream *rxtx_substream[LPASS_MAX_CDC_DMA_CHANNELS];
struct snd_pcm_substream *va_substream[LPASS_MAX_CDC_DMA_CHANNELS];
+ struct snd_pcm_substream *wsa_substream[LPASS_MAX_CDC_DMA_CHANNELS];
/* SOC specific clock list */
struct clk_bulk_data *clks;
@@ -170,6 +188,8 @@ struct lpass_data {
struct lpaif_dmactl *rxtx_rd_dmactl;
struct lpaif_dmactl *rxtx_wr_dmactl;
struct lpaif_dmactl *va_wr_dmactl;
+ struct lpaif_dmactl *wsa_rd_dmactl;
+ struct lpaif_dmactl *wsa_wr_dmactl;
/* Regmap fields of HDMI_CTRL registers*/
struct regmap_field *hdmitx_legacy_en;
@@ -215,6 +235,15 @@ struct lpass_variant {
u32 va_wrdma_reg_base;
u32 va_wrdma_reg_stride;
u32 va_wrdma_channels;
+ u32 wsa_irq_reg_base;
+ u32 wsa_irq_reg_stride;
+ u32 wsa_irq_ports;
+ u32 wsa_rdma_reg_base;
+ u32 wsa_rdma_reg_stride;
+ u32 wsa_rdma_channels;
+ u32 wsa_wrdma_reg_base;
+ u32 wsa_wrdma_reg_stride;
+ u32 wsa_wrdma_channels;
u32 i2sctrl_reg_base;
u32 i2sctrl_reg_stride;
u32 i2s_ports;
@@ -369,6 +398,40 @@ struct lpass_variant {
struct reg_field va_wrdma_codec_ch;
struct reg_field va_wrdma_codec_fs_delay;
+ /* CDC WSA RD_DMA */
+ struct reg_field wsa_rdma_intf;
+ struct reg_field wsa_rdma_bursten;
+ struct reg_field wsa_rdma_wpscnt;
+ struct reg_field wsa_rdma_fifowm;
+ struct reg_field wsa_rdma_enable;
+ struct reg_field wsa_rdma_dyncclk;
+ struct reg_field wsa_rdma_burst8;
+ struct reg_field wsa_rdma_burst16;
+ struct reg_field wsa_rdma_dynburst;
+ struct reg_field wsa_rdma_codec_enable;
+ struct reg_field wsa_rdma_codec_pack;
+ struct reg_field wsa_rdma_codec_intf;
+ struct reg_field wsa_rdma_codec_fs_sel;
+ struct reg_field wsa_rdma_codec_ch;
+ struct reg_field wsa_rdma_codec_fs_delay;
+
+ /* CDC WSA WR_DMA */
+ struct reg_field wsa_wrdma_intf;
+ struct reg_field wsa_wrdma_bursten;
+ struct reg_field wsa_wrdma_wpscnt;
+ struct reg_field wsa_wrdma_fifowm;
+ struct reg_field wsa_wrdma_enable;
+ struct reg_field wsa_wrdma_dyncclk;
+ struct reg_field wsa_wrdma_burst8;
+ struct reg_field wsa_wrdma_burst16;
+ struct reg_field wsa_wrdma_dynburst;
+ struct reg_field wsa_wrdma_codec_enable;
+ struct reg_field wsa_wrdma_codec_pack;
+ struct reg_field wsa_wrdma_codec_intf;
+ struct reg_field wsa_wrdma_codec_fs_sel;
+ struct reg_field wsa_wrdma_codec_ch;
+ struct reg_field wsa_wrdma_codec_fs_delay;
+
/**
* on SOCs like APQ8016 the channel control bits start
* at different offset to ipq806x
@@ -377,6 +440,7 @@ struct lpass_variant {
u32 wrdma_channel_start;
u32 rxtx_wrdma_channel_start;
u32 va_wrdma_channel_start;
+ u32 wsa_wrdma_channel_start;
/* SOC specific initialization like clocks */
int (*init)(struct platform_device *pdev);
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 10/19] ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (8 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 09/19] ASoC: qcom: lpass: add support for optional WSA interface Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 16:47 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 11/19] ASoC: qcom: lpass: prepare to handle multiple lpaifs for i2s Neil Armstrong
` (8 subsequent siblings)
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
Add the plumbing for the WSA interface in the lpass codec
DMA driver.
The WSA interface uses the same LPM buffer as RXTX and
need to enable more LPM codec mem clocks.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cdc-dma.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
index 2dc8c75c4bf0..d7f85a4f9d99 100644
--- a/sound/soc/qcom/lpass-cdc-dma.c
+++ b/sound/soc/qcom/lpass-cdc-dma.c
@@ -54,6 +54,14 @@ static void __lpass_get_dmactl_handle(struct snd_pcm_substream *substream, struc
*dmactl = drvdata->va_wr_dmactl;
*id = pcm_data->dma_ch - v->va_wrdma_channel_start;
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ *dmactl = drvdata->wsa_rd_dmactl;
+ *id = pcm_data->dma_ch;
+ break;
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ *dmactl = drvdata->wsa_wr_dmactl;
+ *id = pcm_data->dma_ch - v->wsa_wrdma_channel_start;
+ break;
default:
dev_err(soc_runtime->dev, "invalid dai id for dma ctl: %d\n", dai_id);
break;
@@ -68,49 +76,68 @@ static int __lpass_get_codec_dma_intf_type(int dai_id)
case LPASS_CDC_DMA_RX0:
case LPASS_CDC_DMA_TX0:
case LPASS_CDC_DMA_VA_TX0:
+ case LPASS_CDC_DMA_WSA_TX0:
+ case LPASS_CDC_DMA_WSA_RX0:
ret = LPASS_CDC_DMA_INTERFACE1;
break;
case LPASS_CDC_DMA_RX1:
case LPASS_CDC_DMA_TX1:
case LPASS_CDC_DMA_VA_TX1:
+ case LPASS_CDC_DMA_WSA_RX1:
+ case LPASS_CDC_DMA_WSA_TX1:
ret = LPASS_CDC_DMA_INTERFACE2;
break;
case LPASS_CDC_DMA_RX2:
case LPASS_CDC_DMA_TX2:
case LPASS_CDC_DMA_VA_TX2:
+ case LPASS_CDC_DMA_WSA_RX2:
+ case LPASS_CDC_DMA_WSA_TX2:
ret = LPASS_CDC_DMA_INTERFACE3;
break;
case LPASS_CDC_DMA_RX3:
case LPASS_CDC_DMA_TX3:
case LPASS_CDC_DMA_VA_TX3:
+ case LPASS_CDC_DMA_WSA_RX3:
+ case LPASS_CDC_DMA_WSA_TX3:
ret = LPASS_CDC_DMA_INTERFACE4;
break;
case LPASS_CDC_DMA_RX4:
case LPASS_CDC_DMA_TX4:
case LPASS_CDC_DMA_VA_TX4:
+ case LPASS_CDC_DMA_WSA_RX4:
+ case LPASS_CDC_DMA_WSA_TX4:
ret = LPASS_CDC_DMA_INTERFACE5;
break;
case LPASS_CDC_DMA_RX5:
case LPASS_CDC_DMA_TX5:
case LPASS_CDC_DMA_VA_TX5:
+ case LPASS_CDC_DMA_WSA_RX5:
+ case LPASS_CDC_DMA_WSA_TX5:
ret = LPASS_CDC_DMA_INTERFACE6;
break;
case LPASS_CDC_DMA_RX6:
case LPASS_CDC_DMA_TX6:
case LPASS_CDC_DMA_VA_TX6:
+ case LPASS_CDC_DMA_WSA_RX6:
+ case LPASS_CDC_DMA_WSA_TX6:
ret = LPASS_CDC_DMA_INTERFACE7;
break;
case LPASS_CDC_DMA_RX7:
case LPASS_CDC_DMA_TX7:
case LPASS_CDC_DMA_VA_TX7:
+ case LPASS_CDC_DMA_WSA_RX7:
+ case LPASS_CDC_DMA_WSA_TX7:
ret = LPASS_CDC_DMA_INTERFACE8;
break;
case LPASS_CDC_DMA_RX8:
case LPASS_CDC_DMA_TX8:
case LPASS_CDC_DMA_VA_TX8:
+ case LPASS_CDC_DMA_WSA_RX8:
+ case LPASS_CDC_DMA_WSA_TX8:
ret = LPASS_CDC_DMA_INTERFACE9;
break;
case LPASS_CDC_DMA_RX9:
+ case LPASS_CDC_DMA_WSA_RX9:
ret = LPASS_CDC_DMA_INTERFACE10;
break;
default:
@@ -184,6 +211,11 @@ static int lpass_cdc_dma_daiops_startup(struct snd_pcm_substream *substream,
clk_set_rate(drvdata->va_mem0, CODEC_MEM_HZ_NORMAL);
clk_prepare_enable(drvdata->va_mem0);
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ clk_set_rate(drvdata->codec_mem1, CODEC_MEM_HZ_NORMAL);
+ clk_prepare_enable(drvdata->codec_mem1);
+ break;
default:
dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
break;
@@ -205,6 +237,10 @@ static void lpass_cdc_dma_daiops_shutdown(struct snd_pcm_substream *substream,
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0:
clk_disable_unprepare(drvdata->va_mem0);
break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ clk_disable_unprepare(drvdata->codec_mem1);
+ break;
default:
dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
break;
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 11/19] ASoC: qcom: lpass: prepare to handle multiple lpaifs for i2s
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (9 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 10/19] ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 12/19] ASoC: qcom: lpass: add support for MI2S_SENARY & MI2S_SEPTENARY Neil Armstrong
` (7 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
The MI2S ports are spread amonst the different LPAIFs, but today
we consider all 8 possible MI2S ports are available on the core
LPAIF.
In order to support more complex mappings, start by moving the
lpaif struct into a table so we can probe more LPAIFs for
MI2S ports later on.
And since the MI2S_SENARY & MI2S_SEPTENARY indexes are not
following the Quinary index, we need to add an helper to
map the DAI id to the actual MI2S port index.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-apq8016.c | 9 +-
sound/soc/qcom/lpass-cpu.c | 216 +++++++++++++++++++++++-----------------
sound/soc/qcom/lpass-platform.c | 123 ++++++++++++++---------
sound/soc/qcom/lpass-sc7180.c | 10 +-
sound/soc/qcom/lpass-sc7280.c | 10 +-
sound/soc/qcom/lpass.h | 59 +++++++++--
6 files changed, 272 insertions(+), 155 deletions(-)
diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
index d07ef2bb382a..5f5d49c70e22 100644
--- a/sound/soc/qcom/lpass-apq8016.c
+++ b/sound/soc/qcom/lpass-apq8016.c
@@ -124,16 +124,17 @@ static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata,
int direction, unsigned int dai_id)
{
const struct lpass_variant *v = drvdata->variant;
+ unsigned long *ch_map = &drvdata->lpaif[0].dma_ch_bit_map;
int chan = 0;
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
- chan = find_first_zero_bit(&drvdata->dma_ch_bit_map,
+ chan = find_first_zero_bit(ch_map,
v->rdma_channels);
if (chan >= v->rdma_channels)
return -EBUSY;
} else {
- chan = find_next_zero_bit(&drvdata->dma_ch_bit_map,
+ chan = find_next_zero_bit(ch_map,
v->wrdma_channel_start +
v->wrdma_channels,
v->wrdma_channel_start);
@@ -142,14 +143,14 @@ static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata,
return -EBUSY;
}
- set_bit(chan, &drvdata->dma_ch_bit_map);
+ set_bit(chan, ch_map);
return chan;
}
static int apq8016_lpass_free_dma_channel(struct lpass_data *drvdata, int chan, unsigned int dai_id)
{
- clear_bit(chan, &drvdata->dma_ch_bit_map);
+ clear_bit(chan, &drvdata->lpaif[0].dma_ch_bit_map);
return 0;
}
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index db7a0752edb2..b4620fc99e26 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -70,9 +70,11 @@ static int lpass_cpu_daiops_set_sysclk(struct snd_soc_dai *dai, int clk_id,
unsigned int freq, int dir)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
+ unsigned int port_id = mi2s_port_id(dai->driver->id);
+
int ret;
- ret = clk_set_rate(drvdata->mi2s_osr_clk[dai->driver->id], freq);
+ ret = clk_set_rate(drvdata->mi2s_osr_clk[port_id], freq);
if (ret)
dev_err(dai->dev, "error setting mi2s osrclk to %u: %d\n",
freq, ret);
@@ -84,17 +86,18 @@ static int lpass_cpu_daiops_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
+ unsigned int port_id = mi2s_port_id(dai->driver->id);
int ret;
- ret = clk_prepare_enable(drvdata->mi2s_osr_clk[dai->driver->id]);
+ ret = clk_prepare_enable(drvdata->mi2s_osr_clk[port_id]);
if (ret) {
dev_err(dai->dev, "error in enabling mi2s osr clk: %d\n", ret);
return ret;
}
- ret = clk_prepare(drvdata->mi2s_bit_clk[dai->driver->id]);
+ ret = clk_prepare(drvdata->mi2s_bit_clk[port_id]);
if (ret) {
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
- clk_disable_unprepare(drvdata->mi2s_osr_clk[dai->driver->id]);
+ clk_disable_unprepare(drvdata->mi2s_osr_clk[port_id]);
return ret;
}
return 0;
@@ -104,39 +107,41 @@ static void lpass_cpu_daiops_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
- struct lpaif_i2sctl *i2sctl = drvdata->i2sctl;
- unsigned int id = dai->driver->id;
+ unsigned int port_id = mi2s_port_id(dai->driver->id);
+ struct lpass_lpaif *lpaif = drvdata->mi2s_lpaif[port_id];
+ unsigned int intf = drvdata->mi2s_intf[port_id];
- clk_disable_unprepare(drvdata->mi2s_osr_clk[dai->driver->id]);
+ clk_disable_unprepare(drvdata->mi2s_osr_clk[port_id]);
/*
* Ensure LRCLK is disabled even in device node validation.
* Will not impact if disabled in lpass_cpu_daiops_trigger()
* suspend.
*/
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_DISABLE);
+ regmap_fields_write(lpaif->i2sctl->spken, intf, LPAIF_I2SCTL_SPKEN_DISABLE);
else
- regmap_fields_write(i2sctl->micen, id, LPAIF_I2SCTL_MICEN_DISABLE);
+ regmap_fields_write(lpaif->i2sctl->micen, intf, LPAIF_I2SCTL_MICEN_DISABLE);
/*
* BCLK may not be enabled if lpass_cpu_daiops_prepare is called before
* lpass_cpu_daiops_shutdown. It's paired with the clk_enable in
* lpass_cpu_daiops_prepare.
*/
- if (drvdata->mi2s_was_prepared[dai->driver->id]) {
- drvdata->mi2s_was_prepared[dai->driver->id] = false;
- clk_disable(drvdata->mi2s_bit_clk[dai->driver->id]);
+ if (drvdata->mi2s_was_prepared[port_id]) {
+ drvdata->mi2s_was_prepared[port_id] = false;
+ clk_disable(drvdata->mi2s_bit_clk[port_id]);
}
- clk_unprepare(drvdata->mi2s_bit_clk[dai->driver->id]);
+ clk_unprepare(drvdata->mi2s_bit_clk[port_id]);
}
static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
- struct lpaif_i2sctl *i2sctl = drvdata->i2sctl;
- unsigned int id = dai->driver->id;
+ unsigned int port_id = mi2s_port_id(dai->driver->id);
+ struct lpass_lpaif *lpaif = drvdata->mi2s_lpaif[port_id];
+ unsigned int intf = drvdata->mi2s_intf[port_id];
snd_pcm_format_t format = params_format(params);
unsigned int channels = params_channels(params);
unsigned int rate = params_rate(params);
@@ -150,14 +155,14 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
return bitwidth;
}
- ret = regmap_fields_write(i2sctl->loopback, id,
+ ret = regmap_fields_write(lpaif->i2sctl->loopback, intf,
LPAIF_I2SCTL_LOOPBACK_DISABLE);
if (ret) {
dev_err(dai->dev, "error updating loopback field: %d\n", ret);
return ret;
}
- ret = regmap_fields_write(i2sctl->wssrc, id,
+ ret = regmap_fields_write(lpaif->i2sctl->wssrc, intf,
LPAIF_I2SCTL_WSSRC_INTERNAL);
if (ret) {
dev_err(dai->dev, "error updating wssrc field: %d\n", ret);
@@ -179,16 +184,16 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- ret = regmap_fields_write(i2sctl->bitwidth, id, regval);
+ ret = regmap_fields_write(lpaif->i2sctl->bitwidth, intf, regval);
if (ret) {
dev_err(dai->dev, "error updating bitwidth field: %d\n", ret);
return ret;
}
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- mode = drvdata->mi2s_playback_sd_mode[id];
+ mode = drvdata->mi2s_playback_sd_mode[port_id];
else
- mode = drvdata->mi2s_capture_sd_mode[id];
+ mode = drvdata->mi2s_capture_sd_mode[port_id];
if (!mode) {
dev_err(dai->dev, "no line is assigned\n");
@@ -250,7 +255,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
}
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- ret = regmap_fields_write(i2sctl->spkmode, id,
+ ret = regmap_fields_write(lpaif->i2sctl->spkmode, intf,
LPAIF_I2SCTL_SPKMODE(mode));
if (ret) {
dev_err(dai->dev, "error writing to i2sctl spkr mode: %d\n",
@@ -258,13 +263,13 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
return ret;
}
if (channels >= 2)
- ret = regmap_fields_write(i2sctl->spkmono, id,
+ ret = regmap_fields_write(lpaif->i2sctl->spkmono, intf,
LPAIF_I2SCTL_SPKMONO_STEREO);
else
- ret = regmap_fields_write(i2sctl->spkmono, id,
+ ret = regmap_fields_write(lpaif->i2sctl->spkmono, intf,
LPAIF_I2SCTL_SPKMONO_MONO);
} else {
- ret = regmap_fields_write(i2sctl->micmode, id,
+ ret = regmap_fields_write(lpaif->i2sctl->micmode, intf,
LPAIF_I2SCTL_MICMODE(mode));
if (ret) {
dev_err(dai->dev, "error writing to i2sctl mic mode: %d\n",
@@ -272,10 +277,10 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
return ret;
}
if (channels >= 2)
- ret = regmap_fields_write(i2sctl->micmono, id,
+ ret = regmap_fields_write(lpaif->i2sctl->micmono, intf,
LPAIF_I2SCTL_MICMONO_STEREO);
else
- ret = regmap_fields_write(i2sctl->micmono, id,
+ ret = regmap_fields_write(lpaif->i2sctl->micmono, intf,
LPAIF_I2SCTL_MICMONO_MONO);
}
@@ -285,7 +290,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
return ret;
}
- ret = clk_set_rate(drvdata->mi2s_bit_clk[id],
+ ret = clk_set_rate(drvdata->mi2s_bit_clk[port_id],
rate * bitwidth * 2);
if (ret) {
dev_err(dai->dev, "error setting mi2s bitclk to %u: %d\n",
@@ -300,8 +305,9 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
- struct lpaif_i2sctl *i2sctl = drvdata->i2sctl;
- unsigned int id = dai->driver->id;
+ unsigned int port_id = mi2s_port_id(dai->driver->id);
+ struct lpass_lpaif *lpaif = drvdata->mi2s_lpaif[port_id];
+ unsigned int intf = drvdata->mi2s_intf[port_id];
int ret = -EINVAL;
switch (cmd) {
@@ -321,20 +327,20 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
* it.
*/
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- ret = regmap_fields_write(i2sctl->spken, id,
+ ret = regmap_fields_write(lpaif->i2sctl->spken, intf,
LPAIF_I2SCTL_SPKEN_ENABLE);
} else {
- ret = regmap_fields_write(i2sctl->micen, id,
+ ret = regmap_fields_write(lpaif->i2sctl->micen, intf,
LPAIF_I2SCTL_MICEN_ENABLE);
}
if (ret)
dev_err(dai->dev, "error writing to i2sctl reg: %d\n",
ret);
- ret = clk_enable(drvdata->mi2s_bit_clk[id]);
+ ret = clk_enable(drvdata->mi2s_bit_clk[port_id]);
if (ret) {
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
- clk_disable(drvdata->mi2s_osr_clk[id]);
+ clk_disable(drvdata->mi2s_osr_clk[port_id]);
return ret;
}
break;
@@ -346,17 +352,17 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
* device suspend.
*/
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- ret = regmap_fields_write(i2sctl->spken, id,
+ ret = regmap_fields_write(lpaif->i2sctl->spken, intf,
LPAIF_I2SCTL_SPKEN_DISABLE);
} else {
- ret = regmap_fields_write(i2sctl->micen, id,
+ ret = regmap_fields_write(lpaif->i2sctl->micen, intf,
LPAIF_I2SCTL_MICEN_DISABLE);
}
if (ret)
dev_err(dai->dev, "error writing to i2sctl reg: %d\n",
ret);
- clk_disable(drvdata->mi2s_bit_clk[dai->driver->id]);
+ clk_disable(drvdata->mi2s_bit_clk[port_id]);
break;
}
@@ -368,8 +374,9 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
- struct lpaif_i2sctl *i2sctl = drvdata->i2sctl;
- unsigned int id = dai->driver->id;
+ unsigned int port_id = mi2s_port_id(dai->driver->id);
+ struct lpass_lpaif *lpaif = drvdata->mi2s_lpaif[port_id];
+ unsigned int intf = drvdata->mi2s_intf[port_id];
int ret;
/*
@@ -379,9 +386,9 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream,
* (ex: to drop start up pop noise before capture starts).
*/
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- ret = regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_ENABLE);
+ ret = regmap_fields_write(lpaif->i2sctl->spken, intf, LPAIF_I2SCTL_SPKEN_ENABLE);
else
- ret = regmap_fields_write(i2sctl->micen, id, LPAIF_I2SCTL_MICEN_ENABLE);
+ ret = regmap_fields_write(lpaif->i2sctl->micen, intf, LPAIF_I2SCTL_MICEN_ENABLE);
if (ret) {
dev_err(dai->dev, "error writing to i2sctl reg: %d\n", ret);
@@ -393,13 +400,13 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream,
* be called multiple times. It's paired with the clk_disable in
* lpass_cpu_daiops_shutdown.
*/
- if (!drvdata->mi2s_was_prepared[dai->driver->id]) {
- ret = clk_enable(drvdata->mi2s_bit_clk[id]);
+ if (!drvdata->mi2s_was_prepared[port_id]) {
+ ret = clk_enable(drvdata->mi2s_bit_clk[port_id]);
if (ret) {
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
return ret;
}
- drvdata->mi2s_was_prepared[dai->driver->id] = true;
+ drvdata->mi2s_was_prepared[port_id] = true;
}
return 0;
}
@@ -409,8 +416,9 @@ static int lpass_cpu_daiops_pcm_new(struct snd_soc_pcm_runtime *rtd, struct snd_
int ret;
struct snd_soc_dai_driver *drv = dai->driver;
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
+ unsigned int port_id = mi2s_port_id(dai->id);
- if (drvdata->mi2s_playback_sd_mode[dai->id] == LPAIF_I2SCTL_MODE_QUAD01) {
+ if (drvdata->mi2s_playback_sd_mode[port_id] == LPAIF_I2SCTL_MODE_QUAD01) {
ret = snd_pcm_add_chmap_ctls(rtd->pcm, SNDRV_PCM_STREAM_PLAYBACK,
lpass_quad_chmaps, drv->playback.channels_max, 0,
NULL);
@@ -424,11 +432,13 @@ static int lpass_cpu_daiops_pcm_new(struct snd_soc_pcm_runtime *rtd, struct snd_
static int lpass_cpu_daiops_probe(struct snd_soc_dai *dai)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
+ unsigned int port_id = mi2s_port_id(dai->driver->id);
+ struct lpass_lpaif *lpaif = drvdata->mi2s_lpaif[port_id];
int ret;
/* ensure audio hardware is disabled */
- ret = regmap_write(drvdata->lpaif_map,
- LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), 0);
+ ret = regmap_write(lpaif->map,
+ LPAIF_I2SCTL_REG(drvdata->variant, drvdata->mi2s_intf[port_id]), 0);
if (ret)
dev_err(dai->dev, "error writing to i2sctl reg: %d\n", ret);
@@ -578,7 +588,7 @@ static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg)
return false;
}
-static struct regmap_config lpass_cpu_regmap_config = {
+static const struct regmap_config lpass_cpu_regmap_config = {
.name = "lpass_cpu",
.reg_bits = 32,
.reg_stride = 4,
@@ -1133,9 +1143,12 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
/* Allow all channels by default for backwards compatibility */
for (i = 0; i < data->variant->num_dai; i++) {
- id = data->variant->dai_driver[i].id;
- data->mi2s_playback_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
- data->mi2s_capture_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
+ if (is_mi2s_port_id(data->variant->dai_driver[i].id)) {
+ unsigned int port_id = mi2s_port_id(data->variant->dai_driver[i].id);
+
+ data->mi2s_playback_sd_mode[port_id] = LPAIF_I2SCTL_MODE_8CH;
+ data->mi2s_capture_sd_mode[port_id] = LPAIF_I2SCTL_MODE_8CH;
+ }
}
for_each_child_of_node(dev->of_node, node) {
@@ -1150,13 +1163,18 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
data->codec_dma_enable = 1;
if (is_wsa_cdc_dma_port(id))
data->wsa_enable = 1;
- } else {
- data->mi2s_playback_sd_mode[id] =
+ } else if (is_mi2s_port_id(id)) {
+ unsigned int port_id = mi2s_port_id(id);
+
+ data->mi2s_playback_sd_mode[port_id] =
of_lpass_cpu_parse_sd_lines(dev, node,
"qcom,playback-sd-lines");
- data->mi2s_capture_sd_mode[id] =
+ data->mi2s_capture_sd_mode[port_id] =
of_lpass_cpu_parse_sd_lines(dev, node,
"qcom,capture-sd-lines");
+ } else {
+ dev_err(dev, "invalid dai id: %d\n", id);
+ continue;
}
}
}
@@ -1187,6 +1205,45 @@ static int of_lpass_cdc_dma_clks_parse(struct device *dev,
return 0;
}
+static int lpass_cpu_init_lpaif(struct platform_device *pdev, int idx,
+ const char *reg_name)
+{
+ struct lpass_data *drvdata = platform_get_drvdata(pdev);
+ const struct lpass_variant *v = drvdata->variant;
+ struct lpass_lpaif *lpaif = &drvdata->lpaif[idx];
+ struct regmap_config cfg = lpass_cpu_regmap_config;
+ struct device *dev = &pdev->dev;
+ void __iomem *base;
+ int ret;
+
+ base = devm_platform_ioremap_resource_byname(pdev, reg_name);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ cfg.max_register = LPAIF_WRDMAPER_REG(v, v->wrdma_channels +
+ v->wrdma_channel_start);
+
+ lpaif->drvdata = drvdata;
+ lpaif->map = devm_regmap_init_mmio(dev, base, &cfg);
+ if (IS_ERR(lpaif->map)) {
+ dev_err(dev, "error initializing %s regmap: %ld\n",
+ reg_name, PTR_ERR(lpaif->map));
+ return PTR_ERR(lpaif->map);
+ }
+
+ /* Allocation for i2sctl regmap fields */
+ lpaif->i2sctl = devm_kzalloc(dev, sizeof(*lpaif->i2sctl), GFP_KERNEL);
+ if (!lpaif->i2sctl)
+ return -ENOMEM;
+
+ /* Initialize bitfields for dai I2SCTL register */
+ ret = lpass_cpu_init_i2sctl_bitfields(dev, lpaif->i2sctl, lpaif->map);
+ if (ret)
+ dev_err(dev, "error init %s i2sctl field: %d\n", reg_name, ret);
+
+ return ret;
+}
+
int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
{
struct lpass_data *drvdata;
@@ -1194,7 +1251,7 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
struct resource *res;
const struct lpass_variant *variant;
struct device *dev = &pdev->dev;
- int ret, i, dai_id;
+ int ret, i, port_id;
dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0);
if (dsp_of_node) {
@@ -1283,21 +1340,11 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
drvdata->va_cdc_dma_lpm_buf = res->start;
}
- drvdata->lpaif = devm_platform_ioremap_resource_byname(pdev, "lpass-lpaif");
- if (IS_ERR(drvdata->lpaif))
- return PTR_ERR(drvdata->lpaif);
-
- lpass_cpu_regmap_config.max_register = LPAIF_WRDMAPER_REG(variant,
- variant->wrdma_channels +
- variant->wrdma_channel_start);
+ drvdata->num_lpaif = 1;
- drvdata->lpaif_map = devm_regmap_init_mmio(dev, drvdata->lpaif,
- &lpass_cpu_regmap_config);
- if (IS_ERR(drvdata->lpaif_map)) {
- dev_err(dev, "error initializing regmap: %ld\n",
- PTR_ERR(drvdata->lpaif_map));
- return PTR_ERR(drvdata->lpaif_map);
- }
+ ret = lpass_cpu_init_lpaif(pdev, 0, "lpass-lpaif");
+ if (ret)
+ return ret;
if (drvdata->hdmi_port_enable) {
drvdata->hdmiif = devm_platform_ioremap_resource_byname(pdev, "lpass-hdmiif");
@@ -1324,41 +1371,32 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
}
for (i = 0; i < variant->num_dai; i++) {
- dai_id = variant->dai_driver[i].id;
- if (dai_id == LPASS_DP_RX || is_cdc_dma_port(dai_id))
+ if (!is_mi2s_port_id(variant->dai_driver[i].id))
continue;
- drvdata->mi2s_osr_clk[dai_id] = devm_clk_get_optional(dev,
+ port_id = mi2s_port_id(variant->dai_driver[i].id);
+
+ drvdata->mi2s_lpaif[port_id] = &drvdata->lpaif[0];
+ drvdata->mi2s_intf[port_id] = port_id;
+
+ drvdata->mi2s_osr_clk[port_id] = devm_clk_get_optional(dev,
variant->dai_osr_clk_names[i]);
- drvdata->mi2s_bit_clk[dai_id] = devm_clk_get(dev,
+ drvdata->mi2s_bit_clk[port_id] = devm_clk_get(dev,
variant->dai_bit_clk_names[i]);
- if (IS_ERR(drvdata->mi2s_bit_clk[dai_id])) {
+ if (IS_ERR(drvdata->mi2s_bit_clk[port_id])) {
dev_err(dev,
"error getting %s: %ld\n",
variant->dai_bit_clk_names[i],
- PTR_ERR(drvdata->mi2s_bit_clk[dai_id]));
- return PTR_ERR(drvdata->mi2s_bit_clk[dai_id]);
+ PTR_ERR(drvdata->mi2s_bit_clk[port_id]));
+ return PTR_ERR(drvdata->mi2s_bit_clk[port_id]);
}
- if (drvdata->mi2s_playback_sd_mode[dai_id] ==
+ if (drvdata->mi2s_playback_sd_mode[port_id] ==
LPAIF_I2SCTL_MODE_QUAD01) {
variant->dai_driver[i].playback.channels_min = 4;
variant->dai_driver[i].playback.channels_max = 4;
}
}
- /* Allocation for i2sctl regmap fields */
- drvdata->i2sctl = devm_kzalloc_obj(&pdev->dev, struct lpaif_i2sctl);
- if (!drvdata->i2sctl)
- return -ENOMEM;
-
- /* Initialize bitfields for dai I2SCTL register */
- ret = lpass_cpu_init_i2sctl_bitfields(dev, drvdata->i2sctl,
- drvdata->lpaif_map);
- if (ret) {
- dev_err(dev, "error init i2sctl field: %d\n", ret);
- return ret;
- }
-
if (drvdata->hdmi_port_enable) {
ret = lpass_hdmi_init_bitfields(dev, drvdata->hdmiif_map);
if (ret) {
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 902c13c6f2e6..1e4fd1396b40 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -194,23 +194,26 @@ static int lpass_platform_alloc_wsa_dmactl_fields(struct device *dev,
}
static int lpass_platform_alloc_dmactl_fields(struct device *dev,
- struct regmap *map)
+ struct lpass_lpaif *lpaif)
{
struct lpass_data *drvdata = dev_get_drvdata(dev);
const struct lpass_variant *v = drvdata->variant;
+ struct regmap *map = lpaif->map;
struct lpaif_dmactl *rd_dmactl, *wr_dmactl;
int rval;
- drvdata->rd_dmactl = devm_kzalloc_obj(dev, struct lpaif_dmactl);
- if (drvdata->rd_dmactl == NULL)
+ lpaif->rd_dmactl = devm_kzalloc(dev, sizeof(struct lpaif_dmactl),
+ GFP_KERNEL);
+ if (!lpaif->rd_dmactl)
return -ENOMEM;
- drvdata->wr_dmactl = devm_kzalloc_obj(dev, struct lpaif_dmactl);
- if (drvdata->wr_dmactl == NULL)
+ lpaif->wr_dmactl = devm_kzalloc(dev, sizeof(struct lpaif_dmactl),
+ GFP_KERNEL);
+ if (!lpaif->wr_dmactl)
return -ENOMEM;
- rd_dmactl = drvdata->rd_dmactl;
- wr_dmactl = drvdata->wr_dmactl;
+ rd_dmactl = lpaif->rd_dmactl;
+ wr_dmactl = lpaif->wr_dmactl;
rval = devm_regmap_field_bulk_alloc(dev, map, &rd_dmactl->intf,
&v->rdma_intf, 6);
@@ -250,6 +253,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
struct lpass_pcm_data *data;
struct regmap *map;
unsigned int dai_id = cpu_dai->driver->id;
+ unsigned int port_id;
data = kzalloc_obj(*data);
if (!data)
@@ -270,8 +274,9 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
- map = drvdata->lpaif_map;
- drvdata->substream[dma_ch] = substream;
+ port_id = mi2s_port_id(dai_id);
+ map = drvdata->mi2s_lpaif[port_id]->map;
+ drvdata->mi2s_lpaif[port_id]->substream[dma_ch] = substream;
break;
case LPASS_DP_RX:
map = drvdata->hdmiif_map;
@@ -350,12 +355,14 @@ static int lpass_platform_pcmops_close(struct snd_soc_component *component,
const struct lpass_variant *v = drvdata->variant;
struct lpass_pcm_data *data;
unsigned int dai_id = cpu_dai->driver->id;
+ unsigned int port_id;
data = runtime->private_data;
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
- drvdata->substream[data->dma_ch] = NULL;
+ port_id = mi2s_port_id(dai_id);
+ drvdata->mi2s_lpaif[port_id]->substream[data->dma_ch] = NULL;
break;
case LPASS_DP_RX:
drvdata->hdmi_substream[data->dma_ch] = NULL;
@@ -389,13 +396,15 @@ static struct lpaif_dmactl *__lpass_get_dmactl_handle(const struct snd_pcm_subst
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
struct lpaif_dmactl *dmactl = NULL;
+ unsigned int port_id;
switch (cpu_dai->driver->id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ port_id = mi2s_port_id(cpu_dai->driver->id);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- dmactl = drvdata->rd_dmactl;
+ dmactl = drvdata->mi2s_lpaif[port_id]->rd_dmactl;
else
- dmactl = drvdata->wr_dmactl;
+ dmactl = drvdata->mi2s_lpaif[port_id]->wr_dmactl;
break;
case LPASS_DP_RX:
dmactl = drvdata->hdmi_rd_dmactl;
@@ -468,10 +477,12 @@ static struct regmap *__lpass_get_regmap_handle(const struct snd_pcm_substream *
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
struct regmap *map = NULL;
+ unsigned int port_id;
switch (cpu_dai->driver->id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
- map = drvdata->lpaif_map;
+ port_id = mi2s_port_id(cpu_dai->driver->id);
+ map = drvdata->mi2s_lpaif[port_id]->map;
break;
case LPASS_DP_RX:
map = drvdata->hdmiif_map;
@@ -499,8 +510,6 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
- struct snd_pcm_runtime *rt = substream->runtime;
- struct lpass_pcm_data *pcm_data = rt->private_data;
const struct lpass_variant *v = drvdata->variant;
snd_pcm_format_t format = params_format(params);
unsigned int channels = params_channels(params);
@@ -508,8 +517,8 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
struct lpaif_dmactl *dmactl;
int id;
int bitwidth;
- int ret, dma_port = pcm_data->i2s_port + v->dmactl_audif_start;
unsigned int dai_id = cpu_dai->driver->id;
+ int ret, dma_port;
dmactl = __lpass_get_dmactl_handle(substream, component);
id = __lpass_get_id(substream, component);
@@ -559,6 +568,7 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
+ dma_port = drvdata->mi2s_intf[dai_id] + v->dmactl_audif_start;
ret = regmap_fields_write(dmactl->intf, id,
LPAIF_DMACTL_AUDINTF(dma_port));
if (ret) {
@@ -1038,6 +1048,7 @@ static irqreturn_t lpass_dma_interrupt_handler(
unsigned int reg, val, mask;
struct regmap *map;
unsigned int dai_id = cpu_dai->driver->id;
+ unsigned int port_id;
mask = LPAIF_IRQ_ALL(chan);
switch (dai_id) {
@@ -1053,7 +1064,8 @@ static irqreturn_t lpass_dma_interrupt_handler(
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
- map = drvdata->lpaif_map;
+ port_id = mi2s_port_id(dai_id);
+ map = drvdata->mi2s_lpaif[port_id]->map;
reg = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
val = 0;
break;
@@ -1130,12 +1142,13 @@ static irqreturn_t lpass_dma_interrupt_handler(
static irqreturn_t lpass_platform_lpaif_irq(int irq, void *data)
{
- struct lpass_data *drvdata = data;
+ struct lpass_lpaif *lpaif = data;
+ struct lpass_data *drvdata = lpaif->drvdata;
const struct lpass_variant *v = drvdata->variant;
unsigned int irqs;
int rv, chan;
- rv = regmap_read(drvdata->lpaif_map,
+ rv = regmap_read(lpaif->map,
LPAIF_IRQSTAT_REG(v, LPAIF_IRQ_PORT_HOST), &irqs);
if (rv) {
pr_err("error reading from irqstat reg: %d\n", rv);
@@ -1144,9 +1157,9 @@ static irqreturn_t lpass_platform_lpaif_irq(int irq, void *data)
/* Handle per channel interrupts */
for (chan = 0; chan < LPASS_MAX_DMA_CHANNELS; chan++) {
- if (irqs & LPAIF_IRQ_ALL(chan) && drvdata->substream[chan]) {
+ if (irqs & LPAIF_IRQ_ALL(chan) && lpaif->substream[chan]) {
rv = lpass_dma_interrupt_handler(
- drvdata->substream[chan],
+ lpaif->substream[chan],
drvdata, chan, irqs);
if (rv != IRQ_HANDLED)
return rv;
@@ -1337,6 +1350,7 @@ static int lpass_platform_pcmops_suspend(struct snd_soc_component *component)
{
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
struct regmap *map;
+ int i;
if (drvdata->hdmi_port_enable) {
map = drvdata->hdmiif_map;
@@ -1344,9 +1358,11 @@ static int lpass_platform_pcmops_suspend(struct snd_soc_component *component)
regcache_mark_dirty(map);
}
- map = drvdata->lpaif_map;
- regcache_cache_only(map, true);
- regcache_mark_dirty(map);
+ for (i = 0; i < drvdata->num_lpaif; i++) {
+ map = drvdata->lpaif[i].map;
+ regcache_cache_only(map, true);
+ regcache_mark_dirty(map);
+ }
return 0;
}
@@ -1355,7 +1371,7 @@ static int lpass_platform_pcmops_resume(struct snd_soc_component *component)
{
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
struct regmap *map;
- int ret;
+ int i, ret;
if (drvdata->hdmi_port_enable) {
map = drvdata->hdmiif_map;
@@ -1365,10 +1381,15 @@ static int lpass_platform_pcmops_resume(struct snd_soc_component *component)
return ret;
}
- map = drvdata->lpaif_map;
- regcache_cache_only(map, false);
+ for (i = 0; i < drvdata->num_lpaif; i++) {
+ map = drvdata->lpaif[i].map;
+ regcache_cache_only(map, false);
+ ret = regcache_sync(map);
+ if (ret)
+ return ret;
+ }
- return regcache_sync(map);
+ return 0;
}
static int lpass_platform_copy(struct snd_soc_component *component,
@@ -1423,39 +1444,51 @@ static const struct snd_soc_component_driver lpass_component_driver = {
};
-int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
+static int lpass_platform_init_lpaif(struct platform_device *pdev, int idx,
+ const char *irq_name, unsigned long irqflags)
{
struct lpass_data *drvdata = platform_get_drvdata(pdev);
+ struct lpass_lpaif *lpaif = &drvdata->lpaif[idx];
const struct lpass_variant *v = drvdata->variant;
int ret;
- drvdata->lpaif_irq = platform_get_irq_byname(pdev, "lpass-irq-lpaif");
- if (drvdata->lpaif_irq < 0)
- return drvdata->lpaif_irq;
+ lpaif->irq = platform_get_irq_byname(pdev, irq_name);
+ if (lpaif->irq < 0)
+ return lpaif->irq;
/* ensure audio hardware is disabled */
- ret = regmap_write(drvdata->lpaif_map,
- LPAIF_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST), 0);
+ ret = regmap_write(lpaif->map, LPAIF_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST), 0);
if (ret) {
- dev_err(&pdev->dev, "error writing to irqen reg: %d\n", ret);
+ dev_err(&pdev->dev, "error writing to %s irqen reg: %d\n",
+ irq_name, ret);
return ret;
}
- ret = devm_request_irq(&pdev->dev, drvdata->lpaif_irq,
- lpass_platform_lpaif_irq, IRQF_TRIGGER_RISING,
- "lpass-irq-lpaif", drvdata);
+ ret = devm_request_irq(&pdev->dev, lpaif->irq, lpass_platform_lpaif_irq,
+ irqflags, irq_name, lpaif);
if (ret) {
- dev_err(&pdev->dev, "irq request failed: %d\n", ret);
+ dev_err(&pdev->dev, "%s irq request failed: %d\n", irq_name, ret);
return ret;
}
- ret = lpass_platform_alloc_dmactl_fields(&pdev->dev,
- drvdata->lpaif_map);
- if (ret) {
- dev_err(&pdev->dev,
- "error initializing dmactl fields: %d\n", ret);
+ ret = lpass_platform_alloc_dmactl_fields(&pdev->dev, lpaif);
+ if (ret)
+ dev_err(&pdev->dev, "error initializing %s dmactl fields: %d\n",
+ irq_name, ret);
+
+ return ret;
+}
+
+int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
+{
+ struct lpass_data *drvdata = platform_get_drvdata(pdev);
+ const struct lpass_variant *v = drvdata->variant;
+ int ret;
+
+ ret = lpass_platform_init_lpaif(pdev, 0, "lpass-irq-lpaif",
+ IRQF_TRIGGER_RISING);
+ if (ret)
return ret;
- }
if (drvdata->codec_dma_enable) {
ret = regmap_write(drvdata->rxtx_lpaif_map,
diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c
index e623aee74499..8c727fbfef98 100644
--- a/sound/soc/qcom/lpass-sc7180.c
+++ b/sound/soc/qcom/lpass-sc7180.c
@@ -89,14 +89,16 @@ static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata,
}
set_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
} else {
+ unsigned long *ch_map = &drvdata->lpaif[0].dma_ch_bit_map;
+
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
- chan = find_first_zero_bit(&drvdata->dma_ch_bit_map,
+ chan = find_first_zero_bit(ch_map,
v->rdma_channels);
if (chan >= v->rdma_channels)
return -EBUSY;
} else {
- chan = find_next_zero_bit(&drvdata->dma_ch_bit_map,
+ chan = find_next_zero_bit(ch_map,
v->wrdma_channel_start +
v->wrdma_channels,
v->wrdma_channel_start);
@@ -105,7 +107,7 @@ static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata,
return -EBUSY;
}
- set_bit(chan, &drvdata->dma_ch_bit_map);
+ set_bit(chan, ch_map);
}
return chan;
}
@@ -115,7 +117,7 @@ static int sc7180_lpass_free_dma_channel(struct lpass_data *drvdata, int chan, u
if (dai_id == LPASS_DP_RX)
clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
else
- clear_bit(chan, &drvdata->dma_ch_bit_map);
+ clear_bit(chan, &drvdata->lpaif[0].dma_ch_bit_map);
return 0;
}
diff --git a/sound/soc/qcom/lpass-sc7280.c b/sound/soc/qcom/lpass-sc7280.c
index ffcfc0e2a515..6f9094eb8eb4 100644
--- a/sound/soc/qcom/lpass-sc7280.c
+++ b/sound/soc/qcom/lpass-sc7280.c
@@ -111,18 +111,20 @@ static int sc7280_lpass_alloc_dma_channel(struct lpass_data *drvdata,
int direction, unsigned int dai_id)
{
const struct lpass_variant *v = drvdata->variant;
+ unsigned long *ch_map;
int chan = 0;
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ ch_map = &drvdata->lpaif[0].dma_ch_bit_map;
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
- chan = find_first_zero_bit(&drvdata->dma_ch_bit_map,
+ chan = find_first_zero_bit(ch_map,
v->rdma_channels);
if (chan >= v->rdma_channels)
return -EBUSY;
} else {
- chan = find_next_zero_bit(&drvdata->dma_ch_bit_map,
+ chan = find_next_zero_bit(ch_map,
v->wrdma_channel_start +
v->wrdma_channels,
v->wrdma_channel_start);
@@ -130,7 +132,7 @@ static int sc7280_lpass_alloc_dma_channel(struct lpass_data *drvdata,
if (chan >= v->wrdma_channel_start + v->wrdma_channels)
return -EBUSY;
}
- set_bit(chan, &drvdata->dma_ch_bit_map);
+ set_bit(chan, ch_map);
break;
case LPASS_DP_RX:
chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map,
@@ -174,7 +176,7 @@ static int sc7280_lpass_free_dma_channel(struct lpass_data *drvdata, int chan, u
{
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
- clear_bit(chan, &drvdata->dma_ch_bit_map);
+ clear_bit(chan, &drvdata->lpaif[0].dma_ch_bit_map);
break;
case LPASS_DP_RX:
clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 46ae02e67403..78125048b064 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -20,6 +20,7 @@
#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000
#define LPASS_MAX_PORTS (LPASS_MAX_PORT)
#define LPASS_MAX_MI2S_PORTS (8)
+#define LPASS_MAX_LPAIF (1)
#define LPASS_MAX_DMA_CHANNELS (8)
#define LPASS_MAX_HDMI_DMA_CHANNELS (4)
#define LPASS_MAX_CDC_DMA_CHANNELS (8)
@@ -40,6 +41,26 @@
return -EINVAL; \
} while (0)
+static inline bool is_mi2s_port_id(int dai_id)
+{
+ switch (dai_id) {
+ case MI2S_PRIMARY ... MI2S_QUINARY:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static inline int mi2s_port_id(int dai_id)
+{
+ switch (dai_id) {
+ case MI2S_PRIMARY ... MI2S_QUINARY:
+ return dai_id;
+ default:
+ return 0;
+ }
+}
+
static inline bool is_cdc_dma_port(int dai_id)
{
switch (dai_id) {
@@ -104,6 +125,26 @@ struct lpaif_dmactl {
struct regmap_field *codec_fs_delay;
};
+struct lpass_data;
+
+/* LPAIF instance hosting MI2S interfaces with their own DMAs and interrupt */
+struct lpass_lpaif {
+ struct lpass_data *drvdata;
+ struct regmap *map;
+ int irq;
+
+ /* Regmap fields of I2SCTL & DMACTL registers bitfields */
+ struct lpaif_i2sctl *i2sctl;
+ struct lpaif_dmactl *rd_dmactl;
+ struct lpaif_dmactl *wr_dmactl;
+
+ /* bit map to keep track of static channel allocations */
+ unsigned long dma_ch_bit_map;
+
+ /* used it for handling interrupt per dma channel */
+ struct snd_pcm_substream *substream[LPASS_MAX_DMA_CHANNELS];
+};
+
/* Both the CPU DAI and platform drivers will access this data */
struct lpass_data {
@@ -133,8 +174,15 @@ struct lpass_data {
int codec_dma_enable;
int wsa_enable;
+ /* LPAIF instances, 0 is the core "lpass-lpaif" one */
+ struct lpass_lpaif lpaif[LPASS_MAX_LPAIF];
+ int num_lpaif;
+
+ /* LPAIF instance and interface index of each MI2S port */
+ struct lpass_lpaif *mi2s_lpaif[LPASS_MAX_MI2S_PORTS];
+ unsigned int mi2s_intf[LPASS_MAX_MI2S_PORTS];
+
/* low-power audio interface (LPAIF) registers */
- void __iomem *lpaif;
void __iomem *hdmiif;
void __iomem *rxtx_lpaif;
void __iomem *va_lpaif;
@@ -144,14 +192,12 @@ struct lpass_data {
u32 va_cdc_dma_lpm_buf;
/* regmap backed by the low-power audio interface (LPAIF) registers */
- struct regmap *lpaif_map;
struct regmap *hdmiif_map;
struct regmap *rxtx_lpaif_map;
struct regmap *va_lpaif_map;
struct regmap *wsa_lpaif_map;
/* interrupts from the low-power audio interface (LPAIF) */
- int lpaif_irq;
int hdmiif_irq;
int rxtxif_irq;
int vaif_irq;
@@ -161,14 +207,12 @@ struct lpass_data {
const struct lpass_variant *variant;
/* bit map to keep track of static channel allocations */
- unsigned long dma_ch_bit_map;
unsigned long hdmi_dma_ch_bit_map;
unsigned long rxtx_dma_ch_bit_map;
unsigned long va_dma_ch_bit_map;
unsigned long wsa_dma_ch_bit_map;
/* used it for handling interrupt per dma channel */
- struct snd_pcm_substream *substream[LPASS_MAX_DMA_CHANNELS];
struct snd_pcm_substream *hdmi_substream[LPASS_MAX_HDMI_DMA_CHANNELS];
struct snd_pcm_substream *rxtx_substream[LPASS_MAX_CDC_DMA_CHANNELS];
struct snd_pcm_substream *va_substream[LPASS_MAX_CDC_DMA_CHANNELS];
@@ -178,10 +222,7 @@ struct lpass_data {
struct clk_bulk_data *clks;
int num_clks;
- /* Regmap fields of I2SCTL & DMACTL registers bitfields */
- struct lpaif_i2sctl *i2sctl;
- struct lpaif_dmactl *rd_dmactl;
- struct lpaif_dmactl *wr_dmactl;
+ /* Regmap fields of HDMI DMACTL registers bitfields */
struct lpaif_dmactl *hdmi_rd_dmactl;
/* Regmap fields of CODEC DMA CTRL registers */
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 12/19] ASoC: qcom: lpass: add support for MI2S_SENARY & MI2S_SEPTENARY
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (10 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 11/19] ASoC: qcom: lpass: prepare to handle multiple lpaifs for i2s Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 13/19] ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs Neil Armstrong
` (6 subsequent siblings)
18 siblings, 0 replies; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
Now we use the helper to translate the DAI id into a proper
MI2S port index, we can add support for the MI2S_SENARY &
MI2S_SEPTENARY ports.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-platform.c | 14 +++++++++++++-
sound/soc/qcom/lpass.h | 3 +++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 1e4fd1396b40..e2e1a6992871 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -274,6 +274,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
port_id = mi2s_port_id(dai_id);
map = drvdata->mi2s_lpaif[port_id]->map;
drvdata->mi2s_lpaif[port_id]->substream[dma_ch] = substream;
@@ -303,6 +304,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
data->dma_ch = dma_ch;
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
case LPASS_DP_RX:
ret = regmap_write(map, LPAIF_DMACTL_REG(v, dma_ch, dir, data->i2s_port), 0);
if (ret) {
@@ -361,6 +363,7 @@ static int lpass_platform_pcmops_close(struct snd_soc_component *component,
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
port_id = mi2s_port_id(dai_id);
drvdata->mi2s_lpaif[port_id]->substream[data->dma_ch] = NULL;
break;
@@ -400,6 +403,7 @@ static struct lpaif_dmactl *__lpass_get_dmactl_handle(const struct snd_pcm_subst
switch (cpu_dai->driver->id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
port_id = mi2s_port_id(cpu_dai->driver->id);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dmactl = drvdata->mi2s_lpaif[port_id]->rd_dmactl;
@@ -442,6 +446,7 @@ static int __lpass_get_id(const struct snd_pcm_substream *substream,
switch (cpu_dai->driver->id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
id = pcm_data->dma_ch;
else
@@ -481,6 +486,7 @@ static struct regmap *__lpass_get_regmap_handle(const struct snd_pcm_substream *
switch (cpu_dai->driver->id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
port_id = mi2s_port_id(cpu_dai->driver->id);
map = drvdata->mi2s_lpaif[port_id]->map;
break;
@@ -518,6 +524,7 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
int id;
int bitwidth;
unsigned int dai_id = cpu_dai->driver->id;
+ unsigned int port_id;
int ret, dma_port;
dmactl = __lpass_get_dmactl_handle(substream, component);
@@ -568,7 +575,9 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
- dma_port = drvdata->mi2s_intf[dai_id] + v->dmactl_audif_start;
+ case MI2S_SENARY ... MI2S_SEPTENARY:
+ port_id = mi2s_port_id(dai_id);
+ dma_port = drvdata->mi2s_intf[port_id] + v->dmactl_audif_start;
ret = regmap_fields_write(dmactl->intf, id,
LPAIF_DMACTL_AUDINTF(dma_port));
if (ret) {
@@ -811,6 +820,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
reg_irqclr = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
val_irqclr = LPAIF_IRQ_ALL(ch);
@@ -910,6 +920,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
reg_irqen = LPAIF_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST);
val_mask = LPAIF_IRQ_ALL(ch);
val_irqen = 0;
@@ -1064,6 +1075,7 @@ static irqreturn_t lpass_dma_interrupt_handler(
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
port_id = mi2s_port_id(dai_id);
map = drvdata->mi2s_lpaif[port_id]->map;
reg = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 78125048b064..4407996fb145 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -45,6 +45,7 @@ static inline bool is_mi2s_port_id(int dai_id)
{
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
return true;
default:
return false;
@@ -56,6 +57,8 @@ static inline int mi2s_port_id(int dai_id)
switch (dai_id) {
case MI2S_PRIMARY ... MI2S_QUINARY:
return dai_id;
+ case MI2S_SENARY ... MI2S_SEPTENARY:
+ return MI2S_QUINARY + (dai_id - MI2S_SENARY) + 1;
default:
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 13/19] ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (11 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 12/19] ASoC: qcom: lpass: add support for MI2S_SENARY & MI2S_SEPTENARY Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 17:10 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 14/19] ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs Neil Armstrong
` (5 subsequent siblings)
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
Now we have all the plumbing to support multiple MI2S ports
on multiple LPAIFs, add the optional descriptor and parse it
to probe the associated LPAIF when defined in the DT node.
When the descriptor is not provided, the behaviour is kept
as before and the 8 MI2S ports are mapped to the core
LPAIF.
Since an LPAIF address space can only be mapped by the MI2S
handling or the VA/RXTX/WSA handlers, if somehow the DT
declared some invalid setup (I2S port on WSA and WSA codec),
the probe would fail.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cpu.c | 79 +++++++++++++++++++++++++++++++++++++----
sound/soc/qcom/lpass-platform.c | 27 +++++++++++---
sound/soc/qcom/lpass.h | 23 +++++++++++-
3 files changed, 116 insertions(+), 13 deletions(-)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index b4620fc99e26..902ad6554510 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -436,6 +436,12 @@ static int lpass_cpu_daiops_probe(struct snd_soc_dai *dai)
struct lpass_lpaif *lpaif = drvdata->mi2s_lpaif[port_id];
int ret;
+ /* The LPAIF is only initialized if one of its ports is described in DT */
+ if (!lpaif || !lpaif->drvdata) {
+ dev_err(dai->dev, "LPAIF of this port is not enabled\n");
+ return -ENODEV;
+ }
+
/* ensure audio hardware is disabled */
ret = regmap_write(lpaif->map,
LPAIF_I2SCTL_REG(drvdata->variant, drvdata->mi2s_intf[port_id]), 0);
@@ -1172,6 +1178,8 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
data->mi2s_capture_sd_mode[port_id] =
of_lpass_cpu_parse_sd_lines(dev, node,
"qcom,capture-sd-lines");
+
+ set_bit(port_id, &data->lpaif_port_enable);
} else {
dev_err(dev, "invalid dai id: %d\n", id);
continue;
@@ -1214,12 +1222,33 @@ static int lpass_cpu_init_lpaif(struct platform_device *pdev, int idx,
struct regmap_config cfg = lpass_cpu_regmap_config;
struct device *dev = &pdev->dev;
void __iomem *base;
- int ret;
+ int ret, i;
+
+ /* Only probe an LPAIF if one of the port is described in DT */
+ if (v->mi2s_desc) {
+ const struct lpaif_mi2s_desc *desc = &v->mi2s_desc[idx];
+ bool enabled = false;
+
+ for (i = 0; i < desc->port_desc_count; ++i) {
+ unsigned int port_id = mi2s_port_id(desc->port_desc[i].id);
+
+ if (test_bit(port_id, &drvdata->lpaif_port_enable)) {
+ enabled = true;
+ break;
+ }
+ }
+
+ if (!enabled)
+ return 0;
+ }
base = devm_platform_ioremap_resource_byname(pdev, reg_name);
if (IS_ERR(base))
return PTR_ERR(base);
+ /* Keep the legacy regmap name for the core LPAIF */
+ if (idx)
+ cfg.name = reg_name;
cfg.max_register = LPAIF_WRDMAPER_REG(v, v->wrdma_channels +
v->wrdma_channel_start);
@@ -1340,11 +1369,25 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
drvdata->va_cdc_dma_lpm_buf = res->start;
}
- drvdata->num_lpaif = 1;
+ if (variant->mi2s_desc) {
+ if (variant->num_mi2s_desc > LPASS_MAX_LPAIF)
+ return -EINVAL;
+
+ drvdata->num_lpaif = variant->num_mi2s_desc;
- ret = lpass_cpu_init_lpaif(pdev, 0, "lpass-lpaif");
- if (ret)
- return ret;
+ for (i = 0; i < variant->num_mi2s_desc; i++) {
+ ret = lpass_cpu_init_lpaif(pdev, i,
+ variant->mi2s_desc[i].reg_name);
+ if (ret)
+ return ret;
+ }
+ } else {
+ drvdata->num_lpaif = 1;
+
+ ret = lpass_cpu_init_lpaif(pdev, 0, "lpass-lpaif");
+ if (ret)
+ return ret;
+ }
if (drvdata->hdmi_port_enable) {
drvdata->hdmiif = devm_platform_ioremap_resource_byname(pdev, "lpass-hdmiif");
@@ -1376,8 +1419,30 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
port_id = mi2s_port_id(variant->dai_driver[i].id);
- drvdata->mi2s_lpaif[port_id] = &drvdata->lpaif[0];
- drvdata->mi2s_intf[port_id] = port_id;
+ if (variant->mi2s_desc) {
+ unsigned int lpaif_idx, lpaif_port;
+ const struct lpaif_mi2s_desc *desc;
+
+ for (lpaif_idx = 0; lpaif_idx < variant->num_mi2s_desc; ++lpaif_idx) {
+ desc = &variant->mi2s_desc[lpaif_idx];
+
+ for (lpaif_port = 0;
+ lpaif_port < desc->port_desc_count;
+ ++lpaif_port) {
+ if (desc->port_desc[lpaif_port].id !=
+ variant->dai_driver[i].id)
+ continue;
+
+ drvdata->mi2s_lpaif[port_id] =
+ &drvdata->lpaif[lpaif_idx];
+ drvdata->mi2s_intf[port_id] =
+ desc->port_desc[lpaif_port].intf;
+ }
+ }
+ } else {
+ drvdata->mi2s_lpaif[port_id] = &drvdata->lpaif[0];
+ drvdata->mi2s_intf[port_id] = port_id;
+ }
drvdata->mi2s_osr_clk[port_id] = devm_clk_get_optional(dev,
variant->dai_osr_clk_names[i]);
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index e2e1a6992871..5f6fc6063f3a 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -1371,6 +1371,8 @@ static int lpass_platform_pcmops_suspend(struct snd_soc_component *component)
}
for (i = 0; i < drvdata->num_lpaif; i++) {
+ if (!drvdata->lpaif[i].drvdata)
+ continue;
map = drvdata->lpaif[i].map;
regcache_cache_only(map, true);
regcache_mark_dirty(map);
@@ -1394,6 +1396,8 @@ static int lpass_platform_pcmops_resume(struct snd_soc_component *component)
}
for (i = 0; i < drvdata->num_lpaif; i++) {
+ if (!drvdata->lpaif[i].drvdata)
+ continue;
map = drvdata->lpaif[i].map;
regcache_cache_only(map, false);
ret = regcache_sync(map);
@@ -1464,6 +1468,10 @@ static int lpass_platform_init_lpaif(struct platform_device *pdev, int idx,
const struct lpass_variant *v = drvdata->variant;
int ret;
+ /* Only continue if already initialized by lpass-cpu */
+ if (!lpaif->drvdata)
+ return 0;
+
lpaif->irq = platform_get_irq_byname(pdev, irq_name);
if (lpaif->irq < 0)
return lpaif->irq;
@@ -1495,12 +1503,21 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
{
struct lpass_data *drvdata = platform_get_drvdata(pdev);
const struct lpass_variant *v = drvdata->variant;
- int ret;
+ int i, ret;
- ret = lpass_platform_init_lpaif(pdev, 0, "lpass-irq-lpaif",
- IRQF_TRIGGER_RISING);
- if (ret)
- return ret;
+ if (v->mi2s_desc) {
+ for (i = 0; i < v->num_mi2s_desc; i++) {
+ ret = lpass_platform_init_lpaif(pdev, i,
+ v->mi2s_desc[i].irq_name, 0);
+ if (ret)
+ return ret;
+ }
+ } else {
+ ret = lpass_platform_init_lpaif(pdev, 0, "lpass-irq-lpaif",
+ IRQF_TRIGGER_RISING);
+ if (ret)
+ return ret;
+ }
if (drvdata->codec_dma_enable) {
ret = regmap_write(drvdata->rxtx_lpaif_map,
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 4407996fb145..70d64bf3f073 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -20,7 +20,7 @@
#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000
#define LPASS_MAX_PORTS (LPASS_MAX_PORT)
#define LPASS_MAX_MI2S_PORTS (8)
-#define LPASS_MAX_LPAIF (1)
+#define LPASS_MAX_LPAIF (7)
#define LPASS_MAX_DMA_CHANNELS (8)
#define LPASS_MAX_HDMI_DMA_CHANNELS (4)
#define LPASS_MAX_CDC_DMA_CHANNELS (8)
@@ -148,6 +148,19 @@ struct lpass_lpaif {
struct snd_pcm_substream *substream[LPASS_MAX_DMA_CHANNELS];
};
+struct mi2s_port_desc {
+ unsigned int intf; /* LPAIF Interface */
+ unsigned int id; /* DAI ID */
+};
+
+/* Extended LPAIF MI2S layout */
+struct lpaif_mi2s_desc {
+ const char *reg_name;
+ const char *irq_name;
+ struct mi2s_port_desc *port_desc;
+ unsigned int port_desc_count;
+};
+
/* Both the CPU DAI and platform drivers will access this data */
struct lpass_data {
@@ -184,6 +197,7 @@ struct lpass_data {
/* LPAIF instance and interface index of each MI2S port */
struct lpass_lpaif *mi2s_lpaif[LPASS_MAX_MI2S_PORTS];
unsigned int mi2s_intf[LPASS_MAX_MI2S_PORTS];
+ unsigned long lpaif_port_enable;
/* low-power audio interface (LPAIF) registers */
void __iomem *hdmiif;
@@ -498,6 +512,13 @@ struct lpass_variant {
const char * const *dai_osr_clk_names;
const char * const *dai_bit_clk_names;
+ /*
+ * Optional LPAIF MI2S instances layout when all the MI2S
+ * ports are not available on the core LPAIF.
+ */
+ const struct lpaif_mi2s_desc *mi2s_desc;
+ int num_mi2s_desc;
+
/* SOC specific clocks configuration */
const char **clk_name;
int num_clks;
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 14/19] ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (12 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 13/19] ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 17:08 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 15/19] ASoC: qcom: lpass: allocate LPM buffer memory to DAIs Neil Armstrong
` (4 subsequent siblings)
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
When using MI2S on non-core LPAIFs, the hardware can only
fetch data from the LPM buffers and not from DDR memory,
like the RXTX/VA/WSA codec handlers, so add a way to describe
which LPM memory is used for each LPAIF in the MI2S
descriptor.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cpu.c | 1 +
sound/soc/qcom/lpass.h | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 902ad6554510..a83507c2cd55 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -1437,6 +1437,7 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
&drvdata->lpaif[lpaif_idx];
drvdata->mi2s_intf[port_id] =
desc->port_desc[lpaif_port].intf;
+ drvdata->mi2s_lpm[port_id] = desc->lpm_type;
}
}
} else {
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 70d64bf3f073..71f1274dfa89 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -153,10 +153,17 @@ struct mi2s_port_desc {
unsigned int id; /* DAI ID */
};
+enum lpass_lpm {
+ LPASS_LPM_NONE = 0, /* DMA buffer in DDR */
+ LPASS_RXTX_CDC_LPM, /* CODEC LPM */
+ LPASS_VA_CDC_LPM, /* VA LPM */
+};
+
/* Extended LPAIF MI2S layout */
struct lpaif_mi2s_desc {
const char *reg_name;
const char *irq_name;
+ enum lpass_lpm lpm_type;
struct mi2s_port_desc *port_desc;
unsigned int port_desc_count;
};
@@ -197,6 +204,7 @@ struct lpass_data {
/* LPAIF instance and interface index of each MI2S port */
struct lpass_lpaif *mi2s_lpaif[LPASS_MAX_MI2S_PORTS];
unsigned int mi2s_intf[LPASS_MAX_MI2S_PORTS];
+ enum lpass_lpm mi2s_lpm[LPASS_MAX_MI2S_PORTS];
unsigned long lpaif_port_enable;
/* low-power audio interface (LPAIF) registers */
@@ -261,6 +269,19 @@ struct lpass_data {
struct lpass_sstream_ctl *sstream_ctl;
};
+static inline bool is_lpm_mi2s_port(struct lpass_data *drvdata, unsigned int dai_id)
+{
+ unsigned int port_id;
+
+ switch (dai_id) {
+ case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
+ port_id = mi2s_port_id(dai_id);
+ return drvdata->mi2s_lpm[port_id] != LPASS_LPM_NONE;
+ }
+ return false;
+}
+
/* Vairant data per each SOC */
struct lpass_variant {
u32 irq_reg_base;
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 15/19] ASoC: qcom: lpass: allocate LPM buffer memory to DAIs
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (13 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 14/19] ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 17:33 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 16/19] ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory Neil Armstrong
` (3 subsequent siblings)
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
When using MI2S on non-core LPAIFs, the hardware can only
fetch data from the LPM buffers and not from DDR memory,
allocate the DMA buffers in each LPM memory for all users
and drop the static allocation.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cpu.c | 41 ++++++----
sound/soc/qcom/lpass-platform.c | 160 +++++++++++++++++++++++++++++++++++++---
sound/soc/qcom/lpass.h | 10 +++
3 files changed, 183 insertions(+), 28 deletions(-)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index a83507c2cd55..8b005a87d408 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -1169,6 +1169,8 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
data->codec_dma_enable = 1;
if (is_wsa_cdc_dma_port(id))
data->wsa_enable = 1;
+ else if (!is_rxtx_cdc_dma_port(id))
+ data->va_enable = 1;
} else if (is_mi2s_port_id(id)) {
unsigned int port_id = mi2s_port_id(id);
@@ -1351,22 +1353,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
if (IS_ERR(drvdata->wsa_lpaif_map))
return PTR_ERR(drvdata->wsa_lpaif_map);
}
-
- ret = of_lpass_cdc_dma_clks_parse(dev, drvdata);
- if (ret) {
- dev_err(dev, "failed to get cdc dma clocks %d\n", ret);
- return ret;
- }
-
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-rxtx-cdc-dma-lpm");
- if (!res)
- return -EINVAL;
- drvdata->rxtx_cdc_dma_lpm_buf = res->start;
-
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-va-cdc-dma-lpm");
- if (!res)
- return -EINVAL;
- drvdata->va_cdc_dma_lpm_buf = res->start;
}
if (variant->mi2s_desc) {
@@ -1380,6 +1366,9 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
variant->mi2s_desc[i].reg_name);
if (ret)
return ret;
+
+ if (variant->mi2s_desc[i].lpm_type != LPASS_LPM_NONE)
+ drvdata->mi2s_lpm_enable = true;
}
} else {
drvdata->num_lpaif = 1;
@@ -1389,6 +1378,26 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
return ret;
}
+ if (drvdata->codec_dma_enable || drvdata->mi2s_lpm_enable) {
+ ret = of_lpass_cdc_dma_clks_parse(dev, drvdata);
+ if (ret) {
+ dev_err(dev, "failed to get cdc dma clocks %d\n", ret);
+ return ret;
+ }
+
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-rxtx-cdc-dma-lpm");
+ if (!res)
+ return -EINVAL;
+ drvdata->rxtx_cdc_dma_lpm_buf = res->start;
+ drvdata->rxtx_cdc_dma_lpm_size = resource_size(res);
+
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-va-cdc-dma-lpm");
+ if (!res)
+ return -EINVAL;
+ drvdata->va_cdc_dma_lpm_buf = res->start;
+ drvdata->va_cdc_dma_lpm_size = resource_size(res);
+ }
+
if (drvdata->hdmi_port_enable) {
drvdata->hdmiif = devm_platform_ioremap_resource_byname(pdev, "lpass-hdmiif");
if (IS_ERR(drvdata->hdmiif))
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 5f6fc6063f3a..d8726e1c52e6 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -49,6 +49,31 @@ static const struct snd_pcm_hardware lpass_platform_pcm_hardware = {
.fifo_size = 0,
};
+/* MI2S ports with their DMA buffer in a LPM block */
+static const struct snd_pcm_hardware lpass_platform_lpm_mi2s_hardware = {
+ .info = SNDRV_PCM_INFO_MMAP |
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_PAUSE |
+ SNDRV_PCM_INFO_RESUME,
+ .formats = SNDRV_PCM_FMTBIT_S16 |
+ SNDRV_PCM_FMTBIT_S24 |
+ SNDRV_PCM_FMTBIT_S32,
+ .rates = SNDRV_PCM_RATE_8000_192000,
+ .rate_min = 8000,
+ .rate_max = 192000,
+ .channels_min = 1,
+ .channels_max = 8,
+ .buffer_bytes_max = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE,
+ .period_bytes_max = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE /
+ LPASS_PLATFORM_PERIODS,
+ .period_bytes_min = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE /
+ LPASS_PLATFORM_PERIODS,
+ .periods_min = LPASS_PLATFORM_PERIODS,
+ .periods_max = LPASS_PLATFORM_PERIODS,
+ .fifo_size = 0,
+};
+
static const struct snd_pcm_hardware lpass_platform_rxtx_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -312,6 +337,13 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
dev_err(soc_runtime->dev, "error writing to rdmactl reg: %d\n", ret);
return ret;
}
+ if (is_lpm_mi2s_port(drvdata, dai_id)) {
+ snd_soc_set_runtime_hwparams(substream,
+ &lpass_platform_lpm_mi2s_hardware);
+ runtime->dma_bytes = lpass_platform_lpm_mi2s_hardware.buffer_bytes_max;
+ snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
+ break;
+ }
snd_soc_set_runtime_hwparams(substream, &lpass_platform_pcm_hardware);
runtime->dma_bytes = lpass_platform_pcm_hardware.buffer_bytes_max;
break;
@@ -1038,9 +1070,10 @@ static int lpass_platform_pcmops_mmap(struct snd_soc_component *component,
{
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
+ struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
unsigned int dai_id = cpu_dai->driver->id;
- if (is_cdc_dma_port(dai_id))
+ if (is_cdc_dma_port(dai_id) || is_lpm_mi2s_port(drvdata, dai_id))
return lpass_platform_cdc_dma_mmap(substream, vma);
return snd_pcm_lib_default_mmap(substream, vma);
@@ -1289,6 +1322,41 @@ static irqreturn_t lpass_platform_wsaif_irq(int irq, void *data)
return IRQ_HANDLED;
}
+static int lpass_platform_prealloc_lpm_mi2s_buffer(struct snd_soc_component *component,
+ struct snd_pcm *pcm, int dai_id)
+{
+ struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
+ unsigned int port_id = mi2s_port_id(dai_id);
+ struct snd_pcm_substream *substream;
+ struct snd_dma_buffer *buf;
+ u32 addr;
+ int dir;
+
+ if (drvdata->mi2s_lpm[port_id] == LPASS_VA_CDC_LPM)
+ addr = drvdata->va_cdc_dma_lpm_buf;
+ else
+ addr = drvdata->rxtx_cdc_dma_lpm_buf;
+ addr += drvdata->mi2s_lpm_offset[port_id];
+
+ /* Playback and capture buffers are allocated one after the other */
+ for (dir = SNDRV_PCM_STREAM_PLAYBACK; dir <= SNDRV_PCM_STREAM_CAPTURE; dir++) {
+ substream = pcm->streams[dir].substream;
+ if (!substream)
+ continue;
+
+ buf = &substream->dma_buffer;
+ buf->dev.dev = pcm->card->dev;
+ buf->dev.type = SNDRV_DMA_TYPE_CONTINUOUS;
+ buf->private_data = NULL;
+ buf->bytes = lpass_platform_lpm_mi2s_hardware.buffer_bytes_max;
+ buf->addr = addr + dir * LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE;
+ buf->area = (unsigned char * __force)memremap(buf->addr, buf->bytes,
+ MEMREMAP_WC);
+ }
+
+ return 0;
+}
+
static int lpass_platform_prealloc_cdc_dma_buffer(struct snd_soc_component *component,
struct snd_pcm *pcm, int dai_id)
{
@@ -1311,23 +1379,25 @@ static int lpass_platform_prealloc_cdc_dma_buffer(struct snd_soc_component *comp
switch (dai_id) {
case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
buf->bytes = lpass_platform_rxtx_hardware.buffer_bytes_max;
- buf->addr = drvdata->rxtx_cdc_dma_lpm_buf;
+ buf->addr = drvdata->rxtx_cdc_dma_lpm_buf + drvdata->rxtx_lpm_offset;
break;
case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
buf->bytes = lpass_platform_rxtx_hardware.buffer_bytes_max;
- buf->addr = drvdata->rxtx_cdc_dma_lpm_buf + LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE;
+ buf->addr = drvdata->rxtx_cdc_dma_lpm_buf +
+ drvdata->rxtx_lpm_offset + LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE;
break;
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
buf->bytes = lpass_platform_va_hardware.buffer_bytes_max;
- buf->addr = drvdata->va_cdc_dma_lpm_buf;
+ buf->addr = drvdata->va_cdc_dma_lpm_buf + drvdata->va_lpm_offset;
break;
case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
buf->bytes = lpass_platform_wsa_hardware.buffer_bytes_max;
- buf->addr = drvdata->rxtx_cdc_dma_lpm_buf + LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ buf->addr = drvdata->rxtx_cdc_dma_lpm_buf + drvdata->wsa_lpm_offset;
break;
case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
buf->bytes = lpass_platform_wsa_hardware.buffer_bytes_max;
- buf->addr = drvdata->rxtx_cdc_dma_lpm_buf + LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 3;
+ buf->addr = drvdata->rxtx_cdc_dma_lpm_buf +
+ drvdata->wsa_lpm_offset + LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE;
break;
default:
break;
@@ -1343,14 +1413,14 @@ static int lpass_platform_pcm_new(struct snd_soc_component *component,
{
struct snd_pcm *pcm = soc_runtime->pcm;
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
+ struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
unsigned int dai_id = cpu_dai->driver->id;
size_t size = lpass_platform_pcm_hardware.buffer_bytes_max;
- /*
- * Lpass codec dma can access only lpass lpm hardware memory.
- * ioremap is for HLOS to access hardware memory.
- */
+ if (is_lpm_mi2s_port(drvdata, dai_id))
+ return lpass_platform_prealloc_lpm_mi2s_buffer(component, pcm, dai_id);
+
if (is_cdc_dma_port(dai_id))
return lpass_platform_prealloc_cdc_dma_buffer(component, pcm, dai_id);
@@ -1413,6 +1483,7 @@ static int lpass_platform_copy(struct snd_soc_component *component,
unsigned long pos, struct iov_iter *buf,
unsigned long bytes)
{
+ struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
struct snd_pcm_runtime *rt = substream->runtime;
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
@@ -1423,7 +1494,7 @@ static int lpass_platform_copy(struct snd_soc_component *component,
channel * (rt->dma_bytes / rt->channels));
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- if (is_cdc_dma_port(dai_id)) {
+ if (is_cdc_dma_port(dai_id) || is_lpm_mi2s_port(drvdata, dai_id)) {
if (copy_from_iter_toio(dma_buf, bytes, buf) != bytes)
ret = -EFAULT;
} else {
@@ -1431,7 +1502,7 @@ static int lpass_platform_copy(struct snd_soc_component *component,
ret = -EFAULT;
}
} else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
- if (is_cdc_dma_port(dai_id)) {
+ if (is_cdc_dma_port(dai_id) || is_lpm_mi2s_port(drvdata, dai_id)) {
if (copy_to_iter_fromio(dma_buf, bytes, buf) != bytes)
ret = -EFAULT;
} else {
@@ -1460,6 +1531,66 @@ static const struct snd_soc_component_driver lpass_component_driver = {
};
+static int lpass_platform_allocate_lpm(struct lpass_data *drvdata)
+{
+ u32 rxtx_cdc_dma_lpm_remain = drvdata->rxtx_cdc_dma_lpm_size;
+ u32 va_cdc_dma_lpm_remain = drvdata->va_cdc_dma_lpm_size;
+ u32 rxtx_cdc_dma_lpm_offset = 0;
+ u32 va_cdc_dma_lpm_offset = 0;
+ int port_id;
+
+ if (drvdata->codec_dma_enable) {
+ drvdata->rxtx_lpm_offset = rxtx_cdc_dma_lpm_offset;
+ rxtx_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ rxtx_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+
+ if (drvdata->va_enable) {
+ drvdata->va_lpm_offset = va_cdc_dma_lpm_offset;
+ va_cdc_dma_lpm_offset += LPASS_VA_CDC_DMA_LPM_BUFF_SIZE;
+ va_cdc_dma_lpm_remain -= LPASS_VA_CDC_DMA_LPM_BUFF_SIZE;
+ }
+
+ if (drvdata->wsa_enable) {
+ drvdata->wsa_lpm_offset = rxtx_cdc_dma_lpm_offset;
+ rxtx_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ rxtx_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ }
+ }
+
+ if (!drvdata->mi2s_lpm_enable)
+ return 0;
+
+ for (port_id = 0; port_id < LPASS_MAX_MI2S_PORTS; port_id++) {
+ if (!test_bit(port_id, &drvdata->lpaif_port_enable))
+ continue;
+
+ switch (drvdata->mi2s_lpm[port_id]) {
+ case LPASS_RXTX_CDC_LPM:
+ if (rxtx_cdc_dma_lpm_remain < LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2)
+ return -EINVAL;
+ drvdata->mi2s_lpm_offset[port_id] = rxtx_cdc_dma_lpm_offset;
+ rxtx_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ rxtx_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ break;
+ case LPASS_VA_CDC_LPM:
+ /*
+ * VA Codec uses 12KiB, but MI2S uses 2x8KiB for playback
+ * and capture, so it must be large enough to fit
+ */
+ if (va_cdc_dma_lpm_remain < LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2)
+ return -EINVAL;
+ drvdata->mi2s_lpm_offset[port_id] = va_cdc_dma_lpm_offset;
+ va_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ va_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return 0;
+}
+
static int lpass_platform_init_lpaif(struct platform_device *pdev, int idx,
const char *irq_name, unsigned long irqflags)
{
@@ -1625,6 +1756,11 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
return ret;
}
}
+
+ ret = lpass_platform_allocate_lpm(drvdata);
+ if (ret)
+ return ret;
+
return devm_snd_soc_register_component(&pdev->dev,
&lpass_component_driver, NULL, 0);
}
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 71f1274dfa89..3a37bf992645 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -196,6 +196,8 @@ struct lpass_data {
int hdmi_port_enable;
int codec_dma_enable;
int wsa_enable;
+ int va_enable;
+ int mi2s_lpm_enable;
/* LPAIF instances, 0 is the core "lpass-lpaif" one */
struct lpass_lpaif lpaif[LPASS_MAX_LPAIF];
@@ -214,7 +216,15 @@ struct lpass_data {
void __iomem *wsa_lpaif;
u32 rxtx_cdc_dma_lpm_buf;
+ u32 rxtx_cdc_dma_lpm_size;
u32 va_cdc_dma_lpm_buf;
+ u32 va_cdc_dma_lpm_size;
+
+ /* LPM buffer assignment */
+ u32 rxtx_lpm_offset;
+ u32 va_lpm_offset;
+ u32 wsa_lpm_offset;
+ u32 mi2s_lpm_offset[LPASS_MAX_MI2S_PORTS];
/* regmap backed by the low-power audio interface (LPAIF) registers */
struct regmap *hdmiif_map;
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 16/19] ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (14 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 15/19] ASoC: qcom: lpass: allocate LPM buffer memory to DAIs Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 17:28 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 17/19] ASoC: qcom: add SM8650 LPASS CPU driver Neil Armstrong
` (2 subsequent siblings)
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
The LPM memory zone needs different codec_mem clock to be
enabled depending on the DMA buffer offset, add an helper
returning the right clock and add support for the MI2S
ports using a non-core LPAIF.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/lpass-cdc-dma.c | 18 ++++++++++++------
sound/soc/qcom/lpass-cpu.c | 38 ++++++++++++++++++++++++++++++++++++--
sound/soc/qcom/lpass.h | 20 ++++++++++++++++++++
3 files changed, 68 insertions(+), 8 deletions(-)
diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
index d7f85a4f9d99..291c92936043 100644
--- a/sound/soc/qcom/lpass-cdc-dma.c
+++ b/sound/soc/qcom/lpass-cdc-dma.c
@@ -200,12 +200,14 @@ static int lpass_cdc_dma_daiops_startup(struct snd_pcm_substream *substream,
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
+ struct clk *mem_clk;
switch (dai->id) {
case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
- clk_set_rate(drvdata->codec_mem0, CODEC_MEM_HZ_NORMAL);
- clk_prepare_enable(drvdata->codec_mem0);
+ mem_clk = lpass_cdc_dma_mem_clk(drvdata, drvdata->rxtx_lpm_offset);
+ clk_set_rate(mem_clk, CODEC_MEM_HZ_NORMAL);
+ clk_prepare_enable(mem_clk);
break;
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0:
clk_set_rate(drvdata->va_mem0, CODEC_MEM_HZ_NORMAL);
@@ -213,8 +215,9 @@ static int lpass_cdc_dma_daiops_startup(struct snd_pcm_substream *substream,
break;
case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
- clk_set_rate(drvdata->codec_mem1, CODEC_MEM_HZ_NORMAL);
- clk_prepare_enable(drvdata->codec_mem1);
+ mem_clk = lpass_cdc_dma_mem_clk(drvdata, drvdata->wsa_lpm_offset);
+ clk_set_rate(mem_clk, CODEC_MEM_HZ_NORMAL);
+ clk_prepare_enable(mem_clk);
break;
default:
dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
@@ -228,18 +231,21 @@ static void lpass_cdc_dma_daiops_shutdown(struct snd_pcm_substream *substream,
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
+ struct clk *mem_clk;
switch (dai->id) {
case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
- clk_disable_unprepare(drvdata->codec_mem0);
+ mem_clk = lpass_cdc_dma_mem_clk(drvdata, drvdata->rxtx_lpm_offset);
+ clk_disable_unprepare(mem_clk);
break;
case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0:
clk_disable_unprepare(drvdata->va_mem0);
break;
case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
- clk_disable_unprepare(drvdata->codec_mem1);
+ mem_clk = lpass_cdc_dma_mem_clk(drvdata, drvdata->wsa_lpm_offset);
+ clk_disable_unprepare(mem_clk);
break;
default:
dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 8b005a87d408..a68ca4d4d63c 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -82,25 +82,57 @@ static int lpass_cpu_daiops_set_sysclk(struct snd_soc_dai *dai, int clk_id,
return ret;
}
+/* LPM memory clock of the MI2S ports using a non-core LPAIF, NULL otherwise */
+static struct clk *lpass_cpu_mi2s_mem_clk(struct lpass_data *drvdata, unsigned int dai_id)
+{
+ unsigned int port_id = mi2s_port_id(dai_id);
+
+ if (!is_lpm_mi2s_port(drvdata, dai_id))
+ return NULL;
+
+ if (drvdata->mi2s_lpm[port_id] == LPASS_RXTX_CDC_LPM)
+ return lpass_cdc_dma_mem_clk(drvdata, drvdata->mi2s_lpm_offset[port_id]);
+
+ return drvdata->va_mem0;
+}
+
static int lpass_cpu_daiops_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
unsigned int port_id = mi2s_port_id(dai->driver->id);
+ struct clk *mem_clk = lpass_cpu_mi2s_mem_clk(drvdata, dai->driver->id);
int ret;
+ if (mem_clk) {
+ ret = clk_set_rate(mem_clk, LPASS_CODEC_MEM_HZ_NORMAL);
+ if (ret) {
+ dev_err(dai->dev, "error setting lpm mem clk rate: %d\n", ret);
+ return ret;
+ }
+ ret = clk_prepare_enable(mem_clk);
+ if (ret) {
+ dev_err(dai->dev, "error in enabling lpm mem clk: %d\n", ret);
+ return ret;
+ }
+ }
+
ret = clk_prepare_enable(drvdata->mi2s_osr_clk[port_id]);
if (ret) {
dev_err(dai->dev, "error in enabling mi2s osr clk: %d\n", ret);
- return ret;
+ goto err_mem_clk;
}
ret = clk_prepare(drvdata->mi2s_bit_clk[port_id]);
if (ret) {
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
clk_disable_unprepare(drvdata->mi2s_osr_clk[port_id]);
- return ret;
+ goto err_mem_clk;
}
return 0;
+
+err_mem_clk:
+ clk_disable_unprepare(mem_clk);
+ return ret;
}
static void lpass_cpu_daiops_shutdown(struct snd_pcm_substream *substream,
@@ -133,6 +165,8 @@ static void lpass_cpu_daiops_shutdown(struct snd_pcm_substream *substream,
}
clk_unprepare(drvdata->mi2s_bit_clk[port_id]);
+
+ clk_disable_unprepare(lpass_cpu_mi2s_mem_clk(drvdata, dai->driver->id));
}
static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream,
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 3a37bf992645..9e18606ef3b8 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -30,6 +30,8 @@
#define LPASS_CDC_DMA_INTF_FOUR_CHANNEL (0x0F)
#define LPASS_CDC_DMA_INTF_SIX_CHANNEL (0x3F)
#define LPASS_CDC_DMA_INTF_EIGHT_CHANNEL (0xFF)
+#define LPASS_CDC_DMA_LPM_MEM_BLK_SIZE (2 * 8 * 1024)
+#define LPASS_CODEC_MEM_HZ_NORMAL 153600000
#define LPASS_ACTIVE_PDS (4)
#define LPASS_PROXY_PDS (8)
@@ -292,6 +294,24 @@ static inline bool is_lpm_mi2s_port(struct lpass_data *drvdata, unsigned int dai
return false;
}
+static inline struct clk *lpass_cdc_dma_mem_clk(struct lpass_data *drvdata, u32 offset)
+{
+ unsigned int id = offset / LPASS_CDC_DMA_LPM_MEM_BLK_SIZE;
+
+ switch (id) {
+ case 0:
+ return drvdata->codec_mem0;
+ case 1:
+ return drvdata->codec_mem1;
+ case 2:
+ return drvdata->codec_mem2;
+ case 3:
+ return drvdata->codec_mem3;
+ default:
+ return NULL;
+ }
+}
+
/* Vairant data per each SOC */
struct lpass_variant {
u32 irq_reg_base;
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 17/19] ASoC: qcom: add SM8650 LPASS CPU driver
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (15 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 16/19] ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 17:42 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 18/19] ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 19/19] ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu Neil Armstrong
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
Without the ADSP firmware, the SM8650 LPASS audio interfaces must be
driven directly by the application processor.
Add the SM8650 lpass-cpu variant with the Primary, Secondary, Tertiary,
Senary & Septenary MI2S, DP and codec DMA DAIs, their LPAIF instances,
clocks and LPM DMA buffers.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/Kconfig | 12 +
sound/soc/qcom/Makefile | 2 +
sound/soc/qcom/lpass-sm8650.c | 653 ++++++++++++++++++++++++++++++++++++++++++
sound/soc/qcom/lpass.h | 2 +-
4 files changed, 668 insertions(+), 1 deletion(-)
diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig
index f6d810931a9a..d9b626cd1bc9 100644
--- a/sound/soc/qcom/Kconfig
+++ b/sound/soc/qcom/Kconfig
@@ -47,6 +47,18 @@ config SND_SOC_LPASS_SC7280
select SND_SOC_LPASS_HDMI
select SND_SOC_LPASS_CDC_DMA
+config SND_SOC_LPASS_SM8650
+ tristate "Qualcomm SM8650 LPASS CPU DAI support"
+ depends on COMMON_CLK
+ select SND_SOC_LPASS_CPU
+ select SND_SOC_LPASS_PLATFORM
+ select SND_SOC_LPASS_HDMI
+ select SND_SOC_LPASS_CDC_DMA
+ help
+ Support for the MI2S, codec DMA & DP interfaces of the Qualcomm
+ SM8650 LPASS, when driven by Linux instead of the ADSP firmware.
+ Say Y or M if you want to use audio on such SM8650 based boards.
+
config SND_SOC_STORM
tristate "ASoC I2S support for Storm boards"
depends on GPIOLIB
diff --git a/sound/soc/qcom/Makefile b/sound/soc/qcom/Makefile
index cf50b7a24bcf..b2c5f9f387b6 100644
--- a/sound/soc/qcom/Makefile
+++ b/sound/soc/qcom/Makefile
@@ -8,6 +8,7 @@ snd-soc-lpass-ipq806x-y := lpass-ipq806x.o
snd-soc-lpass-apq8016-y := lpass-apq8016.o
snd-soc-lpass-sc7180-y := lpass-sc7180.o
snd-soc-lpass-sc7280-y := lpass-sc7280.o
+snd-soc-lpass-sm8650-y := lpass-sm8650.o
obj-$(CONFIG_SND_SOC_LPASS_CPU) += snd-soc-lpass-cpu.o
obj-$(CONFIG_SND_SOC_LPASS_CDC_DMA) += snd-soc-lpass-cdc-dma.o
@@ -17,6 +18,7 @@ obj-$(CONFIG_SND_SOC_LPASS_IPQ806X) += snd-soc-lpass-ipq806x.o
obj-$(CONFIG_SND_SOC_LPASS_APQ8016) += snd-soc-lpass-apq8016.o
obj-$(CONFIG_SND_SOC_LPASS_SC7180) += snd-soc-lpass-sc7180.o
obj-$(CONFIG_SND_SOC_LPASS_SC7280) += snd-soc-lpass-sc7280.o
+obj-$(CONFIG_SND_SOC_LPASS_SM8650) += snd-soc-lpass-sm8650.o
# Machine
snd-soc-storm-y := storm.o
diff --git a/sound/soc/qcom/lpass-sm8650.c b/sound/soc/qcom/lpass-sm8650.c
new file mode 100644
index 000000000000..53c155e1b639
--- /dev/null
+++ b/sound/soc/qcom/lpass-sm8650.c
@@ -0,0 +1,653 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Based on lpass-sc7280.c:
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2026, Linaro Limited. All rights reserved.
+ */
+
+#include <linux/module.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <linux/pm.h>
+
+#include <dt-bindings/sound/qcom,lpass.h>
+
+#include "lpass-lpaif-reg.h"
+#include "lpass.h"
+
+static struct snd_soc_dai_driver sm8650_lpass_cpu_dai_driver[] = {
+ {
+ .id = MI2S_PRIMARY,
+ .name = "Primary MI2S",
+ .playback = {
+ .stream_name = "Primary Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cpu_dai_ops,
+ }, {
+ .id = MI2S_SECONDARY,
+ .name = "Secondary MI2S",
+ .playback = {
+ .stream_name = "Secondary MI2S Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cpu_dai_ops,
+ }, {
+ .id = MI2S_TERTIARY,
+ .name = "Tertiary MI2S",
+ .playback = {
+ .stream_name = "Tertiary MI2S Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cpu_dai_ops,
+ }, {
+ .id = MI2S_QUATERNARY,
+ .name = "Quaternary MI2S",
+ .playback = {
+ .stream_name = "Quaternary MI2S Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cpu_dai_ops,
+ }, {
+ .id = MI2S_QUINARY,
+ .name = "Quinary MI2S",
+ .playback = {
+ .stream_name = "Quinary MI2S Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cpu_dai_ops,
+ }, {
+ .id = MI2S_SENARY,
+ .name = "Senary MI2S",
+ .playback = {
+ .stream_name = "Senary MI2S Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cpu_dai_ops,
+ }, {
+ .id = MI2S_SEPTENARY,
+ .name = "Septenary MI2S",
+ .playback = {
+ .stream_name = "Septenary MI2S Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cpu_dai_ops,
+ }, {
+ .id = LPASS_DP_RX,
+ .name = "Hdmi",
+ .playback = {
+ .stream_name = "DP Playback",
+ .formats = SNDRV_PCM_FMTBIT_S24,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_hdmi_dai_ops,
+ }, {
+ .id = LPASS_CDC_DMA_RX0,
+ .name = "CDC DMA RX",
+ .playback = {
+ .stream_name = "WCD Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cdc_dma_dai_ops,
+ }, {
+ .id = LPASS_CDC_DMA_TX3,
+ .name = "CDC DMA TX",
+ .capture = {
+ .stream_name = "WCD Capture",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 1,
+ .channels_max = 1,
+ },
+ .ops = &asoc_qcom_lpass_cdc_dma_dai_ops,
+ }, {
+ .id = LPASS_CDC_DMA_VA_TX0,
+ .name = "CDC DMA VA",
+ .capture = {
+ .stream_name = "DMIC Capture",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 4,
+ },
+ .ops = &asoc_qcom_lpass_cdc_dma_dai_ops,
+ }, {
+ .id = LPASS_CDC_DMA_WSA_RX0,
+ .name = "CDC DMA WSA RX",
+ .playback = {
+ .stream_name = "WSA Playback",
+ .formats = SNDRV_PCM_FMTBIT_S16,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ },
+ .ops = &asoc_qcom_lpass_cdc_dma_dai_ops,
+ },
+};
+
+static int sm8650_lpass_alloc_dma_channel(struct lpass_data *drvdata,
+ int direction, unsigned int dai_id)
+{
+ const struct lpass_variant *v = drvdata->variant;
+ unsigned long *ch_map;
+ unsigned int port_id;
+ int chan = 0;
+
+ switch (dai_id) {
+ case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
+ port_id = mi2s_port_id(dai_id);
+ ch_map = &drvdata->mi2s_lpaif[port_id]->dma_ch_bit_map;
+ if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
+ chan = find_first_zero_bit(ch_map, v->rdma_channels);
+
+ if (chan >= v->rdma_channels)
+ return -EBUSY;
+ } else {
+ chan = find_next_zero_bit(ch_map,
+ v->wrdma_channel_start +
+ v->wrdma_channels,
+ v->wrdma_channel_start);
+
+ if (chan >= v->wrdma_channel_start + v->wrdma_channels)
+ return -EBUSY;
+ }
+ set_bit(chan, ch_map);
+ break;
+ case LPASS_DP_RX:
+ chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map,
+ v->hdmi_rdma_channels);
+ if (chan >= v->hdmi_rdma_channels)
+ return -EBUSY;
+ set_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
+ chan = find_first_zero_bit(&drvdata->rxtx_dma_ch_bit_map,
+ v->rxtx_rdma_channels);
+ if (chan >= v->rxtx_rdma_channels)
+ return -EBUSY;
+ set_bit(chan, &drvdata->rxtx_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
+ chan = find_next_zero_bit(&drvdata->rxtx_dma_ch_bit_map,
+ v->rxtx_wrdma_channel_start +
+ v->rxtx_wrdma_channels,
+ v->rxtx_wrdma_channel_start);
+ if (chan >= v->rxtx_wrdma_channel_start + v->rxtx_wrdma_channels)
+ return -EBUSY;
+ set_bit(chan, &drvdata->rxtx_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
+ chan = find_next_zero_bit(&drvdata->va_dma_ch_bit_map,
+ v->va_wrdma_channel_start +
+ v->va_wrdma_channels,
+ v->va_wrdma_channel_start);
+ if (chan >= v->va_wrdma_channel_start + v->va_wrdma_channels)
+ return -EBUSY;
+ set_bit(chan, &drvdata->va_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ chan = find_first_zero_bit(&drvdata->wsa_dma_ch_bit_map,
+ v->wsa_rdma_channels);
+ if (chan >= v->wsa_rdma_channels)
+ return -EBUSY;
+ set_bit(chan, &drvdata->wsa_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ chan = find_next_zero_bit(&drvdata->wsa_dma_ch_bit_map,
+ v->wsa_wrdma_channel_start +
+ v->wsa_wrdma_channels,
+ v->wsa_wrdma_channel_start);
+ if (chan >= v->wsa_wrdma_channel_start + v->wsa_wrdma_channels)
+ return -EBUSY;
+ set_bit(chan, &drvdata->wsa_dma_ch_bit_map);
+ break;
+ default:
+ break;
+ }
+
+ return chan;
+}
+
+static int sm8650_lpass_free_dma_channel(struct lpass_data *drvdata, int chan, unsigned int dai_id)
+{
+ unsigned int port_id;
+
+ switch (dai_id) {
+ case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
+ port_id = mi2s_port_id(dai_id);
+ clear_bit(chan, &drvdata->mi2s_lpaif[port_id]->dma_ch_bit_map);
+ break;
+ case LPASS_DP_RX:
+ clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
+ case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
+ clear_bit(chan, &drvdata->rxtx_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
+ clear_bit(chan, &drvdata->va_dma_ch_bit_map);
+ break;
+ case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
+ case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
+ clear_bit(chan, &drvdata->wsa_dma_ch_bit_map);
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+static int sm8650_lpass_init(struct platform_device *pdev)
+{
+ struct lpass_data *drvdata = platform_get_drvdata(pdev);
+ const struct lpass_variant *variant = drvdata->variant;
+ struct device *dev = &pdev->dev;
+ int ret, i;
+
+ drvdata->clks = devm_kcalloc(dev, variant->num_clks,
+ sizeof(*drvdata->clks), GFP_KERNEL);
+ if (!drvdata->clks)
+ return -ENOMEM;
+
+ drvdata->num_clks = variant->num_clks;
+
+ for (i = 0; i < drvdata->num_clks; i++)
+ drvdata->clks[i].id = variant->clk_name[i];
+
+ ret = devm_clk_bulk_get(dev, drvdata->num_clks, drvdata->clks);
+ if (ret) {
+ dev_err(dev, "Failed to get clocks %d\n", ret);
+ return ret;
+ }
+
+ ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks);
+ if (ret) {
+ dev_err(dev, "sm8650 clk_enable failed\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int sm8650_lpass_exit(struct platform_device *pdev)
+{
+ struct lpass_data *drvdata = platform_get_drvdata(pdev);
+
+ clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
+ return 0;
+}
+
+static int sm8650_lpass_dev_resume(struct device *dev)
+{
+ struct lpass_data *drvdata = dev_get_drvdata(dev);
+
+ return clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks);
+}
+
+static int sm8650_lpass_dev_suspend(struct device *dev)
+{
+ struct lpass_data *drvdata = dev_get_drvdata(dev);
+
+ clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
+ return 0;
+}
+
+static const struct dev_pm_ops sm8650_lpass_pm_ops = {
+ SYSTEM_SLEEP_PM_OPS(sm8650_lpass_dev_suspend, sm8650_lpass_dev_resume)
+};
+
+/* MI2S mapping over LPAIF instances */
+static const struct lpaif_mi2s_desc sm8650_lpaif_mi2s_desc[] = {
+ {
+ .reg_name = "lpass-lpaif",
+ .irq_name = "lpass-irq-lpaif",
+ .lpm_type = LPASS_LPM_NONE,
+ .port_desc = (const struct mi2s_port_desc[]) {
+ { .intf = 0, .id = MI2S_PRIMARY, },
+ { .intf = 1, .id = MI2S_SECONDARY, },
+ },
+ .port_desc_count = 2,
+ },
+ {
+ .reg_name = "lpass-rxtx-lpaif",
+ .irq_name = "lpass-irq-rxtxif",
+ .lpm_type = LPASS_RXTX_CDC_LPM,
+ .port_desc = (const struct mi2s_port_desc[]) {
+ { .intf = 0, .id = MI2S_QUATERNARY, },
+ },
+ .port_desc_count = 1,
+ },
+ {
+ .reg_name = "lpass-va-lpaif",
+ .irq_name = "lpass-irq-vaif",
+ .lpm_type = LPASS_VA_CDC_LPM,
+ .port_desc = (const struct mi2s_port_desc[]) {
+ { .intf = 0, .id = MI2S_QUINARY, },
+ },
+ .port_desc_count = 1,
+ },
+ {
+ .reg_name = "lpass-wsa-lpaif",
+ .irq_name = "lpass-irq-wsaif",
+ .lpm_type = LPASS_RXTX_CDC_LPM,
+ .port_desc = (const struct mi2s_port_desc[]) {
+ { .intf = 0, .id = MI2S_SENARY, },
+ },
+ .port_desc_count = 1,
+ },
+ {
+ .reg_name = "lpass-aud-lpaif",
+ .irq_name = "lpass-irq-audif",
+ .lpm_type = LPASS_RXTX_CDC_LPM,
+ .port_desc = (const struct mi2s_port_desc[]) {
+ { .intf = 0, .id = MI2S_SEPTENARY, },
+ { .intf = 1, .id = MI2S_TERTIARY, },
+ },
+ .port_desc_count = 2,
+ },
+};
+
+static const struct lpass_variant sm8650_data = {
+ .i2sctrl_reg_base = 0x1000,
+ .i2sctrl_reg_stride = 0x1000,
+ .i2s_ports = 3,
+ .irq_reg_base = 0x9000,
+ .irq_reg_stride = 0x1000,
+ .irq_ports = 5,
+ .rdma_reg_base = 0xe000,
+ .rdma_reg_stride = 0x1000,
+ .rdma_channels = 3,
+ .rxtx_rdma_reg_base = 0xe000,
+ .rxtx_rdma_reg_stride = 0x1000,
+ .rxtx_rdma_channels = 5,
+ .wsa_rdma_reg_base = 0xe000,
+ .wsa_rdma_reg_stride = 0x1000,
+ .wsa_rdma_channels = 5,
+ .hdmi_rdma_reg_base = 0x64000,
+ .hdmi_rdma_reg_stride = 0x1000,
+ .hdmi_rdma_channels = 1,
+ .dmactl_audif_start = 1,
+ .wrdma_reg_base = 0x1a000,
+ .wrdma_reg_stride = 0x1000,
+ .wrdma_channel_start = 5,
+ .wrdma_channels = 3,
+ .rxtx_irq_reg_base = 0x9000,
+ .rxtx_irq_reg_stride = 0x1000,
+ .rxtx_irq_ports = 5,
+ .rxtx_wrdma_reg_base = 0x1a000,
+ .rxtx_wrdma_reg_stride = 0x1000,
+ .rxtx_wrdma_channel_start = 5,
+ .rxtx_wrdma_channels = 4,
+ .va_wrdma_reg_base = 0x1a000,
+ .va_wrdma_reg_stride = 0x1000,
+ .va_wrdma_channel_start = 5,
+ .va_wrdma_channels = 3,
+ .va_irq_reg_base = 0x9000,
+ .va_irq_reg_stride = 0x1000,
+ .va_irq_ports = 5,
+ .wsa_irq_reg_base = 0x9000,
+ .wsa_irq_reg_stride = 0x1000,
+ .wsa_irq_ports = 5,
+ .wsa_wrdma_reg_base = 0x1a000,
+ .wsa_wrdma_reg_stride = 0x1000,
+ .wsa_wrdma_channel_start = 5,
+ .wsa_wrdma_channels = 4,
+
+ .loopback = REG_FIELD_ID(0x1000, 17, 17, 3, 0x1000),
+ .spken = REG_FIELD_ID(0x1000, 16, 16, 3, 0x1000),
+ .spkmode = REG_FIELD_ID(0x1000, 11, 15, 3, 0x1000),
+ .spkmono = REG_FIELD_ID(0x1000, 10, 10, 3, 0x1000),
+ .micen = REG_FIELD_ID(0x1000, 9, 9, 3, 0x1000),
+ .micmode = REG_FIELD_ID(0x1000, 4, 8, 3, 0x1000),
+ .micmono = REG_FIELD_ID(0x1000, 3, 3, 3, 0x1000),
+ .wssrc = REG_FIELD_ID(0x1000, 2, 2, 3, 0x1000),
+ .bitwidth = REG_FIELD_ID(0x1000, 0, 1, 3, 0x1000),
+
+ .rdma_dyncclk = REG_FIELD_ID(0xe000, 21, 21, 3, 0x1000),
+ .rdma_bursten = REG_FIELD_ID(0xe000, 20, 20, 3, 0x1000),
+ .rdma_wpscnt = REG_FIELD_ID(0xe000, 16, 19, 3, 0x1000),
+ .rdma_intf = REG_FIELD_ID(0xe000, 12, 15, 3, 0x1000),
+ .rdma_fifowm = REG_FIELD_ID(0xe000, 1, 5, 3, 0x1000),
+ .rdma_enable = REG_FIELD_ID(0xe000, 0, 0, 3, 0x1000),
+
+ .wrdma_dyncclk = REG_FIELD_ID(0x1a000, 22, 22, 3, 0x1000),
+ .wrdma_bursten = REG_FIELD_ID(0x1a000, 21, 21, 3, 0x1000),
+ .wrdma_wpscnt = REG_FIELD_ID(0x1a000, 17, 20, 3, 0x1000),
+ .wrdma_intf = REG_FIELD_ID(0x1a000, 12, 16, 3, 0x1000),
+ .wrdma_fifowm = REG_FIELD_ID(0x1a000, 1, 5, 3, 0x1000),
+ .wrdma_enable = REG_FIELD_ID(0x1a000, 0, 0, 3, 0x1000),
+
+ .rxtx_rdma_dyncclk = REG_FIELD_ID(0xe000, 21, 21, 10, 0x1000),
+ .rxtx_rdma_bursten = REG_FIELD_ID(0xe000, 20, 20, 10, 0x1000),
+ .rxtx_rdma_wpscnt = REG_FIELD_ID(0xe000, 16, 19, 10, 0x1000),
+ .rxtx_rdma_intf = REG_FIELD_ID(0xe000, 12, 15, 10, 0x1000),
+ .rxtx_rdma_fifowm = REG_FIELD_ID(0xe000, 1, 11, 10, 0x1000),
+ .rxtx_rdma_enable = REG_FIELD_ID(0xe000, 0, 0, 10, 0x1000),
+
+ .rxtx_rdma_codec_enable = REG_FIELD_ID(0xe050, 30, 30, 10, 0x1000),
+ .rxtx_rdma_codec_pack = REG_FIELD_ID(0xe050, 29, 29, 10, 0x1000),
+ .rxtx_rdma_codec_fs_sel = REG_FIELD_ID(0xe050, 25, 27, 10, 0x1000),
+ .rxtx_rdma_codec_fs_delay = REG_FIELD_ID(0xe050, 21, 24, 10, 0x1000),
+ .rxtx_rdma_codec_intf = REG_FIELD_ID(0xe050, 16, 19, 10, 0x1000),
+ .rxtx_rdma_codec_ch = REG_FIELD_ID(0xe050, 0, 7, 10, 0x1000),
+
+ .rxtx_wrdma_dyncclk = REG_FIELD_ID(0x1a000, 22, 22, 7, 0x1000),
+ .rxtx_wrdma_bursten = REG_FIELD_ID(0x1a000, 21, 21, 7, 0x1000),
+ .rxtx_wrdma_wpscnt = REG_FIELD_ID(0x1a000, 17, 20, 7, 0x1000),
+ .rxtx_wrdma_intf = REG_FIELD_ID(0x1a000, 12, 16, 7, 0x1000),
+ .rxtx_wrdma_fifowm = REG_FIELD_ID(0x1a000, 1, 11, 7, 0x1000),
+ .rxtx_wrdma_enable = REG_FIELD_ID(0x1a000, 0, 0, 7, 0x1000),
+
+ .rxtx_wrdma_codec_enable = REG_FIELD_ID(0x1a050, 30, 30, 7, 0x1000),
+ .rxtx_wrdma_codec_pack = REG_FIELD_ID(0x1a050, 29, 29, 7, 0x1000),
+ .rxtx_wrdma_codec_fs_sel = REG_FIELD_ID(0x1a050, 25, 27, 7, 0x1000),
+ .rxtx_wrdma_codec_fs_delay = REG_FIELD_ID(0x1a050, 21, 24, 7, 0x1000),
+ .rxtx_wrdma_codec_intf = REG_FIELD_ID(0x1a050, 16, 19, 7, 0x1000),
+ .rxtx_wrdma_codec_ch = REG_FIELD_ID(0x1a050, 0, 7, 7, 0x1000),
+
+ .va_wrdma_dyncclk = REG_FIELD_ID(0x1a000, 22, 22, 3, 0x1000),
+ .va_wrdma_bursten = REG_FIELD_ID(0x1a000, 21, 21, 3, 0x1000),
+ .va_wrdma_wpscnt = REG_FIELD_ID(0x1a000, 17, 20, 3, 0x1000),
+ .va_wrdma_intf = REG_FIELD_ID(0x1a000, 12, 16, 3, 0x1000),
+ .va_wrdma_fifowm = REG_FIELD_ID(0x1a000, 1, 11, 3, 0x1000),
+ .va_wrdma_enable = REG_FIELD_ID(0x1a000, 0, 0, 3, 0x1000),
+
+ .va_wrdma_codec_enable = REG_FIELD_ID(0x1a050, 30, 30, 3, 0x1000),
+ .va_wrdma_codec_pack = REG_FIELD_ID(0x1a050, 29, 29, 3, 0x1000),
+ .va_wrdma_codec_fs_sel = REG_FIELD_ID(0x1a050, 25, 27, 3, 0x1000),
+ .va_wrdma_codec_fs_delay = REG_FIELD_ID(0x1a050, 21, 24, 3, 0x1000),
+ .va_wrdma_codec_intf = REG_FIELD_ID(0x1a050, 16, 19, 3, 0x1000),
+ .va_wrdma_codec_ch = REG_FIELD_ID(0x1a050, 0, 7, 3, 0x1000),
+
+ .wsa_rdma_dyncclk = REG_FIELD_ID(0xe000, 21, 21, 10, 0x1000),
+ .wsa_rdma_bursten = REG_FIELD_ID(0xe000, 20, 20, 10, 0x1000),
+ .wsa_rdma_wpscnt = REG_FIELD_ID(0xe000, 16, 19, 10, 0x1000),
+ .wsa_rdma_intf = REG_FIELD_ID(0xe000, 12, 15, 10, 0x1000),
+ .wsa_rdma_fifowm = REG_FIELD_ID(0xe000, 1, 11, 10, 0x1000),
+ .wsa_rdma_enable = REG_FIELD_ID(0xe000, 0, 0, 10, 0x1000),
+
+ .wsa_rdma_codec_enable = REG_FIELD_ID(0xe050, 30, 30, 10, 0x1000),
+ .wsa_rdma_codec_pack = REG_FIELD_ID(0xe050, 29, 29, 10, 0x1000),
+ .wsa_rdma_codec_fs_sel = REG_FIELD_ID(0xe050, 25, 27, 10, 0x1000),
+ .wsa_rdma_codec_fs_delay = REG_FIELD_ID(0xe050, 21, 24, 10, 0x1000),
+ .wsa_rdma_codec_intf = REG_FIELD_ID(0xe050, 16, 19, 10, 0x1000),
+ .wsa_rdma_codec_ch = REG_FIELD_ID(0xe050, 0, 7, 10, 0x1000),
+
+ .wsa_wrdma_dyncclk = REG_FIELD_ID(0x1a000, 22, 22, 7, 0x1000),
+ .wsa_wrdma_bursten = REG_FIELD_ID(0x1a000, 21, 21, 7, 0x1000),
+ .wsa_wrdma_wpscnt = REG_FIELD_ID(0x1a000, 17, 20, 7, 0x1000),
+ .wsa_wrdma_intf = REG_FIELD_ID(0x1a000, 12, 16, 7, 0x1000),
+ .wsa_wrdma_fifowm = REG_FIELD_ID(0x1a000, 1, 11, 7, 0x1000),
+ .wsa_wrdma_enable = REG_FIELD_ID(0x1a000, 0, 0, 7, 0x1000),
+
+ .wsa_wrdma_codec_enable = REG_FIELD_ID(0x1a050, 30, 30, 7, 0x1000),
+ .wsa_wrdma_codec_pack = REG_FIELD_ID(0x1a050, 29, 29, 7, 0x1000),
+ .wsa_wrdma_codec_fs_sel = REG_FIELD_ID(0x1a050, 25, 27, 7, 0x1000),
+ .wsa_wrdma_codec_fs_delay = REG_FIELD_ID(0x1a050, 21, 24, 7, 0x1000),
+ .wsa_wrdma_codec_intf = REG_FIELD_ID(0x1a050, 16, 19, 7, 0x1000),
+ .wsa_wrdma_codec_ch = REG_FIELD_ID(0x1a050, 0, 7, 7, 0x1000),
+
+ .hdmi_tx_ctl_addr = 0x1000,
+ .hdmi_legacy_addr = 0x1008,
+ .hdmi_vbit_addr = 0x610c0,
+ .hdmi_ch_lsb_addr = 0x61048,
+ .hdmi_ch_msb_addr = 0x6104c,
+ .ch_stride = 0x8,
+ .hdmi_parity_addr = 0x61034,
+ .hdmi_dmactl_addr = 0x61038,
+ .hdmi_dma_stride = 0x4,
+ .hdmi_DP_addr = 0x610c8,
+ .hdmi_sstream_addr = 0x6101c,
+ .hdmi_irq_reg_base = 0x63000,
+ .hdmi_irq_ports = 1,
+
+ .hdmi_rdma_dyncclk = REG_FIELD_ID(0x64000, 14, 14, 4, 0x1000),
+ .hdmi_rdma_bursten = REG_FIELD_ID(0x64000, 13, 13, 4, 0x1000),
+ .hdmi_rdma_burst8 = REG_FIELD_ID(0x64000, 15, 15, 4, 0x1000),
+ .hdmi_rdma_burst16 = REG_FIELD_ID(0x64000, 16, 16, 4, 0x1000),
+ .hdmi_rdma_dynburst = REG_FIELD_ID(0x64000, 18, 18, 4, 0x1000),
+ .hdmi_rdma_wpscnt = REG_FIELD_ID(0x64000, 10, 12, 4, 0x1000),
+ .hdmi_rdma_fifowm = REG_FIELD_ID(0x64000, 1, 5, 4, 0x1000),
+ .hdmi_rdma_enable = REG_FIELD_ID(0x64000, 0, 0, 4, 0x1000),
+
+ .sstream_en = REG_FIELD(0x6101c, 0, 0),
+ .dma_sel = REG_FIELD(0x6101c, 1, 2),
+ .auto_bbit_en = REG_FIELD(0x6101c, 3, 3),
+ .layout = REG_FIELD(0x6101c, 4, 4),
+ .layout_sp = REG_FIELD(0x6101c, 5, 8),
+ .set_sp_on_en = REG_FIELD(0x6101c, 10, 10),
+ .dp_audio = REG_FIELD(0x6101c, 11, 11),
+ .dp_staffing_en = REG_FIELD(0x6101c, 12, 12),
+ .dp_sp_b_hw_en = REG_FIELD(0x6101c, 13, 13),
+
+ .mute = REG_FIELD(0x610c8, 0, 0),
+ .as_sdp_cc = REG_FIELD(0x610c8, 1, 3),
+ .as_sdp_ct = REG_FIELD(0x610c8, 4, 7),
+ .aif_db4 = REG_FIELD(0x610c8, 8, 15),
+ .frequency = REG_FIELD(0x610c8, 16, 21),
+ .mst_index = REG_FIELD(0x610c8, 28, 29),
+ .dptx_index = REG_FIELD(0x610c8, 30, 31),
+
+ .soft_reset = REG_FIELD(0x1000, 31, 31),
+ .force_reset = REG_FIELD(0x1000, 30, 30),
+
+ .use_hw_chs = REG_FIELD(0x61038, 0, 0),
+ .use_hw_usr = REG_FIELD(0x61038, 1, 1),
+ .hw_chs_sel = REG_FIELD(0x61038, 2, 4),
+ .hw_usr_sel = REG_FIELD(0x61038, 5, 6),
+
+ .replace_vbit = REG_FIELD(0x610c0, 0, 0),
+ .vbit_stream = REG_FIELD(0x610c0, 1, 1),
+
+ .legacy_en = REG_FIELD(0x1008, 0, 0),
+ .calc_en = REG_FIELD(0x61034, 0, 0),
+ .lsb_bits = REG_FIELD(0x61048, 0, 31),
+ .msb_bits = REG_FIELD(0x6104c, 0, 31),
+
+ .clk_name = (const char*[]) {
+ "core_cc_sysnoc_mport_core",
+ },
+ .num_clks = 1,
+
+ .dai_driver = sm8650_lpass_cpu_dai_driver,
+ .num_dai = ARRAY_SIZE(sm8650_lpass_cpu_dai_driver),
+ .dai_osr_clk_names = (const char *[]) {
+ "core_cc_ext_mclk0",
+ "core_cc_ext_mclk0",
+ "core_cc_ext_mclk0",
+ "core_cc_ext_mclk0",
+ "core_cc_ext_mclk0",
+ "core_cc_ext_mclk0",
+ "core_cc_ext_mclk0",
+ },
+ .dai_bit_clk_names = (const char *[]) {
+ "core_cc_ext_if0_ibit",
+ "core_cc_ext_if1_ibit",
+ "audio_cc_ext_if5_ibit",
+ "audio_cc_ext_if1_ibit",
+ "aon_cc_ext_if1_ibit",
+ "audio_cc_ext_if2_ibit",
+ "audio_cc_ext_if4_ibit",
+ },
+ .mi2s_desc = sm8650_lpaif_mi2s_desc,
+ .num_mi2s_desc = ARRAY_SIZE(sm8650_lpaif_mi2s_desc),
+ .init = sm8650_lpass_init,
+ .exit = sm8650_lpass_exit,
+ .alloc_dma_channel = sm8650_lpass_alloc_dma_channel,
+ .free_dma_channel = sm8650_lpass_free_dma_channel,
+};
+
+static const struct of_device_id sm8650_lpass_cpu_device_id[] = {
+ {.compatible = "qcom,sm8650-lpass-cpu", .data = &sm8650_data},
+ {}
+};
+MODULE_DEVICE_TABLE(of, sm8650_lpass_cpu_device_id);
+
+static struct platform_driver sm8650_lpass_cpu_platform_driver = {
+ .driver = {
+ .name = "sm8650-lpass-cpu",
+ .of_match_table = of_match_ptr(sm8650_lpass_cpu_device_id),
+ .pm = pm_ptr(&sm8650_lpass_pm_ops),
+ },
+ .probe = asoc_qcom_lpass_cpu_platform_probe,
+ .remove = asoc_qcom_lpass_cpu_platform_remove,
+ .shutdown = asoc_qcom_lpass_cpu_platform_shutdown,
+};
+
+module_platform_driver(sm8650_lpass_cpu_platform_driver);
+
+MODULE_DESCRIPTION("SM8650 LPASS CPU DRIVER");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 9e18606ef3b8..a37b980f69ff 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -166,7 +166,7 @@ struct lpaif_mi2s_desc {
const char *reg_name;
const char *irq_name;
enum lpass_lpm lpm_type;
- struct mi2s_port_desc *port_desc;
+ const struct mi2s_port_desc *port_desc;
unsigned int port_desc_count;
};
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 18/19] ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (16 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 17/19] ASoC: qcom: add SM8650 LPASS CPU driver Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 17:52 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 19/19] ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu Neil Armstrong
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
Like for the WCD ports, allow the WSA_RX0 port to be initialized
as a soundwire DAI.
The LPASS CPU dai ids from qcom,lpass.h overlap with the DSP dai ids
from qcom,q6dsp-lpass-ports.h, so only match the LPASS CPU dai ids on
the DSP Bypass links, which are neither DPCM frontends nor backends,
instead of matching them on all the links, adding an helper to
identify those links.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/common.h | 9 +++++++++
sound/soc/qcom/sdw.c | 42 +++++++++++++++++++++---------------------
2 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h
index 37b185a4968f..1af9c32505e6 100644
--- a/sound/soc/qcom/common.h
+++ b/sound/soc/qcom/common.h
@@ -32,5 +32,14 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd,
struct snd_soc_jack *dp_jack, int id);
+/*
+ * DSP Bypass links (lpass-cpu) are neither DPCM frontends nor backends,
+ * their cpu dai ids overlap with the DSP dai ids.
+ */
+static inline bool qcom_snd_is_dsp_bypass_link(struct snd_soc_pcm_runtime *rtd)
+{
+ return !rtd->dai_link->no_pcm && !rtd->dai_link->dynamic;
+}
+
#endif
diff --git a/sound/soc/qcom/sdw.c b/sound/soc/qcom/sdw.c
index e19adb7c750b..b071d2a79788 100644
--- a/sound/soc/qcom/sdw.c
+++ b/sound/soc/qcom/sdw.c
@@ -6,10 +6,25 @@
#include <dt-bindings/sound/qcom,q6afe.h>
#include <linux/module.h>
#include <sound/soc.h>
+#include "common.h"
#include "sdw.h"
-static bool qcom_snd_is_sdw_dai(int id)
+static bool qcom_snd_is_sdw_dai(struct snd_soc_pcm_runtime *rtd)
{
+ int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
+
+ /* DSP Bypass usecase, cpu dai ids overlap with DSP dai ids */
+ if (qcom_snd_is_dsp_bypass_link(rtd)) {
+ switch (id) {
+ case LPASS_CDC_DMA_TX3:
+ case LPASS_CDC_DMA_RX0:
+ case LPASS_CDC_DMA_WSA_RX0:
+ return true;
+ default:
+ return false;
+ }
+ }
+
switch (id) {
case WSA_CODEC_DMA_RX_0:
case WSA_CODEC_DMA_TX_0:
@@ -34,20 +49,8 @@ static bool qcom_snd_is_sdw_dai(int id)
case SLIMBUS_0_RX...SLIMBUS_6_TX:
return true;
default:
- break;
- }
-
- /* DSP Bypass usecase, cpu dai index overlaps with DSP dai ids,
- * DO NOT MERGE into top switch case */
- switch (id) {
- case LPASS_CDC_DMA_TX3:
- case LPASS_CDC_DMA_RX0:
- return true;
- default:
- break;
+ return false;
}
-
- return false;
}
/**
@@ -72,7 +75,7 @@ int qcom_snd_sdw_startup(struct snd_pcm_substream *substream)
u32 rx_ch_cnt = 0, tx_ch_cnt = 0;
int ret, i, j;
- if (!qcom_snd_is_sdw_dai(cpu_dai->id))
+ if (!qcom_snd_is_sdw_dai(rtd))
return 0;
sruntime = sdw_alloc_stream(cpu_dai->name, SDW_STREAM_PCM);
@@ -128,12 +131,11 @@ int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream,
bool *stream_prepared)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
- struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
struct sdw_stream_runtime *sruntime;
int ret;
- if (!qcom_snd_is_sdw_dai(cpu_dai->id))
+ if (!qcom_snd_is_sdw_dai(rtd))
return 0;
sruntime = qcom_snd_sdw_get_stream(substream);
@@ -170,11 +172,10 @@ struct sdw_stream_runtime *qcom_snd_sdw_get_stream(struct snd_pcm_substream *sub
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai;
- struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
struct sdw_stream_runtime *sruntime;
int i;
- if (!qcom_snd_is_sdw_dai(cpu_dai->id))
+ if (!qcom_snd_is_sdw_dai(rtd))
return NULL;
for_each_rtd_codec_dais(rtd, i, codec_dai) {
@@ -197,10 +198,9 @@ EXPORT_SYMBOL_GPL(qcom_snd_sdw_shutdown);
int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, bool *stream_prepared)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
- struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
struct sdw_stream_runtime *sruntime;
- if (!qcom_snd_is_sdw_dai(cpu_dai->id))
+ if (!qcom_snd_is_sdw_dai(rtd))
return 0;
sruntime = qcom_snd_sdw_get_stream(substream);
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v3 19/19] ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
` (17 preceding siblings ...)
2026-12-04 15:53 ` [PATCH v3 18/19] ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai Neil Armstrong
@ 2026-12-04 15:53 ` Neil Armstrong
2026-12-04 17:54 ` sashiko-bot
18 siblings, 1 reply; 30+ messages in thread
From: Neil Armstrong @ 2026-12-04 15:53 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Srinivasa Rao Mandadapu, Venkata Prasad Potturu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rohit kumar
Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel,
Neil Armstrong
When the ADSP is not used, the sound card links use the LPASS CPU dais
directly, those links are neither DPCM frontends nor backends.
The LPASS CPU dai ids from qcom,lpass.h overlap with the DSP dai ids
from qcom,q6dsp-lpass-ports.h, so add separate init and ops callbacks
for those DSP Bypass links and keep the DSP backends handling unchanged,
allowing the sm8650 sound card bindings to work with either the
Audioreach or the lpass-cpu interfaces.
Also attach the WCD jack to the LPASS CPU TX codec DMA dais on the
DSP Bypass links in qcom_snd_wcd_jack_setup().
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
sound/soc/qcom/common.c | 45 +++++++++++++++---------
sound/soc/qcom/sc8280xp.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 116 insertions(+), 17 deletions(-)
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index 77845d43c219..4b7cda8070b3 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -2,6 +2,7 @@
// Copyright (c) 2018, Linaro Limited.
// Copyright (c) 2018, The Linux Foundation. All rights reserved.
+#include <dt-bindings/sound/qcom,lpass.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <linux/module.h>
#include <sound/jack.h>
@@ -420,26 +421,36 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
if (rval)
return rval;
- switch (cpu_dai->id) {
- case LPI_MI2S_RX_0:
- case TX_CODEC_DMA_TX_0:
- case TX_CODEC_DMA_TX_1:
- case TX_CODEC_DMA_TX_2:
- case TX_CODEC_DMA_TX_3:
- case VA_CODEC_DMA_TX_1:
- for_each_rtd_codec_dais(rtd, i, codec_dai) {
- rval = snd_soc_component_set_jack(codec_dai->component,
- jack, NULL);
- if (rval != 0 && rval != -ENOTSUPP) {
- dev_warn(card->dev, "Failed to set jack: %d\n", rval);
- return rval;
- }
+ if (qcom_snd_is_dsp_bypass_link(rtd)) {
+ switch (cpu_dai->id) {
+ case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX3:
+ break;
+ default:
+ return 0;
+ }
+ } else {
+ switch (cpu_dai->id) {
+ case LPI_MI2S_RX_0:
+ case TX_CODEC_DMA_TX_0:
+ case TX_CODEC_DMA_TX_1:
+ case TX_CODEC_DMA_TX_2:
+ case TX_CODEC_DMA_TX_3:
+ case VA_CODEC_DMA_TX_1:
+ break;
+ default:
+ return 0;
}
+ }
- break;
- default:
- break;
+ for_each_rtd_codec_dais(rtd, i, codec_dai) {
+ rval = snd_soc_component_set_jack(codec_dai->component,
+ jack, NULL);
+ if (rval != 0 && rval != -ENOTSUPP) {
+ dev_warn(card->dev, "Failed to set jack: %d\n", rval);
+ return rval;
+ }
}
+
return 0;
}
EXPORT_SYMBOL_GPL(qcom_snd_wcd_jack_setup);
diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index f655b3ae1d5b..89f14d435005 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2022, Linaro Limited
+#include <dt-bindings/sound/qcom,lpass.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -385,6 +386,37 @@ static int nord_snd_init(struct snd_soc_pcm_runtime *rtd)
return 0;
}
+static int sc8280xp_lpass_snd_init(struct snd_soc_pcm_runtime *rtd)
+{
+ struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+ struct snd_soc_card *card = rtd->card;
+
+ switch (cpu_dai->id) {
+ case LPASS_CDC_DMA_WSA_RX0:
+ case LPASS_CDC_DMA_WSA_RX1:
+ /*
+ * Set limit of -3 dB on Digital Volume and 0 dB on PA Volume
+ * to reduce the risk of speaker damage until we have active
+ * speaker protection in place.
+ */
+ snd_soc_limit_volume(card, "WSA_RX0 Digital Volume", 81);
+ snd_soc_limit_volume(card, "WSA_RX1 Digital Volume", 81);
+ snd_soc_limit_volume(card, "SpkrLeft PA Volume", 17);
+ snd_soc_limit_volume(card, "SpkrRight PA Volume", 17);
+ break;
+ case LPASS_DP_RX:
+ return qcom_snd_dp_jack_setup(rtd, &data->dp_jack[0], 0);
+ default:
+ break;
+ }
+
+ if (data->priv->wcd_jack)
+ return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup);
+
+ return 0;
+}
+
static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
@@ -549,6 +581,58 @@ static const struct snd_soc_ops sc8280xp_be_ops = {
.prepare = sc8280xp_snd_prepare,
};
+static int sc8280xp_lpass_snd_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+ struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
+ int mclk_freq = sc8280xp_get_mclk_freq(params);
+ struct snd_soc_dai *codec_dai;
+ int ret, i;
+
+ switch (cpu_dai->id) {
+ case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
+ for_each_rtd_codec_dais(rtd, i, codec_dai) {
+ if (data->priv->codec_dai_fmt) {
+ ret = snd_soc_dai_set_fmt(codec_dai,
+ data->priv->codec_dai_fmt);
+ if (ret && ret != -ENOTSUPP)
+ return ret;
+ }
+
+ if (data->priv->codec_sysclk_set) {
+ ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk_freq,
+ SND_SOC_CLOCK_IN);
+ if (ret && ret != -ENOTSUPP)
+ return ret;
+ }
+ }
+
+ /* The LPASS CPU dai sets its bit clock from the hw params */
+ if (data->priv->mi2s_mclk_enable) {
+ ret = snd_soc_dai_set_sysclk(cpu_dai, LPASS_MCLK0, mclk_freq,
+ SND_SOC_CLOCK_OUT);
+ if (ret)
+ return ret;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+static const struct snd_soc_ops sc8280xp_lpass_ops = {
+ .startup = qcom_snd_sdw_startup,
+ .shutdown = qcom_snd_sdw_shutdown,
+ .hw_params = sc8280xp_lpass_snd_hw_params,
+ .hw_free = sc8280xp_snd_hw_free,
+ .prepare = sc8280xp_snd_prepare,
+};
+
static void sc8280xp_add_be_ops(struct snd_soc_card *card)
{
struct snd_soc_dai_link *link;
@@ -570,6 +654,10 @@ static void sc8280xp_add_be_ops(struct snd_soc_card *card)
link->exit = sc8280xp_snd_exit;
link->be_hw_params_fixup = sc8280xp_be_hw_params_fixup;
link->ops = &sc8280xp_be_ops;
+ } else if (!link->dynamic) {
+ /* DSP Bypass link, neither a DPCM frontend nor a backend */
+ link->init = sc8280xp_lpass_snd_init;
+ link->ops = &sc8280xp_lpass_ops;
}
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH v3 05/19] ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used
2026-12-04 15:53 ` [PATCH v3 05/19] ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used Neil Armstrong
@ 2026-12-04 16:20 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 16:20 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: sound: qcom,lpass-tx-macro relaxes clocks minItems
for sc7280
--
commit 2e72798caf68b7d7f2a4800094a973b24d43f1bb
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used
This commit updates the Qualcomm LPASS RX, TX, VA, and WSA macro DT
bindings to allow fewer clocks when ADSP is bypassed, and adds optional
power-domains to the WSA macro binding.
> diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
> index 6f5648a973cd7..093343f96f67d 100644
> --- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
> +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
> @@ -42,11 +42,11 @@ properties:
> const: 0
>
> clocks:
> - minItems: 3
> + minItems: 2
> maxItems: 5
>
> clock-names:
> - minItems: 3
> + minItems: 2
> maxItems: 5
>
> clock-output-names:
[Severity: Low]
Does lowering the top-level clocks minItems to 2 unintentionally relax the
clocks constraint for qcom,sc7280-lpass-tx-macro?
Unlike the other compatible branches in allOf, qcom,sc7280-lpass-tx-macro
omits its own clocks sub-schema and inherits the top-level minItems.
Because SC7280 requires mclk, npl, and fsgen in tx_macro_probe(), a
2-clock node would now pass the clocks check and fail at probe.
Adding clocks with minItems: 3 and maxItems: 5 to the
qcom,sc7280-lpass-tx-macro branch would preserve the existing constraint.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=5
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 10/19] ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA
2026-12-04 15:53 ` [PATCH v3 10/19] ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA Neil Armstrong
@ 2026-12-04 16:47 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 16:47 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] ASoC: qcom: unchecked clk_prepare_enable() in
lpass_cdc_dma_daiops_startup()
--
commit ff90ba0facc4134cb0b60ca59d61de202064760a
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA
This commit adds WSA RX and TX codec DMA DAI cases to the LPASS codec DMA
driver, wiring up their DMA control handles, interface mappings, and
codec_mem1 clock handling.
> diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
> index 2dc8c75c4bf08..d7f85a4f9d999 100644
> --- a/sound/soc/qcom/lpass-cdc-dma.c
> +++ b/sound/soc/qcom/lpass-cdc-dma.c
[ ... ]
> @@ -184,6 +211,11 @@ static int lpass_cdc_dma_daiops_startup(struct snd_pcm_substream *substream,
> clk_set_rate(drvdata->va_mem0, CODEC_MEM_HZ_NORMAL);
> clk_prepare_enable(drvdata->va_mem0);
> break;
> + case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
> + case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
> + clk_set_rate(drvdata->codec_mem1, CODEC_MEM_HZ_NORMAL);
> + clk_prepare_enable(drvdata->codec_mem1);
> + break;
> default:
> dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
> break;
[Severity: Medium]
Should the return values of clk_set_rate() and clk_prepare_enable() on
drvdata->codec_mem1 be checked and propagated here?
Because lpass_cdc_dma_daiops_startup() always returns 0,
snd_soc_dai_startup() marks the DAI as started even if enabling the
clock fails. On close or open-path unwind,
lpass_cdc_dma_daiops_shutdown() still calls clk_disable_unprepare().
That unmatched disable triggers clock refcount underflow warnings or
prematurely gates drvdata->codec_mem1 while another WSA stream is
active.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=10
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 09/19] ASoC: qcom: lpass: add support for optional WSA interface
2026-12-04 15:53 ` [PATCH v3 09/19] ASoC: qcom: lpass: add support for optional WSA interface Neil Armstrong
@ 2026-12-04 16:49 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 16:49 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] ASoC: qcom: lpass: race between lpass_platform_wsaif_irq() and
close()
- [Medium] ASoC: qcom: lpass: missing wsa_lpaif_map regcache sync on
suspend/resume
- [Low] ASoC: qcom: lpass: missing regmap name in
lpass_wsa_regmap_config
- [Low] ASoC: qcom: lpass: lpass_platform_wsa_hardware duplicates rxtx
struct
--
commit be7127fbdf093a9c69f87b524efb6d872b0f934c
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: lpass: add support for optional WSA interface
This commit adds optional WSA LPAIF regmap, DMA control, IRQ, and PCM
platform support for the Qualcomm LPASS codec DMA driver.
> diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
> index 3089107442231..db7a0752edb2f 100644
> --- a/sound/soc/qcom/lpass-cpu.c
> +++ b/sound/soc/qcom/lpass-cpu.c
[ ... ]
> @@ -984,6 +1076,16 @@ static struct regmap_config lpass_va_regmap_config = {
> .cache_type = REGCACHE_FLAT,
> };
>
> +static struct regmap_config lpass_wsa_regmap_config = {
> + .reg_bits = 32,
> + .reg_stride = 4,
> + .val_bits = 32,
> + .writeable_reg = lpass_wsa_regmap_writeable,
> + .readable_reg = lpass_wsa_regmap_readable,
> + .volatile_reg = lpass_wsa_regmap_volatile,
> + .cache_type = REGCACHE_FLAT,
> +};
[Severity: Low]
Should lpass_wsa_regmap_config set .name (for example "lpass_wsa"), like
lpass_cpu_regmap_config and lpass_hdmi_regmap_config do?
Because drvdata->wsa_lpaif_map is registered on the same platform device as
the earlier unnamed drvdata->rxtx_lpaif_map, regmap_debugfs_init() collides
on the bare device name and fails with -EEXIST, leaving the WSA regmap
unexposed in debugfs when CONFIG_DEBUG_FS is enabled.
[ ... ]
> @@ -1143,6 +1254,18 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
> if (IS_ERR(drvdata->va_lpaif_map))
> return PTR_ERR(drvdata->va_lpaif_map);
>
> + if (drvdata->wsa_enable) {
> + lpass_wsa_regmap_config.max_register = LPAIF_CDC_WSA_WRDMAPER_REG(variant,
> + variant->wsa_wrdma_channels +
> + variant->wsa_wrdma_channel_start,
> + LPASS_CDC_DMA_WSA_TX0);
> +
> + drvdata->wsa_lpaif_map = devm_regmap_init_mmio(dev, drvdata->wsa_lpaif,
> + &lpass_wsa_regmap_config);
> + if (IS_ERR(drvdata->wsa_lpaif_map))
> + return PTR_ERR(drvdata->wsa_lpaif_map);
> + }
[Severity: Medium]
Does drvdata->wsa_lpaif_map need to be handled in
lpass_platform_pcmops_suspend() and lpass_platform_pcmops_resume() alongside
lpaif_map and hdmiif_map?
lpass_wsa_regmap_config uses REGCACHE_FLAT and lpass_platform_wsa_hardware
advertises SNDRV_PCM_INFO_RESUME, so resuming a suspended stream runs
TRIGGER_RESUME without re-running prepare(). If the WSA LPAIF loses state
across suspend, DMA base, buffer, and period registers are never restored.
For a stream left in PREPARED state across suspend, the unsynced flat cache
can also return a stale cached dmactl->enable value and cause
regmap_fields_write() to skip writing to hardware.
> diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
> index 7dfcae4e6fdaa..902c13c6f2e66 100644
> --- a/sound/soc/qcom/lpass-platform.c
> +++ b/sound/soc/qcom/lpass-platform.c
> @@ -97,6 +97,30 @@ static const struct snd_pcm_hardware lpass_platform_va_hardware = {
> .fifo_size = 0,
> };
>
> +static const struct snd_pcm_hardware lpass_platform_wsa_hardware = {
> + .info = SNDRV_PCM_INFO_MMAP |
> + SNDRV_PCM_INFO_MMAP_VALID |
> + SNDRV_PCM_INFO_INTERLEAVED |
> + SNDRV_PCM_INFO_PAUSE |
> + SNDRV_PCM_INFO_RESUME,
> + .formats = SNDRV_PCM_FMTBIT_S16 |
> + SNDRV_PCM_FMTBIT_S24 |
> + SNDRV_PCM_FMTBIT_S32,
> + .rates = SNDRV_PCM_RATE_8000_192000,
> + .rate_min = 8000,
> + .rate_max = 192000,
> + .channels_min = 1,
> + .channels_max = 8,
> + .buffer_bytes_max = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE,
> + .period_bytes_max = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE /
> + LPASS_PLATFORM_PERIODS,
> + .period_bytes_min = LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE /
> + LPASS_PLATFORM_PERIODS,
> + .periods_min = LPASS_PLATFORM_PERIODS,
> + .periods_max = LPASS_PLATFORM_PERIODS,
> + .fifo_size = 0,
> +};
[Severity: Low]
Can WSA reuse lpass_platform_rxtx_hardware directly instead of duplicating
it? Every field in lpass_platform_wsa_hardware is identical to
lpass_platform_rxtx_hardware, including the LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE
buffer and period sizes.
[ ... ]
> @@ -1117,6 +1235,35 @@ static irqreturn_t lpass_platform_vaif_irq(int irq, void *data)
> return IRQ_HANDLED;
> }
>
> +static irqreturn_t lpass_platform_wsaif_irq(int irq, void *data)
> +{
> + struct lpass_data *drvdata = data;
> + const struct lpass_variant *v = drvdata->variant;
> + unsigned int irqs;
> + irqreturn_t rv;
> + int chan;
> +
> + rv = regmap_read(drvdata->wsa_lpaif_map,
> + LPAIF_WSA_IRQSTAT_REG(v, LPAIF_IRQ_PORT_HOST), &irqs);
> + if (rv) {
> + pr_err("error reading from wsa irqstat reg: %d\n", rv);
> + return IRQ_NONE;
> + }
> +
> + /* Handle per channel interrupts */
> + for (chan = 0; chan < LPASS_MAX_CDC_DMA_CHANNELS; chan++) {
> + if (irqs & LPAIF_IRQ_ALL(chan) && drvdata->wsa_substream[chan]) {
> + rv = lpass_dma_interrupt_handler(
> + drvdata->wsa_substream[chan],
> + drvdata, chan, irqs);
> + if (rv != IRQ_HANDLED)
> + return rv;
> + }
> + }
> +
> + return IRQ_HANDLED;
> +}
[Severity: High]
Can lpass_platform_wsaif_irq() race with lpass_platform_pcmops_close() and
cause a use-after-free of substream->runtime?
lpass_platform_pcmops_trigger(STOP) only masks the interrupt, and neither
lpass_platform_pcmops_close() nor a .sync_stop callback calls
synchronize_irq(drvdata->wsaif_irq) before snd_pcm_detach_substream() frees
runtime:
CPU0 CPU1
lpass_platform_wsaif_irq() snd_pcm_release_substream()
load drvdata->wsa_substream[chan] lpass_platform_pcmops_trigger(STOP)
lpass_platform_pcmops_close()
drvdata->wsa_substream[ch] = NULL
snd_pcm_detach_substream()
kfree(runtime)
lpass_dma_interrupt_handler(...)
snd_pcm_period_elapsed(substream)
... dereference runtime <-- use-after-free
In addition, drvdata->wsa_substream[chan] is read twice without locking or
READ_ONCE(), so clearing it between the check and the call can pass NULL to
lpass_dma_interrupt_handler() and trigger a NULL pointer dereference in
hardirq context.
Calling synchronize_irq(drvdata->wsaif_irq) after clearing the slot in
lpass_platform_pcmops_close() (or implementing .sync_stop) and loading the
substream pointer once with READ_ONCE() would close both windows.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=9
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 14/19] ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs
2026-12-04 15:53 ` [PATCH v3 14/19] ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs Neil Armstrong
@ 2026-12-04 17:08 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 17:08 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ASoC: qcom: lpass: duplicate MI2S DAI ID switch in
is_lpm_mi2s_port()
--
commit 7c76ec9c8122717240b213ce7bf7296a867709a0
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs
This commit adds an lpm_type field to struct lpaif_mi2s_desc, stores it per
MI2S port in struct lpass_data during probe, and adds the is_lpm_mi2s_port()
helper.
> diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
> index 70d64bf3f0737..71f1274dfa892 100644
> --- a/sound/soc/qcom/lpass.h
> +++ b/sound/soc/qcom/lpass.h
[ ... ]
> @@ -261,6 +269,19 @@ struct lpass_data {
> struct lpass_sstream_ctl *sstream_ctl;
> };
>
> +static inline bool is_lpm_mi2s_port(struct lpass_data *drvdata, unsigned int dai_id)
> +{
> + unsigned int port_id;
> +
> + switch (dai_id) {
> + case MI2S_PRIMARY ... MI2S_QUINARY:
> + case MI2S_SENARY ... MI2S_SEPTENARY:
> + port_id = mi2s_port_id(dai_id);
> + return drvdata->mi2s_lpm[port_id] != LPASS_LPM_NONE;
> + }
> + return false;
> +}
[Severity: Low]
Can is_lpm_mi2s_port() reuse is_mi2s_port_id(dai_id) instead of duplicating
the MI2S DAI ID switch cases?
sound/soc/qcom/lpass.h already defines is_mi2s_port_id(int dai_id) with the
same MI2S_PRIMARY..MI2S_QUINARY and MI2S_SENARY..MI2S_SEPTENARY ranges, so
calling it avoids keeping two copies of those ranges in sync. Taking int
dai_id would also match is_mi2s_port_id() and mi2s_port_id().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=14
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 13/19] ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs
2026-12-04 15:53 ` [PATCH v3 13/19] ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs Neil Armstrong
@ 2026-12-04 17:10 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 17:10 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] ASoC: qcom: lpass: unconditional RXTX/VA mapping conflicts with
MI2S LPAIFs
--
commit 1fdcb9a0baa93e845c8500569ac8ec46f6dbb9c0
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs
This commit adds an optional mi2s_desc layout table to struct lpass_variant
so MI2S ports can be mapped across multiple LPAIF instances, probing only
the LPAIFs that have a port described in DT.
> diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
> index b4620fc99e264..902ad65545108 100644
> --- a/sound/soc/qcom/lpass-cpu.c
> +++ b/sound/soc/qcom/lpass-cpu.c
[ ... ]
> @@ -1340,11 +1369,25 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
> drvdata->va_cdc_dma_lpm_buf = res->start;
> }
>
> - drvdata->num_lpaif = 1;
> + if (variant->mi2s_desc) {
> + if (variant->num_mi2s_desc > LPASS_MAX_LPAIF)
> + return -EINVAL;
> +
> + drvdata->num_lpaif = variant->num_mi2s_desc;
>
> - ret = lpass_cpu_init_lpaif(pdev, 0, "lpass-lpaif");
> - if (ret)
> - return ret;
> + for (i = 0; i < variant->num_mi2s_desc; i++) {
> + ret = lpass_cpu_init_lpaif(pdev, i,
> + variant->mi2s_desc[i].reg_name);
> + if (ret)
> + return ret;
> + }
> + } else {
[Severity: High]
Can lpass_cpu_init_lpaif() fail with -EBUSY when DT combines a Codec DMA
port on one LPAIF with an MI2S port on another?
In of_lpass_cpu_parse_dai_data(), any RXTX, VA, or WSA Codec DMA child node
sets codec_dma_enable, while only WSA has its own enable flag (wsa_enable).
Earlier in asoc_qcom_lpass_cpu_platform_probe(), codec_dma_enable claims
both lpass-rxtx-lpaif and lpass-va-lpaif unconditionally.
If a board uses Codec DMA on one LPAIF (such as RXTX or WSA) alongside an
MI2S port on lpass-va-lpaif (or lpass-rxtx-lpaif), lpass_cpu_init_lpaif()
requests the same MMIO region a second time and fails probe with -EBUSY.
asoc_qcom_lpass_platform_register() hits the same -EBUSY conflict on IRQ
registration, because the codec_dma_enable block unconditionally requests
both lpass-irq-rxtxif and lpass-irq-vaif without IRQF_SHARED after
lpass_platform_init_lpaif() has requested the MI2S LPAIF IRQ.
Gating RXTX and VA LPAIF MMIO, regmap, IRQ, and dmactl initialization on
per-interface enable flags like wsa_enable would avoid both conflicts.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=13
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 16/19] ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory
2026-12-04 15:53 ` [PATCH v3 16/19] ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory Neil Armstrong
@ 2026-12-04 17:28 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 17:28 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] ASoC: qcom: lpass: NULL from lpass_cdc_dma_mem_clk() leaves
LPM unclocked
- [Medium] ASoC: qcom: lpass: u32 underflow in
lpass_platform_allocate_lpm()
- [Medium] ASoC: qcom: lpass: CPU DAI ops read LPM offsets before
allocation
- [Low] ASoC: qcom: lpass: duplicate CODEC_MEM_HZ_NORMAL macro in
lpass-cdc-dma.c
--
commit 4b0fca2ecbda976a26705ce49717ef7e307a8203
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory
This commit adds lpass_cdc_dma_mem_clk() to select the codec_mem clock
matching a DMA buffer's LPM offset, updates the codec DMA DAI ops to use
it, and enables the LPM memory clock in the MI2S CPU DAI startup and
shutdown paths for non-core LPAIF ports.
> diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
> index d7f85a4f9d999..291c929360435 100644
> --- a/sound/soc/qcom/lpass-cdc-dma.c
> +++ b/sound/soc/qcom/lpass-cdc-dma.c
> @@ -213,8 +215,9 @@ static int lpass_cdc_dma_daiops_startup(struct snd_pcm_substream *substream,
> break;
> case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
> case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
> - clk_set_rate(drvdata->codec_mem1, CODEC_MEM_HZ_NORMAL);
> - clk_prepare_enable(drvdata->codec_mem1);
> + mem_clk = lpass_cdc_dma_mem_clk(drvdata, drvdata->wsa_lpm_offset);
> + clk_set_rate(mem_clk, CODEC_MEM_HZ_NORMAL);
> + clk_prepare_enable(mem_clk);
> break;
[ ... ]
> case LPASS_CDC_DMA_WSA_RX0 ... LPASS_CDC_DMA_WSA_RX9:
> case LPASS_CDC_DMA_WSA_TX0 ... LPASS_CDC_DMA_WSA_TX8:
> - clk_disable_unprepare(drvdata->codec_mem1);
> + mem_clk = lpass_cdc_dma_mem_clk(drvdata, drvdata->wsa_lpm_offset);
> + clk_disable_unprepare(mem_clk);
> break;
[Severity: Medium]
Can lpass_cdc_dma_daiops_startup() and lpass_cpu_daiops_startup() read
wsa_lpm_offset or mi2s_lpm_offset[] before lpass_platform_allocate_lpm()
initializes them?
asoc_qcom_lpass_cpu_platform_probe() registers lpass_cpu_comp_driver before
calling asoc_qcom_lpass_platform_register(), which is where
lpass_platform_allocate_lpm() runs. Because qcom_snd_parse_of() points
link->platforms->of_node at the CPU node, a rebinding or concurrently
probing machine driver can bind the card and expose PCM devices before the
LPM offsets are assigned:
CPU0 CPU1
asoc_qcom_lpass_cpu_platform_probe()
devm_snd_soc_register_component()
snd_soc_card_rebind()
... -> snd_card_register()
snd_pcm_open_substream()
lpass_cdc_dma_daiops_startup()
reads wsa_lpm_offset == 0
clk_prepare_enable(codec_mem0)
asoc_qcom_lpass_platform_register()
lpass_platform_allocate_lpm()
wsa_lpm_offset = 16384
... -> lpass_cdc_dma_daiops_shutdown()
reads wsa_lpm_offset == 16384
clk_disable_unprepare(codec_mem1)
<-- wrong clock disabled
This leaks a prepare/enable reference on codec_mem0 and triggers CCF
underflow warnings on codec_mem1 (or codec_mem2/codec_mem3 for MI2S ports).
Allocating the LPM offsets before registering lpass_cpu_comp_driver would
close this window.
> diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
> index 8b005a87d4088..a68ca4d4d63c7 100644
> --- a/sound/soc/qcom/lpass-cpu.c
> +++ b/sound/soc/qcom/lpass-cpu.c
> @@ -82,25 +82,57 @@ static int lpass_cpu_daiops_set_sysclk(struct snd_soc_dai *dai, int clk_id,
> return ret;
> }
>
> +/* LPM memory clock of the MI2S ports using a non-core LPAIF, NULL otherwise */
> +static struct clk *lpass_cpu_mi2s_mem_clk(struct lpass_data *drvdata, unsigned int dai_id)
> +{
> + unsigned int port_id = mi2s_port_id(dai_id);
> +
> + if (!is_lpm_mi2s_port(drvdata, dai_id))
> + return NULL;
> +
> + if (drvdata->mi2s_lpm[port_id] == LPASS_RXTX_CDC_LPM)
> + return lpass_cdc_dma_mem_clk(drvdata, drvdata->mi2s_lpm_offset[port_id]);
> +
> + return drvdata->va_mem0;
> +}
> +
> static int lpass_cpu_daiops_startup(struct snd_pcm_substream *substream,
> struct snd_soc_dai *dai)
> {
> struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
> unsigned int port_id = mi2s_port_id(dai->driver->id);
> + struct clk *mem_clk = lpass_cpu_mi2s_mem_clk(drvdata, dai->driver->id);
> int ret;
>
> + if (mem_clk) {
> + ret = clk_set_rate(mem_clk, LPASS_CODEC_MEM_HZ_NORMAL);
> + if (ret) {
> + dev_err(dai->dev, "error setting lpm mem clk rate: %d\n", ret);
> + return ret;
> + }
> + ret = clk_prepare_enable(mem_clk);
> + if (ret) {
> + dev_err(dai->dev, "error in enabling lpm mem clk: %d\n", ret);
> + return ret;
> + }
> + }
[Severity: Medium]
Does lpass_cpu_daiops_startup() silently leave the LPM SRAM bank unclocked
when lpass_cdc_dma_mem_clk() returns NULL?
of_lpass_cdc_dma_clks_parse() fetches codec_mem3 with
devm_clk_get_optional(), and lpass_cdc_dma_mem_clk() returns NULL both when
block 3 is assigned without codec_mem3 and for any offset >= 64 KiB.
lpass_cpu_mi2s_mem_clk() conflates that NULL with non-LPM MI2S ports, so
startup succeeds without enabling a clock; lpass_cdc_dma_daiops_startup()
has the same issue because CCF helpers treat NULL as a no-op.
Subsequent CPU or DMA accesses to the unclocked LPM bank can fail silently
or trigger a bus fault. Returning an ERR_PTR for a missing LPM clock or
validating that a backing clock exists in lpass_platform_allocate_lpm()
would catch this cleanly.
> diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
> index 3a37bf9926457..9e18606ef3b89 100644
> --- a/sound/soc/qcom/lpass.h
> +++ b/sound/soc/qcom/lpass.h
> @@ -30,6 +30,8 @@
> #define LPASS_CDC_DMA_INTF_FOUR_CHANNEL (0x0F)
> #define LPASS_CDC_DMA_INTF_SIX_CHANNEL (0x3F)
> #define LPASS_CDC_DMA_INTF_EIGHT_CHANNEL (0xFF)
> +#define LPASS_CDC_DMA_LPM_MEM_BLK_SIZE (2 * 8 * 1024)
> +#define LPASS_CODEC_MEM_HZ_NORMAL 153600000
[Severity: Low]
This isn't a bug, but lpass-cdc-dma.c already includes lpass.h and still
defines its own CODEC_MEM_HZ_NORMAL with the same 153600000 value. Could
lpass-cdc-dma.c drop the local macro and reuse LPASS_CODEC_MEM_HZ_NORMAL?
[ ... ]
> @@ -292,6 +294,24 @@ static inline bool is_lpm_mi2s_port(struct lpass_data *drvdata, unsigned int dai
> return false;
> }
>
> +static inline struct clk *lpass_cdc_dma_mem_clk(struct lpass_data *drvdata, u32 offset)
> +{
> + unsigned int id = offset / LPASS_CDC_DMA_LPM_MEM_BLK_SIZE;
> +
> + switch (id) {
> + case 0:
> + return drvdata->codec_mem0;
> + case 1:
> + return drvdata->codec_mem1;
> + case 2:
> + return drvdata->codec_mem2;
> + case 3:
> + return drvdata->codec_mem3;
> + default:
> + return NULL;
> + }
> +}
[Severity: Medium]
Can an undersized LPM region in DT cause u32 underflow in
lpass_platform_allocate_lpm() and pass out-of-range offsets here?
sound/soc/qcom/lpass-platform.c:lpass_platform_allocate_lpm() {
...
if (drvdata->codec_dma_enable) {
drvdata->rxtx_lpm_offset = rxtx_cdc_dma_lpm_offset;
rxtx_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
rxtx_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
...
}
When the DT LPM region is smaller than the codec DMA allocations (for
example, under 32 KiB for RXTX with WSA enabled), rxtx_cdc_dma_lpm_remain
or va_cdc_dma_lpm_remain wraps around and bypasses the subsequent MI2S
capacity checks. That passes out-of-bounds physical addresses to memremap()
and io_remap_pfn_range(), and feeds out-of-range offsets to
lpass_cdc_dma_mem_clk().
Checking the remaining size before each codec DMA subtraction would prevent
the underflow.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=16
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 15/19] ASoC: qcom: lpass: allocate LPM buffer memory to DAIs
2026-12-04 15:53 ` [PATCH v3 15/19] ASoC: qcom: lpass: allocate LPM buffer memory to DAIs Neil Armstrong
@ 2026-12-04 17:33 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 17:33 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [High] ASoC: qcom: lpass: invalid free_pages_exact() on memremap() LPM
MI2S buffer
- [High] ASoC: qcom: lpass: sub-page LPM mmap truncation on 16K/64K page
kernels
- [High] ASoC: qcom: lpass: ungated VA/RXTX LPAIF claims collide with
MI2S
- [Medium] ASoC: qcom: lpass: integer underflow in
lpass_platform_allocate_lpm()
- [Medium] ASoC: qcom: lpass: unchecked memremap() in LPM MI2S buffer
preallocation
- [Medium] ASoC: qcom: lpass: unallocated LPM MI2S/VA ports alias LPM
offset 0
--
commit 71c551f2b5aa91ab705a2ec65862eb114db212ae
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: lpass: allocate LPM buffer memory to DAIs
This commit dynamically allocates LPM buffer slices across Codec DMA and
LPM-backed MI2S ports instead of using static offsets, and wires LPM MI2S
streams to preallocate, copy, and mmap their DMA buffers in LPM memory.
> diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
> index a83507c2cd557..8b005a87d4088 100644
> --- a/sound/soc/qcom/lpass-cpu.c
> +++ b/sound/soc/qcom/lpass-cpu.c
> @@ -1169,6 +1169,8 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
> data->codec_dma_enable = 1;
> if (is_wsa_cdc_dma_port(id))
> data->wsa_enable = 1;
> + else if (!is_rxtx_cdc_dma_port(id))
> + data->va_enable = 1;
> } else if (is_mi2s_port_id(id)) {
> unsigned int port_id = mi2s_port_id(id);
[Severity: High]
Should va_enable also gate the VA LPAIF MMIO and IRQ setup, along with a
matching rxtx_enable flag for the RXTX LPAIF?
Under drvdata->codec_dma_enable, asoc_qcom_lpass_cpu_platform_probe() still
unconditionally calls devm_platform_ioremap_resource_byname() for both
"lpass-rxtx-lpaif" and "lpass-va-lpaif", and
asoc_qcom_lpass_platform_register() unconditionally requests
"lpass-irq-rxtxif" and "lpass-irq-vaif" without IRQF_SHARED.
When a board enables Codec DMA on one LPAIF alongside an MI2S port on
lpass-va-lpaif or lpass-rxtx-lpaif, lpass_cpu_init_lpaif() and
lpass_platform_init_lpaif() request the same MMIO region and non-shared IRQ
a second time, failing probe with -EBUSY. Without rxtx_enable,
lpass_platform_allocate_lpm() also unconditionally deducts 16 KiB of RXTX
LPM even when only VA or WSA Codec DMA is enabled.
[ ... ]
> diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
> index 5f6fc6063f3a8..d8726e1c52e62 100644
> --- a/sound/soc/qcom/lpass-platform.c
> +++ b/sound/soc/qcom/lpass-platform.c
[ ... ]
> @@ -1038,9 +1070,10 @@ static int lpass_platform_pcmops_mmap(struct snd_soc_component *component,
> {
> struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
> struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
> + struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
> unsigned int dai_id = cpu_dai->driver->id;
>
> - if (is_cdc_dma_port(dai_id))
> + if (is_cdc_dma_port(dai_id) || is_lpm_mi2s_port(drvdata, dai_id))
> return lpass_platform_cdc_dma_mmap(substream, vma);
>
> return snd_pcm_lib_default_mmap(substream, vma);
[Severity: High]
Does routing LPM MI2S streams to lpass_platform_cdc_dma_mmap() break mmap()
and expose adjacent memory on 16 KiB or 64 KiB page kernels?
lpass_platform_prealloc_lpm_mi2s_buffer() places 8 KiB playback and capture
buffers back-to-back at 0x2000 spacing, and lpass_platform_allocate_lpm()
places VA-LPM MI2S buffers after a 12 KiB VA Codec DMA buffer.
Because lpass_platform_cdc_dma_mmap() shifts (runtime->dma_addr + offset)
right by PAGE_SHIFT without checking PAGE_ALIGNED(runtime->dma_addr) or
runtime->dma_bytes >= PAGE_SIZE, the sub-page offset is truncated on 16 KiB
or 64 KiB page ARM64 kernels: mmap() on capture maps the playback buffer
instead, and snd_pcm_mmap_data() rounds dma_bytes up to PAGE_SIZE, letting
unprivileged audio userspace map adjacent LPM streams or MMIO space outside
the LPM resource.
[ ... ]
> @@ -1289,6 +1322,41 @@ static irqreturn_t lpass_platform_wsaif_irq(int irq, void *data)
> return IRQ_HANDLED;
> }
>
> +static int lpass_platform_prealloc_lpm_mi2s_buffer(struct snd_soc_component *component,
> + struct snd_pcm *pcm, int dai_id)
> +{
> + struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
> + unsigned int port_id = mi2s_port_id(dai_id);
> + struct snd_pcm_substream *substream;
> + struct snd_dma_buffer *buf;
> + u32 addr;
> + int dir;
> +
> + if (drvdata->mi2s_lpm[port_id] == LPASS_VA_CDC_LPM)
> + addr = drvdata->va_cdc_dma_lpm_buf;
> + else
> + addr = drvdata->rxtx_cdc_dma_lpm_buf;
> + addr += drvdata->mi2s_lpm_offset[port_id];
> +
> + /* Playback and capture buffers are allocated one after the other */
> + for (dir = SNDRV_PCM_STREAM_PLAYBACK; dir <= SNDRV_PCM_STREAM_CAPTURE; dir++) {
> + substream = pcm->streams[dir].substream;
> + if (!substream)
> + continue;
> +
> + buf = &substream->dma_buffer;
> + buf->dev.dev = pcm->card->dev;
> + buf->dev.type = SNDRV_DMA_TYPE_CONTINUOUS;
> + buf->private_data = NULL;
> + buf->bytes = lpass_platform_lpm_mi2s_hardware.buffer_bytes_max;
> + buf->addr = addr + dir * LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE;
> + buf->area = (unsigned char * __force)memremap(buf->addr, buf->bytes,
> + MEMREMAP_WC);
[Severity: High]
Will PCM teardown pass this memremap() address to free_pages_exact()?
lpass_component_driver has no .pcm_free callback to call memunmap() and
clear buf->area. On driver unbind or card registration rollback,
snd_pcm_free() -> snd_pcm_lib_preallocate_free_for_all() -> do_free_pages()
sees a non-NULL dmab->area with SNDRV_DMA_TYPE_CONTINUOUS, hits WARN_ON in
decrease_allocated_size(), and calls snd_dma_continuous_free() ->
free_pages_exact() on the ioremap_wc() pointer, corrupting the page
allocator or crashing while leaking the mapping.
> + }
> +
> + return 0;
> +}
[Severity: Medium]
Can memremap() return NULL here and cause a NULL pointer dereference in
lpass_platform_copy()?
lpass_platform_prealloc_lpm_mi2s_buffer() ignores a NULL return from
memremap() and returns 0 with substream->dma_buffer.area left NULL.
Because lpass_component_driver sets .copy = lpass_platform_copy,
pcm_sanity_check() allows a NULL runtime->dma_area through to
lpass_platform_copy(), which dereferences it on PCM read/write. If capture
memremap() fails after playback succeeds, the playback mapping also needs
memunmap() and clearing to NULL before returning -ENOMEM.
[ ... ]
> @@ -1460,6 +1531,66 @@ static const struct snd_soc_component_driver lpass_component_driver = {
>
> };
>
> +static int lpass_platform_allocate_lpm(struct lpass_data *drvdata)
> +{
> + u32 rxtx_cdc_dma_lpm_remain = drvdata->rxtx_cdc_dma_lpm_size;
> + u32 va_cdc_dma_lpm_remain = drvdata->va_cdc_dma_lpm_size;
> + u32 rxtx_cdc_dma_lpm_offset = 0;
> + u32 va_cdc_dma_lpm_offset = 0;
> + int port_id;
> +
> + if (drvdata->codec_dma_enable) {
> + drvdata->rxtx_lpm_offset = rxtx_cdc_dma_lpm_offset;
> + rxtx_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
> + rxtx_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
> +
> + if (drvdata->va_enable) {
> + drvdata->va_lpm_offset = va_cdc_dma_lpm_offset;
> + va_cdc_dma_lpm_offset += LPASS_VA_CDC_DMA_LPM_BUFF_SIZE;
> + va_cdc_dma_lpm_remain -= LPASS_VA_CDC_DMA_LPM_BUFF_SIZE;
> + }
> +
> + if (drvdata->wsa_enable) {
> + drvdata->wsa_lpm_offset = rxtx_cdc_dma_lpm_offset;
> + rxtx_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
> + rxtx_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
> + }
> + }
[Severity: Medium]
What happens if an LPM resource is smaller than the enabled codec DMA
reservations?
Because rxtx_cdc_dma_lpm_remain and va_cdc_dma_lpm_remain are unsigned u32
counters and are decremented without checking remaining capacity first, an
undersized DT resource underflows near U32_MAX instead of returning
-EINVAL. That defeats the MI2S bounds checks below and hands out physical
addresses past the end of the LPM SRAM resource.
> +
> + if (!drvdata->mi2s_lpm_enable)
> + return 0;
> +
> + for (port_id = 0; port_id < LPASS_MAX_MI2S_PORTS; port_id++) {
> + if (!test_bit(port_id, &drvdata->lpaif_port_enable))
> + continue;
[Severity: Medium]
Can an MI2S port without a DT child node end up aliasing LPM offset 0?
lpass_cpu_init_lpaif() initializes an entire multi-port LPAIF whenever any
one of its ports is set in lpaif_port_enable,
asoc_qcom_lpass_cpu_platform_probe() populates mi2s_lpaif[port_id] and
mi2s_lpm[port_id] for all MI2S DAIs, and lpass_cpu_daiops_probe() only
checks lpaif->drvdata.
Because lpass_platform_allocate_lpm() skips ports not in lpaif_port_enable,
mi2s_lpm_offset[port_id] remains 0, so
lpass_platform_prealloc_lpm_mi2s_buffer() maps that sibling port on top of
the DAI allocated at offset 0. The same aliasing happens if
LPASS_CDC_DMA_VA_TX0 is linked with va_enable == 0 alongside an
LPASS_VA_CDC_LPM MI2S port.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=15
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 17/19] ASoC: qcom: add SM8650 LPASS CPU driver
2026-12-04 15:53 ` [PATCH v3 17/19] ASoC: qcom: add SM8650 LPASS CPU driver Neil Armstrong
@ 2026-12-04 17:42 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 17:42 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 8 potential
issues to consider:
- [High] ASoC: qcom: codec_dma_enable MMIO/IRQ claims collide with
SM8650 MI2S LPAIFs
- [High] ASoC: qcom: LPM memremap() mappings leak and hit
free_pages_exact() on teardown
- [Medium] ASoC: qcom: u32 underflow in lpass_platform_allocate_lpm()
- [Medium] ASoC: qcom: unchecked memremap() in LPM prealloc causes NULL
dereference
- [Medium] ASoC: qcom: sm8650 WRDMA channel range exceeds
LPASS_MAX_CDC_DMA_CHANNELS
- [Medium] ASoC: qcom: lpass: missing CDC DMA regcache sync on
suspend/resume
- [Low] ASoC: qcom: commit message omits Quaternary and Quinary MI2S
DAIs
- [Low] ASoC: qcom: unsigned underflow in lpass_platform_allocate_lpm()
--
commit 7cec95248eea9dc0ea78ea2e92f97a7dcf6185dd
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: add SM8650 LPASS CPU driver
This commit adds the SM8650 LPASS CPU driver variant with MI2S, DP, and
codec DMA DAIs, their LPAIF instances, clocks, and LPM DMA buffer
configurations.
> Add the SM8650 lpass-cpu variant with the Primary, Secondary, Tertiary,
> Senary & Septenary MI2S, DP and codec DMA DAIs, their LPAIF instances,
> clocks and LPM DMA buffers.
[Severity: Low]
This isn't a bug, but the commit message omits Quaternary and Quinary
MI2S even though sm8650_lpass_cpu_dai_driver[] and
sm8650_lpaif_mi2s_desc[] define all seven MI2S interfaces (Primary
through Septenary).
> diff --git a/sound/soc/qcom/lpass-sm8650.c b/sound/soc/qcom/lpass-sm8650.c
> new file mode 100644
> index 0000000000000..53c155e1b6396
> --- /dev/null
> +++ b/sound/soc/qcom/lpass-sm8650.c
> @@ -0,0 +1,653 @@
[ ... ]
> +static int sm8650_lpass_dev_suspend(struct device *dev)
> +{
> + struct lpass_data *drvdata = dev_get_drvdata(dev);
> +
> + clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
> + return 0;
> +}
> +
> +static const struct dev_pm_ops sm8650_lpass_pm_ops = {
> + SYSTEM_SLEEP_PM_OPS(sm8650_lpass_dev_suspend, sm8650_lpass_dev_resume)
> +};
[Severity: Medium]
Will CDC DMA streams lose their hardware DMA register state across system
suspend and resume?
lpass_platform_pcmops_suspend() and lpass_platform_pcmops_resume() in
sound/soc/qcom/lpass-platform.c only cache-only and regcache_sync()
hdmiif_map and lpaif[i].map, omitting rxtx_lpaif_map, va_lpaif_map, and
the newly exposed wsa_lpaif_map from commit "ASoC: qcom: lpass: add
support for optional WSA interface".
Because the CDC DMA descriptors advertise SNDRV_PCM_INFO_RESUME, resume
calls trigger(SNDRV_PCM_TRIGGER_RESUME) without prepare(). After LPASS
power collapse, LPAIF_DMABASE_REG, LPAIF_DMABUFF_REG, and LPAIF_DMAPER_REG
stay zeroed in hardware, breaking stream resume and pointer calculations.
[ ... ]
> + {
> + .reg_name = "lpass-rxtx-lpaif",
> + .irq_name = "lpass-irq-rxtxif",
> + .lpm_type = LPASS_RXTX_CDC_LPM,
> + .port_desc = (const struct mi2s_port_desc[]) {
> + { .intf = 0, .id = MI2S_QUATERNARY, },
> + },
> + .port_desc_count = 1,
> + },
> + {
> + .reg_name = "lpass-va-lpaif",
> + .irq_name = "lpass-irq-vaif",
> + .lpm_type = LPASS_VA_CDC_LPM,
> + .port_desc = (const struct mi2s_port_desc[]) {
> + { .intf = 0, .id = MI2S_QUINARY, },
> + },
> + .port_desc_count = 1,
> + },
[Severity: High]
Does enabling any Codec DMA DAI alongside MI2S_QUATERNARY or MI2S_QUINARY
fail probe with -EBUSY?
of_lpass_cpu_parse_dai_data() sets drvdata->codec_dma_enable for any
Codec DMA node (RXTX, VA, or WSA). asoc_qcom_lpass_cpu_platform_probe()
then exclusively maps both lpass-rxtx-lpaif and lpass-va-lpaif via
devm_platform_ioremap_resource_byname().
lpass_cpu_init_lpaif() then tries to map the same region again for
MI2S_QUATERNARY or MI2S_QUINARY and fails probe with -EBUSY, even on
non-conflicting boards such as WSA Codec DMA with MI2S_QUATERNARY.
asoc_qcom_lpass_platform_register() hits the same -EBUSY conflict by
requesting lpass-irq-rxtxif and lpass-irq-vaif without IRQF_SHARED
whenever codec_dma_enable is set. lpass_platform_allocate_lpm() also
unconditionally reserves 16 KiB for rxtx_lpm_offset when RXTX is unused.
> + {
> + .reg_name = "lpass-wsa-lpaif",
> + .irq_name = "lpass-irq-wsaif",
> + .lpm_type = LPASS_RXTX_CDC_LPM,
> + .port_desc = (const struct mi2s_port_desc[]) {
> + { .intf = 0, .id = MI2S_SENARY, },
> + },
> + .port_desc_count = 1,
> + },
[Severity: Medium]
Can rxtx_cdc_dma_lpm_remain underflow in lpass_platform_allocate_lpm()
when the DT LPM region is smaller than the Codec DMA reservation?
In sound/soc/qcom/lpass-platform.c (added in commit "ASoC: qcom: lpass:
allocate LPM buffer memory to DAIs"), lpass_platform_allocate_lpm()
subtracts LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2 from the unsigned u32
rxtx_cdc_dma_lpm_remain (twice when wsa_enable is set) without checking
that enough space remains:
sound/soc/qcom/lpass-platform.c:lpass_platform_allocate_lpm() {
...
if (drvdata->codec_dma_enable) {
drvdata->rxtx_lpm_offset = rxtx_cdc_dma_lpm_offset;
rxtx_cdc_dma_lpm_offset += LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
rxtx_cdc_dma_lpm_remain -= LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE * 2;
...
}
If the region is undersized, rxtx_cdc_dma_lpm_remain wraps to a large
positive value, defeating the subsequent LPASS_RXTX_CDC_LPM capacity
check for SM8650 MI2S ports and causing memremap() and
io_remap_pfn_range() to map physical addresses beyond the LPM window.
[Severity: Low]
Can va_cdc_dma_lpm_remain similarly underflow in
lpass_platform_allocate_lpm() when drvdata->va_enable is set?
The subtraction of LPASS_VA_CDC_DMA_LPM_BUFF_SIZE from the unsigned u32
va_cdc_dma_lpm_remain is also unchecked, so an undersized VA LPM DT
region wraps around and bypasses the LPASS_VA_CDC_LPM bounds check for
MI2S_QUINARY, assigning out-of-bounds physical addresses to memremap().
> + {
> + .reg_name = "lpass-aud-lpaif",
> + .irq_name = "lpass-irq-audif",
> + .lpm_type = LPASS_RXTX_CDC_LPM,
> + .port_desc = (const struct mi2s_port_desc[]) {
> + { .intf = 0, .id = MI2S_SEPTENARY, },
> + { .intf = 1, .id = MI2S_TERTIARY, },
> + },
> + .port_desc_count = 2,
> + },
[Severity: Medium]
Can an unchecked memremap() failure for SM8650 LPM MI2S buffers cause a
NULL pointer dereference in lpass_platform_copy()?
lpass_platform_prealloc_lpm_mi2s_buffer() (and
lpass_platform_prealloc_cdc_dma_buffer()) in
sound/soc/qcom/lpass-platform.c store memremap(buf->addr, buf->bytes,
MEMREMAP_WC) in buf->area without checking for NULL and return 0.
Because lpass_component_driver supplies .copy = lpass_platform_copy,
ALSA's pcm_sanity_check() skips its !runtime->dma_area check, so a
subsequent PCM read or write passes NULL plus offset to
copy_from_iter_toio() or copy_to_iter_fromio().
[Severity: High]
Do the LPM memremap() mappings leak and trigger free_pages_exact() on an
I/O mapping during PCM teardown?
lpass_platform_prealloc_lpm_mi2s_buffer() and
lpass_platform_prealloc_cdc_dma_buffer() set buf->dev.type to
SNDRV_DMA_TYPE_CONTINUOUS and assign an unmanaged memremap() pointer to
buf->area, while lpass_component_driver provides no .pcm_free callback.
On teardown or unbind, snd_pcm_free() -> do_free_pages() hits
WARN_ON(card->total_pcm_alloc_bytes < bytes) and passes the memremap()
address to free_pages_exact() instead of memunmap(), leaking the mapping
and risking page-allocator corruption.
[ ... ]
> + .rxtx_wrdma_channel_start = 5,
> + .rxtx_wrdma_channels = 4,
> + .va_wrdma_reg_base = 0x1a000,
> + .va_wrdma_reg_stride = 0x1000,
> + .va_wrdma_channel_start = 5,
> + .va_wrdma_channels = 3,
> + .va_irq_reg_base = 0x9000,
> + .va_irq_reg_stride = 0x1000,
> + .va_irq_ports = 5,
> + .wsa_irq_reg_base = 0x9000,
> + .wsa_irq_reg_stride = 0x1000,
> + .wsa_irq_ports = 5,
> + .wsa_wrdma_reg_base = 0x1a000,
> + .wsa_wrdma_reg_stride = 0x1000,
> + .wsa_wrdma_channel_start = 5,
> + .wsa_wrdma_channels = 4,
[Severity: Medium]
Can these WRDMA channel counts overflow drvdata->rxtx_substream[] and
drvdata->wsa_substream[]?
With channel_start = 5 and channels = 4, sm8650_lpass_alloc_dma_channel()
can allocate channel 8, exceeding LPASS_MAX_CDC_DMA_CHANNELS (8). Four
concurrently opened DAI links on LPASS_CDC_DMA_TX3 then write past
rxtx_substream[7] into va_substream[0] (or wsa_substream[8] into clks).
In addition, lpass_platform_rxtxif_irq() and lpass_platform_wsaif_irq()
only iterate up to LPASS_MAX_CDC_DMA_CHANNELS, so interrupts for channel
8 would never be serviced.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=17
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 18/19] ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai
2026-12-04 15:53 ` [PATCH v3 18/19] ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai Neil Armstrong
@ 2026-12-04 17:52 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 17:52 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] ASoC: qcom: sdw: qcom_snd_is_dsp_bypass_link() misclassifies
QAIF links
- [High] ASoC: qcom: sleep in atomic trigger context on
LPASS_CDC_DMA_WSA_RX0
--
commit 901b97812de99037ffb2d847d92ed32893b5f329
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai
This commit adds qcom_snd_is_dsp_bypass_link() to identify DSP bypass
links and restricts LPASS CPU DAI ID matching in qcom_snd_is_sdw_dai() to
those links, while also adding LPASS_CDC_DMA_WSA_RX0 as a SoundWire DAI.
> diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h
> index 37b185a4968f3..1af9c32505e61 100644
> --- a/sound/soc/qcom/common.h
> +++ b/sound/soc/qcom/common.h
> @@ -32,5 +32,14 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
> int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd,
> struct snd_soc_jack *dp_jack, int id);
>
> +/*
> + * DSP Bypass links (lpass-cpu) are neither DPCM frontends nor backends,
> + * their cpu dai ids overlap with the DSP dai ids.
> + */
> +static inline bool qcom_snd_is_dsp_bypass_link(struct snd_soc_pcm_runtime *rtd)
> +{
> + return !rtd->dai_link->no_pcm && !rtd->dai_link->dynamic;
> +}
[Severity: High]
Can qcom_snd_is_dsp_bypass_link() misclassify non-DSP QAIF links as
lpass-cpu links?
qcom_snd_parse_of() leaves both no_pcm and dynamic as 0 for any plain
CPU-to-codec DT link without a platform node, which includes QAIF links
such as shikra_qaif_cpu_dai_driver in sound/soc/qcom/qaif-shikra.c.
Unlike lpass-cpu, QAIF registers its SoundWire DAIs using
qcom,q6dsp-lpass-ports.h IDs (RX_CODEC_DMA_RX_0, RX_CODEC_DMA_RX_1,
VA_CODEC_DMA_TX_1), and sc8280xp_add_be_ops() attaches sc8280xp_be_ops to
those links.
Because qcom_snd_is_dsp_bypass_link() returns true for QAIF links,
qcom_snd_is_sdw_dai() returns false in its default branch without reaching
the second switch. qcom_snd_sdw_startup() then returns early without
allocating or setting sruntime, causing a NULL pointer dereference during
hw_params in qcom_swrm_hw_params() -> qcom_swrm_stream_alloc_ports() (and
in slave codec hw_params via sdw_stream_add_slave() ->
sdw_master_rt_find()).
Identifying the lpass-cpu component/driver directly rather than inferring
the DAI ID namespace from !no_pcm && !dynamic would avoid breaking QAIF
links.
> diff --git a/sound/soc/qcom/sdw.c b/sound/soc/qcom/sdw.c
> index e19adb7c750b0..b071d2a797885 100644
> --- a/sound/soc/qcom/sdw.c
> +++ b/sound/soc/qcom/sdw.c
> @@ -6,10 +6,25 @@
> #include <dt-bindings/sound/qcom,q6afe.h>
> #include <linux/module.h>
> #include <sound/soc.h>
> +#include "common.h"
> #include "sdw.h"
>
> -static bool qcom_snd_is_sdw_dai(int id)
> +static bool qcom_snd_is_sdw_dai(struct snd_soc_pcm_runtime *rtd)
> {
> + int id = snd_soc_rtd_to_cpu(rtd, 0)->id;
> +
> + /* DSP Bypass usecase, cpu dai ids overlap with DSP dai ids */
> + if (qcom_snd_is_dsp_bypass_link(rtd)) {
> + switch (id) {
> + case LPASS_CDC_DMA_TX3:
> + case LPASS_CDC_DMA_RX0:
> + case LPASS_CDC_DMA_WSA_RX0:
> + return true;
> + default:
> + return false;
> + }
> + }
[Severity: High]
Does enabling LPASS_CDC_DMA_WSA_RX0 on DSP bypass links trigger sleeping
in atomic context during PCM trigger?
qcom_snd_parse_of() only sets link->nonatomic = 1 for DPCM links, so DSP
bypass links remain atomic and ALSA holds spin_lock_irq across
soc_pcm_trigger(). lpass_platform_wsaif_irq() can also reach
soc_pcm_trigger(STOP) in hardirq context on DMA XRUN or error interrupts
via snd_pcm_stop_xrun() and snd_pcm_stop().
soc_pcm_trigger() -> snd_soc_pcm_dai_trigger() calls
snd_soc_dai_digital_mute() for codecs with .mute_unmute_on_trigger = true,
which both wsa884x and wsa883x set. Their mute_stream callbacks perform
SoundWire regmap writes (regmap_update_bits() -> sdw_transfer()), which
acquire sleeping mutexes (map->mutex and bus->msg_lock) and wait for bus
transfers while atomic or in hardirq context.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=18
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v3 19/19] ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu
2026-12-04 15:53 ` [PATCH v3 19/19] ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu Neil Armstrong
@ 2026-12-04 17:54 ` sashiko-bot
0 siblings, 0 replies; 30+ messages in thread
From: sashiko-bot @ 2026-12-04 17:54 UTC (permalink / raw)
To: Neil Armstrong; +Cc: linux-sound, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] ASoC: qcom: sc8280xp: unreachable DSP bypass branch in
sc8280xp_add_be_ops()
- [High] ASoC: qcom: common: qcom_snd_wcd_jack_setup() breaks Shikra
QAIF WCD jack
- [Medium] ASoC: qcom: sc8280xp: missing WCD jack cleanup on DSP Bypass
link exit
--
commit dace9fcff95da852db0ba7dfceee710b6ccfd008
Author: Neil Armstrong <neil.armstrong@linaro.org>
ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu
This commit adds LPASS CPU DAI init and ops callbacks to the sc8280xp
machine driver for non-DPCM DSP bypass links, and extends
qcom_snd_wcd_jack_setup() to attach the WCD headset jack on LPASS TX
codec DMA DAIs.
> diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
> index 77845d43c2194..4b7cda8070b30 100644
> --- a/sound/soc/qcom/common.c
> +++ b/sound/soc/qcom/common.c
[ ... ]
> @@ -420,26 +421,36 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
> if (rval)
> return rval;
>
> - switch (cpu_dai->id) {
> - case LPI_MI2S_RX_0:
> - case TX_CODEC_DMA_TX_0:
> - case TX_CODEC_DMA_TX_1:
> - case TX_CODEC_DMA_TX_2:
> - case TX_CODEC_DMA_TX_3:
> - case VA_CODEC_DMA_TX_1:
> - for_each_rtd_codec_dais(rtd, i, codec_dai) {
> - rval = snd_soc_component_set_jack(codec_dai->component,
> - jack, NULL);
> - if (rval != 0 && rval != -ENOTSUPP) {
> - dev_warn(card->dev, "Failed to set jack: %d\n", rval);
> - return rval;
> - }
> + if (qcom_snd_is_dsp_bypass_link(rtd)) {
> + switch (cpu_dai->id) {
> + case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX3:
> + break;
> + default:
> + return 0;
> + }
> + } else {
> + switch (cpu_dai->id) {
> + case LPI_MI2S_RX_0:
> + case TX_CODEC_DMA_TX_0:
> + case TX_CODEC_DMA_TX_1:
> + case TX_CODEC_DMA_TX_2:
> + case TX_CODEC_DMA_TX_3:
> + case VA_CODEC_DMA_TX_1:
> + break;
> + default:
> + return 0;
> }
> + }
>
> - break;
> - default:
> - break;
> + for_each_rtd_codec_dais(rtd, i, codec_dai) {
> + rval = snd_soc_component_set_jack(codec_dai->component,
> + jack, NULL);
> + if (rval != 0 && rval != -ENOTSUPP) {
> + dev_warn(card->dev, "Failed to set jack: %d\n", rval);
> + return rval;
> + }
> }
> +
> return 0;
> }
[Severity: High]
Does splitting on qcom_snd_is_dsp_bypass_link() regress WCD headset jack
setup on Shikra QAIF cards?
qcom_snd_is_dsp_bypass_link() returns true whenever neither no_pcm nor
dynamic is set. Shikra cards (qcom,shikra-cqm-sndcard and
qcom,shikra-cqs-sndcard) also use plain CPU-to-codec links with no
platform node, so both flags are zero, yet qaif-shikra.c uses Q6DSP DAI
IDs including VA_CODEC_DMA_TX_1 from commit 6d2524f0d360 ("ASoC: qcom:
sc8280xp: add backend handling for Shikra sound cards"). With this
change, VA_CODEC_DMA_TX_1 takes the bypass branch, misses
LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX3, and returns without calling
snd_soc_component_set_jack(), leaving the headset jack detached.
> diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> index f655b3ae1d5bf..89f14d4350059 100644
> --- a/sound/soc/qcom/sc8280xp.c
> +++ b/sound/soc/qcom/sc8280xp.c
[ ... ]
> @@ -570,6 +654,10 @@ static void sc8280xp_add_be_ops(struct snd_soc_card *card)
> link->exit = sc8280xp_snd_exit;
> link->be_hw_params_fixup = sc8280xp_be_hw_params_fixup;
> link->ops = &sc8280xp_be_ops;
> + } else if (!link->dynamic) {
> + /* DSP Bypass link, neither a DPCM frontend nor a backend */
> + link->init = sc8280xp_lpass_snd_init;
> + link->ops = &sc8280xp_lpass_ops;
> }
> }
> }
[Severity: High]
Is this new else if (!link->dynamic) branch unreachable dead code?
The preceding condition in sc8280xp_add_be_ops() already matches every
link where !link->dynamic is true:
sound/soc/qcom/sc8280xp.c:sc8280xp_add_be_ops() {
...
if (link->no_pcm == 1 || !link->dynamic) {
link->init = sc8280xp_snd_init;
link->exit = sc8280xp_snd_exit;
link->be_hw_params_fixup = sc8280xp_be_hw_params_fixup;
link->ops = &sc8280xp_be_ops;
} else if (!link->dynamic) {
...
}
Because sc8280xp_lpass_snd_init() and sc8280xp_lpass_ops are never
attached, lpass-cpu links keep using sc8280xp_snd_init() and
sc8280xp_be_ops. Due to overlapping DAI IDs, LPASS_CDC_DMA_TX0..TX3
collide with PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX in
sc8280xp_snd_hw_params() and fail hw_params with -ENOTSUPP when
mi2s_mclk_enable or mi2s_bclk_enable is set (lpass-cdc-dma DAIs have no
set_sysclk), while LPASS_CDC_DMA_WSA_RX0..1 skip the speaker volume
limits and LPASS_DP_RX skips DP jack setup.
Simply dropping || !link->dynamic from the first if would regress Shikra
QAIF cards from commit 6d2524f0d360 ("ASoC: qcom: sc8280xp: add backend
handling for Shikra sound cards"), which also have !no_pcm && !dynamic
links using Q6DSP DAI IDs, so lpass-cpu links need to be distinguished
from qaif-cpu links explicitly.
[Severity: Medium]
Can omitting link->exit for DSP bypass links cause a use-after-free on
data->jack.jack after card unbind and rebind?
sc8280xp_snd_data is devm-allocated on the card platform device, so
data->jack and data->jack_setup survive snd_soc_card_unbind() and
snd_soc_card_rebind() (for example on component unregister/re-register or
bind rollback). During unbind, snd_card_free() frees data->jack.jack
through snd_jack_dev_free(), while data->jack_setup stays true because no
link->exit callback resets it (and sc8280xp_snd_exit() only clears it for
SC8280XP_JACK_SETUP_CODEC).
When the card rebinds, sc8280xp_lpass_snd_init() ->
qcom_snd_wcd_jack_setup() -> qcom_snd_headset_jack_init() skips
recreating data->jack.jack because data->jack_setup is still true, and
re-attaches the dangling &data->jack to the WCD codec. The next headset
jack event in snd_soc_jack_report() -> snd_jack_report() then
dereferences the freed struct snd_jack.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-topic-sm8650-el2-v3-0-8384ef0ac751@linaro.org?part=19
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2026-12-04 17:54 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 15:53 [PATCH v3 00/19] arm64: qcom: enable SM8650 audio without ADSP firmware Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 01/19] ASoC: qcom: lpass-cpu: fix RXTX WRDMA current address register readability Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 02/19] ASoC: qcom: lpass-platform: disable the RXTX & VA DMA interrupts on stop Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 03/19] ASoC: dt-bindings: qcom,lpass: add Senary & Septenary MI2S ids Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 04/19] ASoC: dt-bindings: qcom,lpass: add WSA RX and TX channels ids Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 05/19] ASoC: dt-bindings: qcom,lpass-*-macro: document less clock when ADSP is not used Neil Armstrong
2026-12-04 16:20 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 06/19] ASoC: dt-bindings: qcom,lpass-cpu: document the SM8650 LPASS Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 07/19] ASoC: codecs: lpass-wsa-macro: handle the macro & dcodec power domains Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 08/19] ASoC: qcom: lpass-cpu: get the optional codec_mem3 clock Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 09/19] ASoC: qcom: lpass: add support for optional WSA interface Neil Armstrong
2026-12-04 16:49 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 10/19] ASoC: qcom: lpass-cdc-dma: add support for WSA codec DMA Neil Armstrong
2026-12-04 16:47 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 11/19] ASoC: qcom: lpass: prepare to handle multiple lpaifs for i2s Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 12/19] ASoC: qcom: lpass: add support for MI2S_SENARY & MI2S_SEPTENARY Neil Armstrong
2026-12-04 15:53 ` [PATCH v3 13/19] ASoC: qcom: lpass: support mapping I2S ports to multiple LPAIFs Neil Armstrong
2026-12-04 17:10 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 14/19] ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs Neil Armstrong
2026-12-04 17:08 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 15/19] ASoC: qcom: lpass: allocate LPM buffer memory to DAIs Neil Armstrong
2026-12-04 17:33 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 16/19] ASoC: qcom: lpass: enable the right codec_mem clock when usin LPM memory Neil Armstrong
2026-12-04 17:28 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 17/19] ASoC: qcom: add SM8650 LPASS CPU driver Neil Armstrong
2026-12-04 17:42 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 18/19] ASoC: qcom: sdw: allow LPASS_CDC_DMA_WSA_RX0 as soundwire dai Neil Armstrong
2026-12-04 17:52 ` sashiko-bot
2026-12-04 15:53 ` [PATCH v3 19/19] ASoC: qcom: sc8280xp: allow using the sc8280xp card with lpass-cpu Neil Armstrong
2026-12-04 17:54 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox