ASoC: Add LPASS VA CSR HeartBeat pulse clock support
Subsystems (5)
v2 cover ASoC: Add LPASS VA CSR HeartBeat pulse clock support
The LPASS VA CSR block contains rate generator hardware that produces a HeartBeat Pulse (also known as RateGen Pulse). This pulse synchronizes the start of the DMAs and Codec Interfaces for the audio usecases and can serve as a periodic wakeup source for the DSP.
This series adds the DT binding and driver support to model this rate generator as a clock provider, and extends the VA macro binding with a new hawi variant that consumes the heartbeatpulse clock alongside its existing mclk, macro, and dcodec clocks.
Patch 1 adds the YAML binding for the new qcom,hawi-lpass-va-csr clock provider node.
Patch 2 extends qcom,lpass-va-macro to describe the new qcom,hawi-lpass-va-macro compatible with its four-clock constraint.
Patch 3 adds the lpass-va-csr driver that registers the lpass_heartbeat_pulse clock and enables/disables the rate generator via regmap when the clock consumer requests it.
---
Changes in v2:
- Split the DT binding patch into two: one for the new
qcom,lpass-va-csr binding, one for the qcom,lpass-va-macro
extension (Srinivas).
- Fixed the qcom,lpass-va-csr example so it uses a 2-cell reg
under a proper #address-cells/#size-cells parent node, fixing
dt_binding_check (Rob).
- Switched the heartbeatpulse clk_ops from atomic
enable/disable/is_enabled to sleepable prepare/unprepare/is_prepared,
since regmap with a maple tree cache is not safe to call from the
raw spinlock context the atomic ops run under.
- Checked and propagated regmap_write()/regmap_read() return values
instead of ignoring them.
- Used regmap_set_bits()/regmap_clear_bits()/regmap_test_bits() instead
of manual regmap_update_bits()/regmap_read() combos (Konrad).
- Used lowercase hex for register offset defines (Konrad).
- Link to v1: https://lore.kernel.org/linux-arm-msm/[email protected]/
---
Sarath Ganapathiraju (3):
ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock
ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock
ASoC: Add LPASS VA CSR heartbeat pulse clock
.../bindings/sound/qcom,lpass-va-csr.yaml | 52 ++++++++ .../bindings/sound/qcom,lpass-va-macro.yaml | 18 +++ sound/soc/codecs/Kconfig | 13 ++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/lpass-va-csr.c | 143 +++++++++++++++++++++ 5 files changed, 228 insertions(+)
---
base-commit: 1a1757b76427f6201bfe0bf1bea9f7574f332a93
change-id: 20260714-master-ca87b5f19ae0
Best regards,
Signature · 1 line
Sarath Ganapathiraju <[email protected]>
PATCH v2 1/3 ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock
Add Qualcomm LPASS VA CSR rate generator node that exposes the lpass_heartbeat_pulse clock on hawi.
The HeartBeat Pulse (also known as RateGen Pulse) synchronizes the start of the DMAs and Codec Interfaces for the audio usecase and can serve as a periodic wakeup source for the DSP.
--- .../bindings/sound/qcom,lpass-va-csr.yaml | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+)
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +52 -0
@@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/qcom,lpass-va-csr.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm LPASS VA CSR heartbeat pulse clock provider + +maintainers: + - Srinivas Kandagatla <[email protected]> + - Sarath Ganapathiraju <[email protected]> + +description: + The LPASS VA CSR block contains the rate generator hardware which + produces the heartbeatpulse consumed by the Bolero codec macros + (rx, tx, wsa, va). It is modelled as a clock provider + so consumers can reference it by name in their clocks list. + +properties: + compatible: + enum: + - qcom,hawi-lpass-va-csr + + reg: + maxItems: 1 + description: Must cover the full VA CSR block (base 0x7EE0000, size 0xE000). + + "#clock-cells": + const: 0 + description: + Single clock output "lpass_heartbeat_pulse". Consumers reference + it by clock-name "heartbeatpulse" in their clocks list. + +required: + - compatible + - reg + - "#clock-cells" + +unevaluatedProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + va-csr@7ee0000 { + compatible = "qcom,hawi-lpass-va-csr"; + reg = <0x0 0x07ee0000 0x0 0xe000>; + #clock-cells = <0>; + }; + };
Signature · 1 line
2.34.1
Re: [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock
Quoted 20 lines · On 16/07/2026 21:51, Sarath Ganapathiraju via B4 Relay wrote:
From: Sarath Ganapathiraju <[email protected]>
Add Qualcomm LPASS VA CSR rate generator node that exposes the
lpass_heartbeat_pulseclock on hawi.The HeartBeat Pulse (also known as RateGen Pulse) synchronizes the start of the DMAs and Codec Interfaces for the audio usecase and can serve as a periodic wakeup source for the DSP.
Signed-off-by Sarath Ganapathiraju <[email protected]>--- .../bindings/sound/qcom,lpass-va-csr.yaml | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+)Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +0
-0
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml line 4
Quoted 4 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +4
-0@@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/qcom,lpass-va-csr.yaml#
I do not understand why a clock controller is part of sound. This makes little sense and desription does not help me.
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml line 17
Quoted 13 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +13
-0+$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm LPASS VA CSR heartbeat pulse clock provider + +maintainers: + - Srinivas Kandagatla <[email protected]> + - Sarath Ganapathiraju <[email protected]> + +description: + The LPASS VA CSR block contains the rate generator hardware which + produces the heartbeatpulse consumed by the Bolero codec macros + (rx, tx, wsa, va). It is modelled as a clock provider + so consumers can reference it by name in their clocks list.
Drop last syntax, explain the hardware, not duplicate schema as text.
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml line 26
Quoted 9 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +9
-0+ +properties: + compatible: + enum: + - qcom,hawi-lpass-va-csr + + reg: + maxItems: 1 + description: Must cover the full VA CSR block (base 0x7EE0000, size 0xE000).
Drop description, redundant. Why would not device MMIO address range cover full block?
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml line 32
Quoted 6 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +6
-0+ + "#clock-cells": + const: 0 + description: + Single clock output "lpass_heartbeat_pulse". Consumers reference + it by clock-name "heartbeatpulse" in their clocks list.
Drop description. Not even accurate. Consumers reference it however they wish and it is not any business of the provider.
From where did you take such style?
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml line 39
Quoted 7 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +7
-0+ +required: + - compatible + - reg + - "#clock-cells" + +unevaluatedProperties: false
And this...
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml line 47
Quoted 8 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +8
-0+ +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + va-csr@7ee0000 {
Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel sources for similar cases or you can grow the spec (via pull request to DT spec repo).
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml line 52
Quoted 6 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml new file +5
-0+ compatible = "qcom,hawi-lpass-va-csr"; + reg = <0x0 0x07ee0000 0x0 0xe000>; + #clock-cells = <0>; + }; + };
Best regards,
Krzysztof
Re: [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock
Quoted 2 lines · Krzysztof Kozlowski
I do not understand why a clock controller is part of sound. This makes little sense and desription does not help me.
Ack, will update in next revision.
Quoted 1 line
Drop last syntax, explain the hardware, not duplicate schema as text.
Ack, will update in next revision.
Quoted 2 lines
Drop description, redundant. Why would not device MMIO address range cover full block?
Ack, will update in next revision.
Quoted 2 lines
Drop description. Not even accurate. Consumers reference it however they wish and it is not any business of the provider.
Ack, will update in next revision.
Quoted 1 line
And this... [unevaluatedProperties: false]
Ack, will update in next revision.
Quoted 1 line
Node names should be generic.
Ack, will update in next revision.
Thanks,
Sarath
Re: [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock
In reply to Krzysztof KozlowskiQuoted 2 lines · Krzysztof Kozlowski
I do not understand why a clock controller is part of sound. This makes little sense and desription does not help me.
Ack, will update in next revision.
Quoted 1 line
Drop last syntax, explain the hardware, not duplicate schema as text.
Ack, will update in next revision.
Quoted 2 lines
Drop description, redundant. Why would not device MMIO address range cover full block?
Ack, will update in next revision.
Quoted 2 lines
Drop description. Not even accurate. Consumers reference it however they wish and it is not any business of the provider.
Ack, will update in next revision.
Quoted 1 line
And this... [unevaluatedProperties: false]
Ack, will update in next revision.
Quoted 1 line
Node names should be generic.
Ack, will update in next revision.
Thanks,
Sarath
PATCH v2 2/3 ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock
In reply to Sarath GanapathirajuExtend the qcom,lpass-va-macro to add the qcom,hawi-lpass-va-macro compatible, which consumes an additional heartbeatpulse clock alongside its existing mclk, macro, and dcodec clocks, for a total four-clock constraint.
--- .../devicetree/bindings/sound/qcom,lpass-va-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +18 -0
@@ -19,6 +19,7 @@ properties: - qcom,sm8450-lpass-va-macro - qcom,sm8550-lpass-va-macro - qcom,sc8280xp-lpass-va-macro + - qcom,hawi-lpass-va-macro - items: - enum: - qcom,eliza-lpass-va-macro
@@ -168,6 +169,23 @@ allOf: - const: macro - const: dcodec + - if: + properties: + compatible: + contains: + const: qcom,hawi-lpass-va-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: heartbeatpulse + unevaluatedProperties: false examples:
Signature · 1 line
2.34.1
Re: [PATCH v2 2/3] ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock
Quoted 15 lines · Sarath Ganapathiraju
Extend the qcom,lpass-va-macro to add the qcom,hawi-lpass-va-macro compatible, which consumes an additional heartbeatpulse clock alongside its existing mclk, macro, and dcodec clocks, for a total four-clock constraint.
Signed-off-by Sarath Ganapathiraju <[email protected]>--- .../devicetree/bindings/sound/qcom,lpass-va-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +0
-0
Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml properties: · line 22
Quoted 4 lines
Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +1
-0@@ -19,6 +19,7 @@ properties: - qcom,sm8450-lpass-va-macro - qcom,sm8550-lpass-va-macro - qcom,sc8280xp-lpass-va-macro + - qcom,hawi-lpass-va-macro
Put this as first entry, trying to keep alphanumerical sort.
Anyway, where is any user of this? Please carefully read submitting patches (both documents) since this breaks its rules.
Best regards,
Krzysztof
Re: [PATCH v2 2/3] ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock
Quoted 1 line · Krzysztof Kozlowski
Put this as first entry, trying to keep alphanumerical sort.
Ack, will update in next revision.
Quoted 2 lines
Anyway, where is any user of this? Please carefully read submitting patches (both documents) since this breaks its rules.
Thanks, Will remove in next version, as there is no in-tree user yet.
Thanks,
Sarath
Re: [PATCH v2 2/3] ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock
In reply to Krzysztof KozlowskiQuoted 1 line · Krzysztof Kozlowski
Put this as first entry, trying to keep alphanumerical sort.
Ack, will update in next revision.
Quoted 2 lines
Anyway, where is any user of this? Please carefully read submitting patches (both documents) since this breaks its rules.
Thanks, Will remove in next version, as there is no in-tree user yet.
Thanks,
Sarath
PATCH v2 3/3 ASoC: Add LPASS VA CSR heartbeat pulse clock
In reply to Sarath GanapathirajuThe HeartBeat Pulse (also known as RateGen Pulse) synchronizes the start of the DMAs and Codec Interfaces for the audio usecases and can serve as a periodic wakeup source for the DSP.
Add the LPASS VA CSR driver that models the rate generator as a clock provider so it is enabled and disabled automatically alongside the other clocks during runtime PM resume and suspend.
--- sound/soc/codecs/Kconfig | 13 ++++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/lpass-va-csr.c | 143 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+)
sound/soc/codecs/Kconfig +13 -0
@@ -2902,11 +2902,24 @@ config SND_SOC_LPASS_WSA_MACRO select SND_SOC_LPASS_MACRO_COMMON tristate "Qualcomm WSA Macro in LPASS(Low Power Audio SubSystem)" +config SND_SOC_LPASS_VA_CSR + depends on COMMON_CLK + select REGMAP_MMIO + tristate "Qualcomm LPASS VA CSR heartbeat pulse clock provider" + help + Qualcomm LPASS VA CSR block contains the rate generator hardware + that produces the HeartBeat Pulse (also known as RateGen Pulse). + This driver models the rate generator as a clock provider so + that consumers can enable or disable it via the common clock + framework, and it can be used to synchronize the start of DMAs + and Codec Interfaces or as a periodic wakeup source for the DSP. + config SND_SOC_LPASS_VA_MACRO depends on COMMON_CLK depends on PM_CLK select REGMAP_MMIO select SND_SOC_LPASS_MACRO_COMMON + select SND_SOC_LPASS_VA_CSR tristate "Qualcomm VA Macro in LPASS(Low Power Audio SubSystem)" config SND_SOC_LPASS_RX_MACRO
sound/soc/codecs/Makefile +2 -0
@@ -163,6 +163,7 @@ snd-soc-lpass-rx-macro-y := lpass-rx-macro.o snd-soc-lpass-tx-macro-y := lpass-tx-macro.o snd-soc-lpass-wsa-macro-y := lpass-wsa-macro.o snd-soc-lpass-va-macro-y := lpass-va-macro.o +snd-soc-lpass-va-csr-y := lpass-va-csr.o snd-soc-madera-y := madera.o snd-soc-max9759-y := max9759.o snd-soc-max9768-y := max9768.o
@@ -886,6 +887,7 @@ obj-$(CONFIG_SND_SOC_TPA6130A2) += snd-soc-tpa6130a2.o obj-$(CONFIG_SND_SOC_LPASS_MACRO_COMMON) += snd-soc-lpass-macro-common.o obj-$(CONFIG_SND_SOC_LPASS_WSA_MACRO) += snd-soc-lpass-wsa-macro.o obj-$(CONFIG_SND_SOC_LPASS_VA_MACRO) += snd-soc-lpass-va-macro.o +obj-$(CONFIG_SND_SOC_LPASS_VA_CSR) += snd-soc-lpass-va-csr.o obj-$(CONFIG_SND_SOC_LPASS_RX_MACRO) += snd-soc-lpass-rx-macro.o obj-$(CONFIG_SND_SOC_LPASS_TX_MACRO) += snd-soc-lpass-tx-macro.o
sound/soc/codecs/lpass-va-csr.c new file +143 -0
143 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v2 3/3] ASoC: Add LPASS VA CSR heartbeat pulse clock
Quoted 71 lines · Sarath Ganapathiraju
The HeartBeat Pulse (also known as RateGen Pulse) synchronizes the start of the DMAs and Codec Interfaces for the audio usecases and can serve as a periodic wakeup source for the DSP.
Add the LPASS VA CSR driver that models the rate generator as a clock provider so it is enabled and disabled automatically alongside the other clocks during runtime PM resume and suspend.
Signed-off-by Sarath Ganapathiraju <[email protected]>--- sound/soc/codecs/Kconfig | 13 ++++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/lpass-va-csr.c | 143 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+)sound/soc/codecs/Kconfig +13
-0@@ -2902,11 +2902,24 @@ config SND_SOC_LPASS_WSA_MACRO select SND_SOC_LPASS_MACRO_COMMON tristate "Qualcomm WSA Macro in LPASS(Low Power Audio SubSystem)" +config SND_SOC_LPASS_VA_CSR + depends on COMMON_CLK + select REGMAP_MMIO + tristate "Qualcomm LPASS VA CSR heartbeat pulse clock provider" + help + Qualcomm LPASS VA CSR block contains the rate generator hardware + that produces the HeartBeat Pulse (also known as RateGen Pulse). + This driver models the rate generator as a clock provider so + that consumers can enable or disable it via the common clock + framework, and it can be used to synchronize the start of DMAs + and Codec Interfaces or as a periodic wakeup source for the DSP. + config SND_SOC_LPASS_VA_MACRO depends on COMMON_CLK depends on PM_CLK select REGMAP_MMIO select SND_SOC_LPASS_MACRO_COMMON + select SND_SOC_LPASS_VA_CSR tristate "Qualcomm VA Macro in LPASS(Low Power Audio SubSystem)" config SND_SOC_LPASS_RX_MACROsound/soc/codecs/Makefile +2
-0@@ -163,6 +163,7 @@ snd-soc-lpass-rx-macro-y := lpass-rx-macro.o snd-soc-lpass-tx-macro-y := lpass-tx-macro.o snd-soc-lpass-wsa-macro-y := lpass-wsa-macro.o snd-soc-lpass-va-macro-y := lpass-va-macro.o +snd-soc-lpass-va-csr-y := lpass-va-csr.o snd-soc-madera-y := madera.o snd-soc-max9759-y := max9759.o snd-soc-max9768-y := max9768.o@@ -886,6 +887,7 @@ obj-$(CONFIG_SND_SOC_TPA6130A2) += snd-soc-tpa6130a2.o obj-$(CONFIG_SND_SOC_LPASS_MACRO_COMMON) += snd-soc-lpass-macro-common.o obj-$(CONFIG_SND_SOC_LPASS_WSA_MACRO) += snd-soc-lpass-wsa-macro.o obj-$(CONFIG_SND_SOC_LPASS_VA_MACRO) += snd-soc-lpass-va-macro.o +obj-$(CONFIG_SND_SOC_LPASS_VA_CSR) += snd-soc-lpass-va-csr.o obj-$(CONFIG_SND_SOC_LPASS_RX_MACRO) += snd-soc-lpass-rx-macro.o obj-$(CONFIG_SND_SOC_LPASS_TX_MACRO) += snd-soc-lpass-tx-macro.osound/soc/codecs/lpass-va-csr.c new file +1
-0@@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0-only
sound/soc/codecs/lpass-va-csr.c line 11
Quoted 10 lines
sound/soc/codecs/lpass-va-csr.c new file +10
-0+/* +* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +*/ + +#include <linux/clk-provider.h> +#include <linux/device.h> +#include <linux/module.h> +#include <linux/of_clk.h> +#include <linux/platform_device.h> +#include <linux/regmap.h>
Why a clock provider driver, which has nothing to do with ASoC and uses nothing from the ASoC, is placed in ASoC directory?
No, this is really wrong interpretation of Linux subsystems.
Best regards,
Krzysztof
Re: [PATCH v2 3/3] ASoC: Add LPASS VA CSR heartbeat pulse clock
Quoted 3 lines · Krzysztof Kozlowski
Why a clock provider driver, which has nothing to do with ASoC and uses nothing from the ASoC, is placed in ASoC directory?
No, this is really wrong interpretation of Linux subsystems.
Ack, Will Move to drivers/clk/qcom as suggest.
Thanks,
Sarath