Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH v3 1/3] ASoC: codecs: lpass-wsa-macro: Switch to PM clock framework for runtime PM
Date: Mon, 11 May 2026 13:09:20 +0200	[thread overview]
Message-ID: <096361a6-0a23-49e4-aa01-9ec92d845e54@oss.qualcomm.com> (raw)
In-Reply-To: <20260508113503.3550647-2-ajay.nandam@oss.qualcomm.com>

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@oss.qualcomm.com>
> ---

[...]

> +	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

  reply	other threads:[~2026-05-11 11:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 11:35 [PATCH v3 0/3] ASoC: qcom: lpass: Switch VA/WSA macros to PM clock framework Ajay Kumar Nandam
2026-05-08 11:35 ` [PATCH v3 1/3] ASoC: codecs: lpass-wsa-macro: Switch to PM clock framework for runtime PM Ajay Kumar Nandam
2026-05-11 11:09   ` Konrad Dybcio [this message]
2026-05-08 11:35 ` [PATCH v3 2/3] ASoC: codecs: lpass-va-macro: " Ajay Kumar Nandam
2026-05-08 11:35 ` [PATCH v3 3/3] ASoC: codecs: lpass-wsa-macro: Use devm_clk_hw_register() for MCLK output Ajay Kumar Nandam
2026-05-11 11:11   ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=096361a6-0a23-49e4-aa01-9ec92d845e54@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=ajay.nandam@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=srini@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox