Re: [PATCH v3 1/3] ASoC: codecs: lpass-wsa-macro: Switch to PM clock framework for runtime PM
From: Konrad Dybcio
Date: Mon May 11 2026 - 07:14:36 EST
On 5/8/26 1:35 PM, Ajay Kumar Nandam wrote:
> Convert the LPASS WSA macro codec driver to use the PM clock framework
> for runtime power management.
>
> The driver now relies on pm_clk helpers and runtime PM instead of
> manually enabling and disabling macro, dcodec, mclk, npl, and fsgen
> clocks. Runtime suspend and resume handling is delegated to the PM
> core via pm_clk_suspend() and pm_clk_resume(), while existing runtime
> PM callbacks continue to manage regcache state.
>
> This ensures clocks are enabled only when the WSA macro is active,
> improves power efficiency on LPASS platforms supporting LPI/island
> modes, and aligns the driver with common ASoC runtime PM patterns used
> across Qualcomm LPASS codec drivers.
>
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@xxxxxxxxxxxxxxxx>
> ---
[...]
> + pm_runtime_set_autosuspend_delay(dev, 100);
> + pm_runtime_use_autosuspend(dev);
> + pm_runtime_enable(dev);
Please use devm_pm_runtime_enable(), this will let you drop cleanup
calls to pm_runtime_disable() in this functgion and in .remove()
>
> - ret = clk_prepare_enable(wsa->npl);
> - if (ret)
> - goto err_npl;
>
> - ret = clk_prepare_enable(wsa->fsgen);
> - if (ret)
> - goto err_fsgen;
> + ret = pm_runtime_resume_and_get(dev);
> + if (ret < 0) {
> + goto err_rpm_disable;
> + }
no need for curly braces for a one-line conditional
Konrad