From: Martyn Welch <martyn.welch@collabora.com>
To: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] gpio: mpc8xxx: switch to using DEFINE_RUNTIME_DEV_PM_OPS()
Date: Wed, 04 Sep 2024 12:40:09 +0100 [thread overview]
Message-ID: <0af89f007779b975692f9c104f0465bc4566b5c9.camel@collabora.com> (raw)
In-Reply-To: <CACMJSeu+OsDc7ZiQxxN5gbKaq4DSYsMPC7S_A=9eesiWrQPaGw@mail.gmail.com>
On Tue, 2024-09-03 at 20:36 +0200, Bartosz Golaszewski wrote:
> On Tue, 3 Sept 2024 at 18:25, Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> >
> > On Tue, Sep 03, 2024 at 07:23:31PM +0300, Andy Shevchenko wrote:
> > > On Tue, Sep 03, 2024 at 05:45:33PM +0200, Bartosz Golaszewski
> > > wrote:
> >
> > ...
> >
> > > > #include <linux/mod_devicetable.h>
> > > > #include <linux/of.h>
> > > > #include <linux/platform_device.h>
> > > > +#include <linux/pm_runtime.h>
> > >
> > > You need pm.h as macros defined there.
> >
> > ...or both...
> >
>
> pm_runtime.h implies pm.h.
>
> > > > #include <linux/property.h>
> > > > #include <linux/slab.h>
> > > > #include <linux/spinlock.h>
> >
> > ...
> >
> > > > +static DEFINE_RUNTIME_DEV_PM_OPS(mpc8xx_pm_ops,
> > > > mpc8xxx_suspend,
> > > > + mpc8xxx_resume, NULL);
> >
> > This one comes from pm_runtime.h, but pm*_ptr() ones from pm.h.
> >
> > And it seems you wanted pm_ptr().
> >
>
> Yeah, I'm not sure really. The suspend and resume callbacks for
> platform devices are not documented but it looks like they're only
> used for system sleep. Martyn: which one do we actually need?
>
Looking at commit 9d8619190031 (PM: runtime: Add
DEFINE_RUNTIME_DEV_PM_OPS() macro), the use of
DEFINE_RUNTIME_DEV_PM_OPS() sets up PM operations for all situations,
not just sleeping, so I think we need pm_ptr() here.
I'd explicitly added the functionality for suspension due to sleep,
though if a GPIO line is being used as some form of external interrupt,
there may well be cases where it would be beneficial to be able to
receive it in other low power states?
Martyn
> Bart
>
> > --
> > With Best Regards,
> > Andy Shevchenko
> >
> >
next prev parent reply other threads:[~2024-09-04 11:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 15:45 [PATCH 1/2] gpio: mpc8xxx: order headers alphabetically Bartosz Golaszewski
2024-09-03 15:45 ` [PATCH 2/2] gpio: mpc8xxx: switch to using DEFINE_RUNTIME_DEV_PM_OPS() Bartosz Golaszewski
2024-09-03 16:23 ` Andy Shevchenko
2024-09-03 16:25 ` Andy Shevchenko
2024-09-03 18:36 ` Bartosz Golaszewski
2024-09-04 11:40 ` Martyn Welch [this message]
2024-09-03 16:20 ` [PATCH 1/2] gpio: mpc8xxx: order headers alphabetically Andy Shevchenko
2024-09-03 17:23 ` Martyn Welch
2024-09-04 7:23 ` Bartosz Golaszewski
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=0af89f007779b975692f9c104f0465bc4566b5c9.camel@collabora.com \
--to=martyn.welch@collabora.com \
--cc=andriy.shevchenko@intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).