Re: [PATCH v2 3/3] ASoC: Add LPASS VA CSR heartbeat pulse clock

From: Krzysztof Kozlowski

Date: Fri Jul 17 2026 - 05:08:11 EST


On Fri, Jul 17, 2026 at 01:21:17AM +0530, Sarath Ganapathiraju wrote:
> 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@xxxxxxxxxxxxxxxx>
> ---
> 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>

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