mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Srinivas Kandagatla <srini@kernel.org>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	mohammad.rafi.shaik@oss.qualcomm.com,
	ajay.nandam@oss.qualcomm.com
Subject: [PATCH v5 0/3] ASoC: qcom: lpass: Switch VA/WSA macros to PM clock framework
Date: Fri, 22 May 2026 18:34:39 +0530	[thread overview]
Message-ID: <20260522073324.e18bb240b6f6@oss.qualcomm.com> (raw)

This series converts LPASS WSA and VA macro codec drivers to the PM
clock framework for runtime PM clock handling.

Clock enable/disable sequencing during runtime suspend/resume is moved
to pm_clk helpers, while regcache state handling remains in the driver
runtime PM callbacks. This aligns these codec drivers with common LPASS
runtime PM patterns and reduces idle clock voting.

Patch 3 switches WSA MCLK clock registration to devm-managed
clk_hw registration.

---
v4: https://lore.kernel.org/r/20260518081738.2453957-1-ajay.nandam@oss.qualcomm.com
Link: https://lore.kernel.org/r/20260518081738.2453957-1-ajay.nandam@oss.qualcomm.com

Changes since v4:
- Added `depends on PM` to `SND_SOC_LPASS_WSA_MACRO` and
  `SND_SOC_LPASS_VA_MACRO` so PM clock helpers are available when these
  drivers are built
- Moved `sret` declaration in WSA/VA runtime_resume() from nested
  error-path blocks to top-level `int ret, sret;` declarations for
  kernel coding style compliance (no functional change)
- In WSA/VA probe error-unwind (`err_rpm_put`), check
  `pm_runtime_put_sync_suspend()` return values and emit `dev_warn()`
  on failure so runtime-PM unwind failures are visible

v3: https://lore.kernel.org/r/20260508113503.3550647-1-ajay.nandam@oss.qualcomm.com

Changes since v3:
- In WSA/VA runtime_resume() regcache_sync() failure unwind, capture
  pm_clk_suspend() failures and emit dev_err() to make clock/cache
  rollback failures observable

- In WSA/VA runtime_resume(), mark regcache dirty when pm_clk_resume()
  fails so a later resume attempt forces a full regcache_sync() even if
  no prior runtime_suspend() has run

- Added `depends on PM` to `SND_SOC_LPASS_WSA_MACRO` and
  `SND_SOC_LPASS_VA_MACRO` because these drivers now require PM clock
  helpers and must not build with `!PM_CLK` stubs

- Converted runtime-PM enablement to devm_pm_runtime_enable() in both
  PM-clock conversion patches; probe error unwind now uses
  pm_runtime_put_sync_suspend(), with runtime-PM disable handled by devm

- In WSA/VA runtime_suspend callbacks, moved regcache_mark_dirty() after
  successful pm_clk_suspend() and restored regcache_cache_only(false) on
  pm_clk_suspend() failures to avoid leaving dirty/cache-only state set
  when clocks are not suspended

- In va fsgen_gate_enable() error unwind, replaced
  pm_runtime_put_noidle() with pm_runtime_put_autosuspend() and added
  dev_warn() logging for put failures so failed-enable paths can
  autosuspend and drop PM-clock votes


Ajay Kumar Nandam (3):
  ASoC: codecs: lpass-wsa-macro: Switch to PM clock framework for
    runtime PM
  ASoC: codecs: lpass-va-macro: Switch to PM clock framework for runtime
    PM
  ASoC: codecs: lpass-wsa-macro: Use devm_clk_hw_register() for MCLK
    output

 sound/soc/codecs/Kconfig           |   2 ++
 sound/soc/codecs/lpass-va-macro.c  | 133 +++++++++++++++++----------------
 sound/soc/codecs/lpass-wsa-macro.c | 121 +++++++++++-----------------
 3 files changed, 119 insertions(+), 137 deletions(-)

-- 
2.34.1

             reply	other threads:[~2026-05-22 13:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 13:04 Ajay Kumar Nandam [this message]
2026-05-22 13:04 ` [PATCH v5 1/3] ASoC: codecs: lpass-wsa-macro: Switch to PM clock framework for runtime PM Ajay Kumar Nandam
2026-05-22 13:17   ` Mark Brown
2026-05-22 14:37     ` Konrad Dybcio
2026-05-22 19:19       ` Ajay Kumar Nandam
2026-05-22 19:18     ` Ajay Kumar Nandam
2026-05-22 13:25   ` Konrad Dybcio
2026-05-22 19:26     ` Ajay Kumar Nandam
2026-05-25 13:07       ` Konrad Dybcio
2026-05-22 13:04 ` [PATCH v5 2/3] ASoC: codecs: lpass-va-macro: " Ajay Kumar Nandam
2026-05-22 13:04 ` [PATCH v5 3/3] ASoC: codecs: lpass-wsa-macro: Use devm_clk_hw_register() for MCLK output Ajay Kumar Nandam
2026-05-22 13:24 ` [PATCH v5 0/3] ASoC: qcom: lpass: Switch VA/WSA macros to PM clock framework Mark Brown

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=20260522073324.e18bb240b6f6@oss.qualcomm.com \
    --to=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=mohammad.rafi.shaik@oss.qualcomm.com \
    --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

all inboxes | Powered by JetHome®