Re: [PATCH 1/2] ASoC: codecs: lpass-tx-macro: switch to PM clock framework for runtime PM

From: Konrad Dybcio

Date: Mon Jul 06 2026 - 06:54:31 EST


On 7/3/26 1:08 PM, Ajay Kumar Nandam wrote:
> Convert the LPASS TX macro codec driver to runtime PM clock management
> using the PM clock framework.
>
> Replace manual macro/dcodec/mclk/npl/fsgen clock toggling with PM clock
> helpers and runtime PM callbacks. Keep the SWR gate runtime PM reference
> from SWR clock enable until disable so autosuspend does not gate clocks
> while SWR is still prepared.
>
> 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_TX_MACRO since this patch
> introduces PM clock APIs.
>
> Tighten error unwind by checking pm_runtime_put_sync_suspend() in probe
> and by restoring regcache state if pm_clk_resume()/regcache_sync() fails.
>
> Co-developed-by: Ravi Hothi <ravi.hothi@xxxxxxxxxxxxxxxx>
> Signed-off-by: Ravi Hothi <ravi.hothi@xxxxxxxxxxxxxxxx>
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@xxxxxxxxxxxxxxxx>
> ---

[...]

> /* set MCLK and NPL rates */
> clk_set_rate(tx->mclk, MCLK_FREQ);
> - clk_set_rate(tx->npl, MCLK_FREQ);
> + if (tx->npl)
> + clk_set_rate(tx->npl, MCLK_FREQ);

This is an (unnecessary) unrelated change - clk APIs happily eat
null pointers

If you want to follow up this series with a nice change, the retval
of clk_set_rate() should be checked

Konrad