[PATCH v5 0/3] ASoC: qcom: lpass: Switch VA/WSA macros to PM clock framework

Ajay Kumar Nandam posted 3 patches 2 days, 4 hours ago
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(-)
[PATCH v5 0/3] ASoC: qcom: lpass: Switch VA/WSA macros to PM clock framework
Posted by Ajay Kumar Nandam 2 days, 4 hours ago
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
Re: [PATCH v5 0/3] ASoC: qcom: lpass: Switch VA/WSA macros to PM clock framework
Posted by Mark Brown 2 days, 4 hours ago
On Fri, May 22, 2026 at 06:34:39PM +0530, Ajay Kumar Nandam wrote:
> This series converts LPASS WSA and VA macro codec drivers to the PM
> clock framework for runtime PM clock handling.

This doesn't apply against current code, please check and resend.