Re: [PATCH v5 2/7] ASoC: SDCA: export PM helpers keyed on sdca_class_drv

From: Charles Keepax

Date: Mon Sep 28 2026 - 05:35:42 EST


On Fri, Sep 25, 2026 at 05:10:43PM +0100, Srinivas Kandagatla wrote:
> The class PM callbacks pull sdca_class_drv out of drvdata, so the
> built-in class_sdw_driver owns the drvdata slot. That works for the
> generic case but blocks codec drivers that want to embed
> sdca_class_drv in their own private struct -- they need drvdata for
> their codec priv.
>
> Split the four callbacks into exported helpers that take a
> struct sdca_class_drv * directly:
>
> sdca_class_system_suspend()
> sdca_class_system_resume()
> sdca_class_runtime_suspend()
> sdca_class_runtime_resume()
>
> Codec drivers can now compose these into their own dev_pm_ops without
> going through drvdata.
>
> For the built-in class_sdw_driver, add small dev_pm_ops wrappers that
> fetch drv from drvdata and wire them into sdca_class_pm_ops. The ops
> struct itself stays private to this file; codec drivers build their
> own dev_pm_ops from the four exported helpers above.
>
> No functional change: the built-in class_sdw_driver keeps the same PM
> semantics; only the internal plumbing shifts to operate on
> sdca_class_drv instead of struct device *dev.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
> ---

Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>

Thanks,
Charles