Re: [PATCH v6 2/3] ASoC: codecs: lpass-va-macro: Switch to PM clock framework for runtime PM
From: Ajay Kumar Nandam
Date: Tue Jun 23 2026 - 07:59:38 EST
On 6/23/2026 4:09 PM, Konrad Dybcio wrote:
Convert the LPASS VA macro codec driver to runtime PM clock management by[...]
using the PM clock framework.
Replace manual macro/dcodec/mclk/npl clock handling with PM clock helpers
and runtime PM callbacks, and keep runtime PM references around fsgen clock
gating so PM-clock-managed clocks remain active while fsgen is enabled.
Set autosuspend delay to 100 ms so PM-clock-managed votes are dropped soon
after idle while still avoiding suspend/resume churn on short gaps.
Add a PM_CLK dependency to SND_SOC_LPASS_VA_MACRO since this patch
introduces PM clock APIs.
Improve failure unwind paths: handle runtime PM put errors in probe/fsgen
paths and restore regcache state correctly on resume failure.
Signed-off-by: Ajay Kumar Nandam<ajay.nandam@xxxxxxxxxxxxxxxx>
---
--- a/sound/soc/codecs/lpass-va-macro.cincludes should be sorted
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -11,6 +11,7 @@
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_clock.h>
ACK, I’ll fix the include ordering in the next version
[...]
+static int va_macro_setup_pm_clocks(struct device *dev)Can't these 2 calls simply be part of .probe()?
+{
+ int ret;
+
+ ret = devm_pm_clk_create(dev);
+ if (ret)
+ return ret;
+
+ ret = of_pm_clk_add_clks(dev);
+ if (ret < 0)
+ return ret;
+
+ return 0;
}
The helper was added to keep the PM clock setup isolated, but I agree it’s simple enough to inline into probe(). I’ll move it there in the next revision.
Ajay Kumar Nandam
Konrad