Re: [PATCH v7 2/3] ASoC: codecs: lpass-va-macro: Switch to PM clock framework for runtime PM

From: Konrad Dybcio

Date: Tue Jun 30 2026 - 07:56:49 EST


On 6/29/26 12:05 PM, Ajay Kumar Nandam 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.
>
> Suggested-by: Mark Brown <broonie@xxxxxxxxxx>
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@xxxxxxxxxxxxxxxx>
> ---

[...]

> +static int va_macro_setup_pm_clocks(struct device *dev)
> +{
> + 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;
> }

https://lore.kernel.org/linux-arm-msm/84167531-b252-425c-bea5-49992a9c4500@xxxxxxxxxxxxxxxx/

Konrad