From: Sudeep Holla <sudeep.holla@arm.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
<arm-scmi@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>,
Chuck Cannon <chuck.cannon@nxp.com>
Subject: Re: [PATCH v2 1/2] firmware: arm_scmi: bus: Add pm ops
Date: Mon, 7 Jul 2025 12:25:37 +0100 [thread overview]
Message-ID: <20250707-rich-helpful-guppy-c5ea68@sudeepholla> (raw)
In-Reply-To: <20250704-scmi-pm-v2-1-9316cec2f9cc@nxp.com>
On Fri, Jul 04, 2025 at 11:09:35AM +0800, Peng Fan wrote:
> Take platform_pm_ops as reference. Add pm ops for scmi_bus_type,
> then the scmi devices under scmi bus could have their own hooks for
> suspend, resume function.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/firmware/arm_scmi/bus.c | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index 1adef03894751dae9bb752b8c7f86e5d01c5d4fd..b6ade837ecea34f147fc1b734c55eafecca5ae0c 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -323,6 +323,38 @@ static struct attribute *scmi_device_attributes_attrs[] = {
> };
> ATTRIBUTE_GROUPS(scmi_device_attributes);
>
> +#ifdef CONFIG_SUSPEND
> +static int scmi_pm_suspend(struct device *dev)
> +{
> + const struct device_driver *drv = dev->driver;
> +
> + if (drv && drv->pm && drv->pm->suspend)
> + return drv->pm->suspend(dev);
> +
> + return 0;
> +}
> +
> +static int scmi_pm_resume(struct device *dev)
> +{
> + const struct device_driver *drv = dev->driver;
> +
> + if (drv && drv->pm && drv->pm->resume)
> + return drv->pm->resume(dev);
> +
> + return 0;
> +}
> +
> +static const struct dev_pm_ops scmi_dev_pm_ops = {
> + .suspend = scmi_pm_suspend,
I have use pm_sleep_ptr() and removed the below NULL based struct.
Have a look at for-next/scmi/updates and let me know if you are happy
with that.
--
Regards,
Sudeep
next prev parent reply other threads:[~2025-07-07 11:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 3:09 [PATCH v2 0/2] firmware: arm_scmi: add pm ops for scmi_power_control Peng Fan
2025-07-04 3:09 ` [PATCH v2 1/2] firmware: arm_scmi: bus: Add pm ops Peng Fan
2025-07-07 11:25 ` Sudeep Holla [this message]
2025-07-08 1:32 ` Peng Fan
2025-07-04 3:09 ` [PATCH v2 2/2] firmware: arm_scmi: power_control: Set SCMI_SYSPOWER_IDLE in PM resume Peng Fan
2025-07-08 15:26 ` [PATCH v2 0/2] firmware: arm_scmi: add pm ops for scmi_power_control Sudeep Holla
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=20250707-rich-helpful-guppy-c5ea68@sudeepholla \
--to=sudeep.holla@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=chuck.cannon@nxp.com \
--cc=cristian.marussi@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=ranjani.vaidyanathan@nxp.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®