Skip to content

Asoc runtime pm fix v2#18

Open
nandamajay wants to merge 3 commits intomasterfrom
asoc-runtime-pm-fix-v2
Open

Asoc runtime pm fix v2#18
nandamajay wants to merge 3 commits intomasterfrom
asoc-runtime-pm-fix-v2

Conversation

@nandamajay
Copy link
Copy Markdown
Owner

This PR introduces runtime PM suspend/resume handling across LPASS pinctrl and ASoC macro codec drivers to ensure clocks are properly gated when devices are idle and re‑enabled in a defined order on resume.
The changes improve power management correctness for platforms using LPASS LPI island mode and prevent unnecessary clock votes during idle periods.

Ajay Kumar Nandam added 3 commits March 25, 2026 10:28
…me PM

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>
…e PM

Convert the LPASS VA 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, and npl clocks.
All clock control during runtime suspend and resume is delegated to
the PM core via pm_clk_suspend() and pm_clk_resume().

This change ensures clocks are only enabled when the VA 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>
Convert the LPASS LPI pinctrl driver to use the PM clock framework
for runtime power management.

This allows the LPASS LPI pinctrl driver to drop clock votes when idle,
improves power efficiency on platforms using LPASS LPI island mode,
and aligns the driver with common runtime PM patterns used across
Qualcomm LPASS subsystems.

Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
}
EXPORT_SYMBOL_GPL(lpi_pinctrl_remove);

int lpi_pinctrl_runtime_suspend(struct device *dev)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

pm_runtime_set_autosuspend_delay(dev, 100);
pm_runtime_use_autosuspend(dev);
pm_runtime_enable(dev);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we addding this here?

ret = lpi_gpio_read(state, offset, LPI_GPIO_CFG_REG, &ctl_reg);
if (ret) {
seq_printf(s, " %-8s: <read error %d>", pindesc.name, ret);
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not belong to this patch?

ret = lpi_gpio_read(state, pin, LPI_GPIO_VALUE_REG, &val);
if (ret)
return ret;
return val & LPI_GPIO_VALUE_IN_MASK;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated changes in this patch, please separate such changes.

*val = ioread32(state->tlmm_base + pin_offset + addr);

pm_runtime_mark_last_busy(state->dev);
pm_runtime_put_autosuspend(state->dev);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need a put?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants