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

From: Mark Brown

Date: Tue Apr 21 2026 - 16:56:47 EST


On Mon, Apr 20, 2026 at 05:58:42PM +0530, Ajay Kumar Nandam wrote:
> Convert the LPASS VA macro codec driver to use the PM clock framework
> for runtime power management.

> + ret = pm_runtime_resume_and_get(va->dev);
> + if (ret < 0) {
> + pm_runtime_put_noidle(va->dev);
> + return ret;
> }

Are you sure we need a put in the error path here? The refcounting with
runtime PM can be very confusing :(

> ret = va_macro_mclk_enable(va, true);
> + if (ret) {
> + pm_runtime_put_noidle(va->dev);
> + return ret;
> + }

Why _noidle? We did actually resume above.

> va_macro_mclk_enable(va, false);
> - if (va->has_swr_master)
> - clk_disable_unprepare(va->mclk);
> +
> + pm_runtime_put_autosuspend(va->dev);
> +}

Don't we need a _mark_last_busy() here?

> @@ -1601,22 +1622,18 @@ static int va_macro_probe(struct platform_device *pdev)

> + ret = va_macro_setup_pm_clocks(dev, va);
> if (ret)
> - goto err_dcodec;
> + goto err_rpm_disable;

Here we jump to disable...

>
> - ret = clk_prepare_enable(va->mclk);
> - if (ret)
> - goto err_mclk;
> + pm_runtime_set_autosuspend_delay(dev, 100);
> + pm_runtime_use_autosuspend(dev);
> + pm_runtime_enable(dev);

...but the enable didn't happen yet...

> +err_rpm_put:
> + pm_runtime_put_noidle(dev);
> +err_rpm_disable:
> + pm_runtime_disable(dev);

...so this isn't yet needed.

Attachment: signature.asc
Description: PGP signature