Skip to contentSkip to conversation

Add LPASS VA CSR HeartBeat pulse clock support

PATCH Superseded Sarath Ganapathiraju 6 participants 8 messages Sep 17 – Sep 28

Subsystems (4)

v8 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

v8 cover 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.

Patch 1 adds the YAML binding for the new qcom,hawi-lpass-va-csr clock provider node under Documentation/devicetree/bindings/clock/.

Patch 2 adds the lpass-va-csr driver under drivers/clk/qcom that registers the lpass_heartbeat_pulse clock and enables/disables the rate generator via regmap when the clock consumer requests it.

Changes in v8:
- Rebase the series on linux-next next-20260916.
- Require the LPASS LPR and audio vote clocks to access VA CSR
register space safely.
- Attach the DT vote clocks to runtime PM and resume the device before
programming the rate generator registers.
- Program the counter and delay registers once during probe.
- Use qcom's simple regmap gate ops for the enable bit (Srinivas).
- Drop the unreachable of_device_get_match_data() NULL check (Srinivas).
- Drop stale Reviewed-by/Tested-by tags after the binding and driver
changes.
- Link to v7: https://patch.msgid.link/20260831-heartbeat-v7-next-20260828-v7-0-e3ffeac46a51@oss.qualcomm.com

Changes in v7:
- Rebase the series on linux-next next-20260828.
- Add Prasad's Reviewed-by and Tested-by tags to patch 2.
- Link to v6: https://patch.msgid.link/20260821-heartbeat-v6-next-20260821-send-v6-0-62c5df84ce21@oss.qualcomm.com

Changes in v6:
- Rebase the series on linux-next next-20260821.
- Capitalize Hawi in binding text (Bjorn).
- Simplify the binding example by removing the soc wrapper and
two-cell address/size setup (Bjorn).
- Keep the full VA CSR register window in the binding and describe it
as the VA CSR register block after Konrad clarified the earlier
register-range concern (Bjorn, Konrad).
- Link to v5: https://patch.msgid.link/[email protected]

Changes in v5:
- Add explicit ARM64 Kconfig gating and Qualcomm default-module policy
for QCOM_CLK_LPASS_HEARTBEAT_PULSE to align with nearby qcom clock
entries.
- Link to v4: https://patch.msgid.link/[email protected]

Changes in v4:
- Rename the binding filename and schema ID to hawi-specific naming:
qcom,lpass-va-csr.yaml -> qcom,hawi-lpass-va-csr.yaml (Krzysztof).
- Rename Kconfig symbol QCOM_CLK_LPASS_VA_CSR to QCOM_CLK_LPASS_HEARTBEAT_PULSE (Konrad).
- Add devm_pm_runtime_enable() in the lpass-va-csr probe path.
- Drop the qcom,lpass-va-macro binding extension patch; it will be
resubmitted with the Hawi DTSI changes.
- Drop sound/soc/codecs/Kconfig select wiring to keep this series
clock-only (Konrad).
- Link to v3: https://lore.kernel.org/all/[email protected]/

Changes in v3:
- Move the qcom,lpass-va-csr binding under Documentation/devicetree/bindings/clock/ (Krzysztof).
- Move the driver under drivers/clk/qcom/ (Krzysztof).
- Improve the schema description and use generic clock-controller node naming (Krzysztof).
- Use additionalProperties: false and keep compatibles sorted.

Changes in v2:
- Split the qcom,lpass-va-csr and qcom,lpass-va-macro bindings into separate patches.

Changes in v1:
- Initial version

---
Sarath Ganapathiraju (2):
dt-bindings: clock: qcom: Add LPASS VA CSR HeartBeat pulse clock
clk: qcom: Add LPASS VA CSR heartbeat pulse clock

 .../bindings/clock/qcom,hawi-lpass-va-csr.yaml     |  62 +++++++++
 drivers/clk/qcom/Kconfig                           |  14 +++
 drivers/clk/qcom/Makefile                          |   1 +
 drivers/clk/qcom/lpass-va-csr.c                    | 140 +++++++++++++++++++++
 4 files changed, 217 insertions(+)

---
base-commit: 0d9d0dbf2fddcff5859d623e90ca73c4054276e1
change-id: 20260917-master-6c2778f57a9a

Best regards,

Signature · 1 line
Sarath Ganapathiraju <[email protected]>
#1 lore raw

PATCH v8 1/2 dt-bindings: clock: qcom: Add LPASS VA CSR HeartBeat pulse clock

Add a binding for the 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 DMAs and Codec Interfaces for the audio usecase and can serve as a periodic wakeup source for the DSP.

Require the LPASS LPR and audio vote clocks to access VA CSR register space safely.

---
 .../bindings/clock/qcom,hawi-lpass-va-csr.yaml     | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)
Documentation/devicetree/bindings/clock/qcom,hawi-lpass-va-csr.yaml new file +62 -0
new file mode 100644
index 000000000000..601da83add2b
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,hawi-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 Hawi LPASS (Low Power Audio Subsystem) VA CSR block contains a
+  rate generator that produces a periodic HeartBeat Pulse, also known
+  as the RateGen Pulse. This pulse synchronizes the start of DMAs and
+  Codec Interfaces for audio usecases and can serve as a periodic wakeup
+  source for the DSP.
+
+properties:
+  compatible:
+    enum:
+      - qcom,hawi-lpass-va-csr
+
+  reg:
+    maxItems: 1
+    description: Address and size of the VA CSR register block.
+
+  clocks:
+    items:
+      - description: LPASS LPR (Low Power Resource) voting clock
+      - description: LPASS Audio voting clock
+
+  clock-names:
+    items:
+      - const: lpr
+      - const: audio
+
+  "#clock-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/sound/qcom,q6dsp-lpass-ports.h>
+
+    clock-controller@7ee0000 {
+      compatible = "qcom,hawi-lpass-va-csr";
+      reg = <0x07ee0000 0xe000>;
+      clocks = <&q6prmcc LPASS_HW_LPR_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+               <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+      clock-names = "lpr", "audio";
+      #clock-cells = <0>;
+    };
Signature · 1 line
2.34.1
maintainer Reviewed-by on v8 1/2
#2 lore raw

Re: [PATCH v8 1/2] dt-bindings: clock: qcom: Add LPASS VA CSR HeartBeat pulse clock

Quoted 7 lines · Sarath Ganapathiraju

Add a binding for the 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 DMAs and Codec Interfaces for the audio usecase and can serve as a periodic wakeup source for the DSP.

Quoted 8 lines

Require the LPASS LPR and audio vote clocks to access VA CSR register space safely.

---
 .../bindings/clock/qcom,hawi-lpass-va-csr.yaml     | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)
#3 lore raw

PATCH v8 2/2 clk: qcom: Add LPASS VA CSR heartbeat pulse clock

In reply to Sarath Ganapathiraju

The HeartBeat Pulse, also known as RateGen Pulse, synchronizes the start of 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.

Attach the DT vote clocks to runtime PM and resume the device before programming the rate generator registers, so register accesses happen only after the LPASS votes are active.

---
 drivers/clk/qcom/Kconfig        |  14 ++++
 drivers/clk/qcom/Makefile       |   1 +
 drivers/clk/qcom/lpass-va-csr.c | 140 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 155 insertions(+)
drivers/clk/qcom/Kconfig +14 -0
index 6ef083f5d9e2..32172f2dfe3c 100644
@@ -2116,6 +2116,20 @@ config CLK_GFM_LPASS_SM8250
 	  Support for the Glitch Free Mux (GFM) Low power audio
           subsystem (LPASS) clocks found on SM8250 SoCs.
 
+config QCOM_CLK_LPASS_HEARTBEAT_PULSE
+	tristate "Qualcomm LPASS VA CSR heartbeat pulse clock provider"
+	depends on COMMON_CLK
+	depends on ARM64 || COMPILE_TEST
+	select REGMAP_MMIO
+	default m if ARCH_QCOM
+	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 SM_VIDEOCC_8450
 	tristate "SM8450 Video Clock Controller"
 	depends on ARM64 || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
index a6c676f68b79..66c8501c21a3 100644
@@ -28,6 +28,7 @@ obj-$(CONFIG_CLK_ELIZA_GPUCC) += gpucc-eliza.o
 obj-$(CONFIG_CLK_ELIZA_TCSRCC) += tcsrcc-eliza.o
 obj-$(CONFIG_CLK_ELIZA_VIDEOCC) += videocc-eliza.o
 obj-$(CONFIG_CLK_GFM_LPASS_SM8250) += lpass-gfm-sm8250.o
+obj-$(CONFIG_QCOM_CLK_LPASS_HEARTBEAT_PULSE) += lpass-va-csr.o
 obj-$(CONFIG_CLK_GLYMUR_CAMCC) += camcc-glymur.o
 obj-$(CONFIG_CLK_GLYMUR_DISPCC) += dispcc-glymur.o
 obj-$(CONFIG_CLK_GLYMUR_EVACC) += evacc-glymur.o
drivers/clk/qcom/lpass-va-csr.c new file +140 -0

140 lines not on this page · raw message

Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH v8 2/2] clk: qcom: Add LPASS VA CSR heartbeat pulse clock

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] clk: qcom: lpass: missing pm_clk callbacks causes unclocked hardware access - [Medium] clk: qcom…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] clk: qcom: lpass: missing pm_clk callbacks causes unclocked hardware access
- [Medium] clk: qcom: lpass: async pm_runtime_put() races with devres pm_runtime_disable() --

commit 5684759a56eb84ac05a7585939de6fdaa87b92de
Author: Sarath Ganapathiraju <[email protected]>

clk: qcom: Add LPASS VA CSR heartbeat pulse clock

The HeartBeat Pulse, also known as RateGen Pulse, synchronizes the start of 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. Attach the DT vote clocks to runtime PM and resume the device before programming the rate generator registers, so register accesses happen only after the LPASS votes are active.

Quoted 5 lines
drivers/clk/qcom/lpass-va-csr.c new file +0 -0
new file mode 100644
index 0000000000000..3c87c3319f156

[ ... ]

drivers/clk/qcom/lpass-va-csr.c line 121

Quoted 13 lines
drivers/clk/qcom/lpass-va-csr.c new file +13 -0
+	ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &csr->hb.hw);
+	if (ret)
+		goto err_pm_runtime_put;
+
+	pm_runtime_put(dev);
+
+	return 0;
+
+err_pm_runtime_put:
+	pm_runtime_put(dev);
+
+	return ret;
+}

[Severity: Medium]
Will this asynchronous pm_runtime_put() race with the devres cleanup?

When probe fails, err_pm_runtime_put calls pm_runtime_put(), which queues an asynchronous suspend. The probe function also uses devm_pm_runtime_enable(), which queues a devres cleanup action that calls pm_runtime_disable() on failure.

After the function returns, devres cleanup will invoke pm_runtime_disable(), cancelling the pending asynchronous suspend request. This leaves the device permanently active and its vote clocks enabled.

Could pm_runtime_put_sync() be used here instead to ensure the suspend completes synchronously before devres cleanup?

[ ... ]

drivers/clk/qcom/lpass-va-csr.c line 135

Quoted 7 lines
drivers/clk/qcom/lpass-va-csr.c new file +7 -0
+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,
+};

[Severity: High]
Does this driver need a dev_pm_ops structure assigned to handle the PM clock callbacks?

The driver registers DT vote clocks using of_pm_clk_add_clks(), relying on the PM framework to enable them during runtime resume. Without assigning a dev_pm_ops structure mapped to pm_clk_suspend and pm_clk_resume in the platform_driver, pm_runtime_resume_and_get() sets the device state to active but leaves the clocks physically disabled.

Will the subsequent regmap_write() attempts in probe try to access unclocked hardware registers and trigger a synchronous external abort on Qualcomm platforms?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Reviewed-by on v8 2/2
#5 lore raw

Re: [PATCH v8 2/2] clk: qcom: Add LPASS VA CSR heartbeat pulse clock

In reply to Sarath Ganapathiraju
Quoted 10 lines · On 9/17/26 2:57 PM, Sarath Ganapathiraju via B4 Relay wrote:

From: Sarath Ganapathiraju <[email protected]>

The HeartBeat Pulse, also known as RateGen Pulse, synchronizes the start of 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.

Quoted 5 lines

Attach the DT vote clocks to runtime PM and resume the device before programming the rate generator registers, so register accesses happen only after the LPASS votes are active.

Lgtm,

--srini

Quoted 190 lines
---
 drivers/clk/qcom/Kconfig        |  14 ++++
 drivers/clk/qcom/Makefile       |   1 +
 drivers/clk/qcom/lpass-va-csr.c | 140 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 155 insertions(+)
drivers/clk/qcom/Kconfig +14 -0
index 6ef083f5d9e2..32172f2dfe3c 100644
@@ -2116,6 +2116,20 @@ config CLK_GFM_LPASS_SM8250
 	  Support for the Glitch Free Mux (GFM) Low power audio
           subsystem (LPASS) clocks found on SM8250 SoCs.
 
+config QCOM_CLK_LPASS_HEARTBEAT_PULSE
+	tristate "Qualcomm LPASS VA CSR heartbeat pulse clock provider"
+	depends on COMMON_CLK
+	depends on ARM64 || COMPILE_TEST
+	select REGMAP_MMIO
+	default m if ARCH_QCOM
+	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 SM_VIDEOCC_8450
 	tristate "SM8450 Video Clock Controller"
 	depends on ARM64 || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
index a6c676f68b79..66c8501c21a3 100644
@@ -28,6 +28,7 @@ obj-$(CONFIG_CLK_ELIZA_GPUCC) += gpucc-eliza.o
 obj-$(CONFIG_CLK_ELIZA_TCSRCC) += tcsrcc-eliza.o
 obj-$(CONFIG_CLK_ELIZA_VIDEOCC) += videocc-eliza.o
 obj-$(CONFIG_CLK_GFM_LPASS_SM8250) += lpass-gfm-sm8250.o
+obj-$(CONFIG_QCOM_CLK_LPASS_HEARTBEAT_PULSE) += lpass-va-csr.o
 obj-$(CONFIG_CLK_GLYMUR_CAMCC) += camcc-glymur.o
 obj-$(CONFIG_CLK_GLYMUR_DISPCC) += dispcc-glymur.o
 obj-$(CONFIG_CLK_GLYMUR_EVACC) += evacc-glymur.o
drivers/clk/qcom/lpass-va-csr.c new file +140 -0
new file mode 100644
index 000000000000..3c87c3319f15
@@ -0,0 +1,140 @@
+// 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/pm_clock.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+
+#include "clk-branch.h"
+#include "clk-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 clk_regmap hb;
+};
+
+static int lpass_va_csr_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	const struct lpass_va_csr_data *data = of_device_get_match_data(dev);
+	struct lpass_va_csr *csr;
+	struct clk_init_data init = {
+		.name = "lpass_heartbeat_pulse",
+		.ops = &clk_branch_simple_ops,
+	};
+	struct regmap *regmap;
+	void __iomem *base;
+	int ret;
+
+	csr = devm_kzalloc(dev, sizeof(*csr), GFP_KERNEL);
+	if (!csr)
+		return -ENOMEM;
+
+	base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	regmap = devm_regmap_init_mmio(dev, base,
+				       &lpass_rate_gen_regmap_config);
+	if (IS_ERR(regmap))
+		return dev_err_probe(dev, PTR_ERR(regmap),
+				     "failed to init regmap\n");
+
+	ret = devm_pm_runtime_enable(dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to enable PM runtime\n");
+
+	ret = devm_pm_clk_create(dev);
+	if (ret)
+		return ret;
+
+	ret = of_pm_clk_add_clks(dev);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "failed to get vote clocks\n");
+
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret)
+		return ret;
+
+	ret = regmap_write(regmap, LPASS_RATE_GEN_COUNTER_0, data->counter_0);
+	if (ret)
+		goto err_pm_runtime_put;
+
+	ret = regmap_write(regmap, LPASS_RATE_GEN_DELAY, data->delay);
+	if (ret)
+		goto err_pm_runtime_put;
+
+	csr->hb.regmap = regmap;
+	csr->hb.enable_reg = LPASS_RATE_GEN_CTRL;
+	csr->hb.enable_mask = LPASS_RG_CTRL_EN;
+	csr->hb.hw.init = &init;
+
+	ret = devm_clk_register_regmap(dev, &csr->hb);
+	if (ret)
+		goto err_pm_runtime_put;
+
+	ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &csr->hb.hw);
+	if (ret)
+		goto err_pm_runtime_put;
+
+	pm_runtime_put(dev);
+
+	return 0;
+
+err_pm_runtime_put:
+	pm_runtime_put(dev);
+
+	return ret;
+}
+
+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");
Reviewed-by Tested-by on v8 2/2
#6 lore raw

Re: [PATCH v8 2/2] clk: qcom: Add LPASS VA CSR heartbeat pulse clock

In reply to Sarath Ganapathiraju
Quoted 10 lines · On 9/17/2026 7:27 PM, Sarath Ganapathiraju via B4 Relay wrote:

From: Sarath Ganapathiraju <[email protected]>

The HeartBeat Pulse, also known as RateGen Pulse, synchronizes the start of 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.

Quoted 5 lines

Attach the DT vote clocks to runtime PM and resume the device before programming the rate generator registers, so register accesses happen only after the LPASS votes are active.

Validated on Hawi and Maili platforms for WCD-Headset playback.

Thanks,
Prasad

#7 lore raw

Re: [PATCH v8 2/2] clk: qcom: Add LPASS VA CSR heartbeat pulse clock

In reply to Sarath Ganapathiraju
Quoted 9 lines · On 9/17/26 3:57 PM, Sarath Ganapathiraju via B4 Relay wrote:

From: Sarath Ganapathiraju <[email protected]>

The HeartBeat Pulse, also known as RateGen Pulse, synchronizes the start of 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.

[...]

drivers/clk/qcom/lpass-va-csr.c line 120

Quoted 12 lines
drivers/clk/qcom/lpass-va-csr.c new file +12 -0
+	ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &csr->hb.hw);
+	if (ret)
+		goto err_pm_runtime_put;
+
+	pm_runtime_put(dev);
+
+	return 0;
+
+err_pm_runtime_put:
+	pm_runtime_put(dev);
+
+	return ret;

You could do return ret above to remove the separate error path Or better yet, you can use the cleanup macros from linux/pm_runtime.h, like PM_RUNTIME_ACQUIRE_IF_ENABLED() to get rid of the gotos altogether

Konrad