* [PATCH v2 0/3] ASoC: Add LPASS VA CSR HeartBeat pulse clock support
@ 2026-07-16 19:51 Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock Sarath Ganapathiraju via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sarath Ganapathiraju via B4 Relay @ 2026-07-16 19:51 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
Cc: Srinivas Kandagatla, linux-sound, linux-arm-msm, devicetree,
linux-kernel, prasad.kumpatla, Konrad Dybcio,
Sarath Ganapathiraju
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.
Signed-off-by: Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
---
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/20260714-master-v1-0-1ebe5993225e@oss.qualcomm.com/
---
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,
--
Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock
2026-07-16 19:51 [PATCH v2 0/3] ASoC: Add LPASS VA CSR HeartBeat pulse clock support Sarath Ganapathiraju via B4 Relay
@ 2026-07-16 19:51 ` Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 2/3] ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 3/3] ASoC: Add LPASS VA CSR heartbeat pulse clock Sarath Ganapathiraju via B4 Relay
2 siblings, 0 replies; 4+ messages in thread
From: Sarath Ganapathiraju via B4 Relay @ 2026-07-16 19:51 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
Cc: Srinivas Kandagatla, linux-sound, linux-arm-msm, devicetree,
linux-kernel, prasad.kumpatla, Konrad Dybcio,
Sarath Ganapathiraju
From: Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
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.
Signed-off-by: Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
---
.../bindings/sound/qcom,lpass-va-csr.yaml | 52 ++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml
new file mode 100644
index 0000000000..131debb04f
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-csr.yaml
@@ -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 <srinivas.kandagatla@oss.qualcomm.com>
+ - Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
+
+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>;
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/3] ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock
2026-07-16 19:51 [PATCH v2 0/3] ASoC: Add LPASS VA CSR HeartBeat pulse clock support Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock Sarath Ganapathiraju via B4 Relay
@ 2026-07-16 19:51 ` Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 3/3] ASoC: Add LPASS VA CSR heartbeat pulse clock Sarath Ganapathiraju via B4 Relay
2 siblings, 0 replies; 4+ messages in thread
From: Sarath Ganapathiraju via B4 Relay @ 2026-07-16 19:51 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
Cc: Srinivas Kandagatla, linux-sound, linux-arm-msm, devicetree,
linux-kernel, prasad.kumpatla, Konrad Dybcio,
Sarath Ganapathiraju
From: Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
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 <sarath.ganapathiraju@oss.qualcomm.com>
---
.../devicetree/bindings/sound/qcom,lpass-va-macro.yaml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
index aea31fbdad..ae4df89678 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
@@ -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:
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 3/3] ASoC: Add LPASS VA CSR heartbeat pulse clock
2026-07-16 19:51 [PATCH v2 0/3] ASoC: Add LPASS VA CSR HeartBeat pulse clock support Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 2/3] ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock Sarath Ganapathiraju via B4 Relay
@ 2026-07-16 19:51 ` Sarath Ganapathiraju via B4 Relay
2 siblings, 0 replies; 4+ messages in thread
From: Sarath Ganapathiraju via B4 Relay @ 2026-07-16 19:51 UTC (permalink / raw)
To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
Cc: Srinivas Kandagatla, linux-sound, linux-arm-msm, devicetree,
linux-kernel, prasad.kumpatla, Konrad Dybcio,
Sarath Ganapathiraju
From: Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
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 <sarath.ganapathiraju@oss.qualcomm.com>
---
sound/soc/codecs/Kconfig | 13 ++++
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/lpass-va-csr.c | 143 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 158 insertions(+)
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 76e90144ea..5dbfa77d0e 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -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
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index aa0396e5b5..3e86c1bbf9 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -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
diff --git a/sound/soc/codecs/lpass-va-csr.c b/sound/soc/codecs/lpass-va-csr.c
new file mode 100644
index 0000000000..1d0805789e
--- /dev/null
+++ b/sound/soc/codecs/lpass-va-csr.c
@@ -0,0 +1,143 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * 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>
+
+#define LPASS_RATE_GEN_CTRL 0xd000
+#define LPASS_RATE_GEN_COUNTER_0 0xd004
+#define LPASS_RATE_GEN_DELAY 0xd010
+
+#define LPASS_RATE_GEN_MAX_REG LPASS_RATE_GEN_DELAY
+
+#define LPASS_RG_CTRL_EN BIT(0)
+
+struct lpass_va_csr_data {
+ u32 counter_0;
+ u32 delay;
+};
+
+static const struct lpass_va_csr_data hawi_csr_data = {
+ .counter_0 = 0x960,
+ .delay = 0x16,
+};
+
+static const struct regmap_config lpass_rate_gen_regmap_config = {
+ .name = "lpass_rate_gen",
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .max_register = LPASS_RATE_GEN_MAX_REG,
+ .cache_type = REGCACHE_MAPLE,
+};
+
+struct lpass_va_csr {
+ struct regmap *regmap;
+ const struct lpass_va_csr_data *data;
+ struct clk_hw hb_hw;
+};
+
+#define to_lpass_va_csr(_hw) container_of(_hw, struct lpass_va_csr, hb_hw)
+
+static int heartbeat_pulse_prepare(struct clk_hw *hw)
+{
+ struct lpass_va_csr *csr = to_lpass_va_csr(hw);
+ int ret;
+
+ ret = regmap_write(csr->regmap, LPASS_RATE_GEN_COUNTER_0, csr->data->counter_0);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(csr->regmap, LPASS_RATE_GEN_DELAY, csr->data->delay);
+ if (ret)
+ return ret;
+
+ return regmap_set_bits(csr->regmap, LPASS_RATE_GEN_CTRL, LPASS_RG_CTRL_EN);
+}
+
+static void heartbeat_pulse_unprepare(struct clk_hw *hw)
+{
+ struct lpass_va_csr *csr = to_lpass_va_csr(hw);
+
+ regmap_clear_bits(csr->regmap, LPASS_RATE_GEN_CTRL, LPASS_RG_CTRL_EN);
+}
+
+static int heartbeat_pulse_is_prepared(struct clk_hw *hw)
+{
+ struct lpass_va_csr *csr = to_lpass_va_csr(hw);
+
+ return regmap_test_bits(csr->regmap, LPASS_RATE_GEN_CTRL, LPASS_RG_CTRL_EN);
+}
+
+static const struct clk_ops heartbeat_pulse_ops = {
+ .prepare = heartbeat_pulse_prepare,
+ .unprepare = heartbeat_pulse_unprepare,
+ .is_prepared = heartbeat_pulse_is_prepared,
+};
+
+static int lpass_va_csr_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct lpass_va_csr *csr;
+ struct clk_init_data init = {
+ .name = "lpass_heartbeat_pulse",
+ .ops = &heartbeat_pulse_ops,
+ };
+ void __iomem *base;
+ int ret;
+
+ csr = devm_kzalloc(dev, sizeof(*csr), GFP_KERNEL);
+ if (!csr)
+ return -ENOMEM;
+
+ csr->data = of_device_get_match_data(dev);
+ if (!csr->data)
+ return dev_err_probe(dev, -EINVAL, "no variant data for compatible\n");
+
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ csr->regmap = devm_regmap_init_mmio(dev, base,
+ &lpass_rate_gen_regmap_config);
+ if (IS_ERR(csr->regmap))
+ return dev_err_probe(dev, PTR_ERR(csr->regmap),
+ "failed to init regmap\n");
+
+ csr->hb_hw.init = &init;
+
+ ret = devm_clk_hw_register(dev, &csr->hb_hw);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to register heartbeat clock\n");
+
+ ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &csr->hb_hw);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to add clock provider\n");
+
+ return 0;
+}
+
+static const struct of_device_id lpass_va_csr_dt_match[] = {
+ { .compatible = "qcom,hawi-lpass-va-csr", .data = &hawi_csr_data },
+ {}
+};
+MODULE_DEVICE_TABLE(of, lpass_va_csr_dt_match);
+
+static struct platform_driver lpass_va_csr_driver = {
+ .driver = {
+ .name = "qcom-lpass-va-csr",
+ .of_match_table = lpass_va_csr_dt_match,
+ },
+ .probe = lpass_va_csr_probe,
+};
+
+module_platform_driver(lpass_va_csr_driver);
+
+MODULE_DESCRIPTION("Qualcomm LPASS VA CSR heartbeat pulse clock provider");
+MODULE_LICENSE("GPL");
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-16 19:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 19:51 [PATCH v2 0/3] ASoC: Add LPASS VA CSR HeartBeat pulse clock support Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 1/3] ASoC: dt-bindings: qcom,lpass-va-csr: Add HeartBeat pulse clock Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 2/3] ASoC: dt-bindings: qcom,lpass-va-macro: Add hawi heartbeatpulse clock Sarath Ganapathiraju via B4 Relay
2026-07-16 19:51 ` [PATCH v2 3/3] ASoC: Add LPASS VA CSR heartbeat pulse clock Sarath Ganapathiraju via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox