linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	<linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Andy Shevchenko" <andy@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Paul Cercueil <paul@crapouillou.net>
Subject: Re: [PATCH v3 01/17] pinctrl: intel: Provide Intel pin control wide PM ops structure
Date: Mon, 30 Oct 2023 19:43:50 +0000	[thread overview]
Message-ID: <20231030194350.0000581f@Huawei.com> (raw)
In-Reply-To: <20231030194112.00001917@Huawei.com>

On Mon, 30 Oct 2023 19:41:12 +0000
Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:

> On Mon, 30 Oct 2023 14:07:18 +0200
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> > With the help of EXPORT_NS_GPL_DEV_PM_OPS() and
> > NOIRQ_SYSTEM_SLEEP_PM_OPS() we may convert PM ops functions to become
> > static. This also takes into account the PM configuration options such
> > as CONFIG_PM and CONFIG_PM_SLEEP. Hence the first step is to provide
> > a generic PM ops structure that can be used by drivers directly.  
> 
> It's a good thing to do, but if rolling a v3, should mention that the export
> moves into the namespace.
> 
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>  
> Other than that,
> LGTM
> 
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
Actually looking at usecase, why isn't the absence of an EXPORT in
the !CONFIG_PM_SLEEP path not a problem for bisection of this series given
you haven't yet protected the users?

Jonathan

> > ---
> >  drivers/pinctrl/intel/pinctrl-intel.c | 8 +++++---
> >  drivers/pinctrl/intel/pinctrl-intel.h | 4 ++--
> >  2 files changed, 7 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
> > index b19527a8728e..9fbdc7bfa65c 100644
> > --- a/drivers/pinctrl/intel/pinctrl-intel.c
> > +++ b/drivers/pinctrl/intel/pinctrl-intel.c
> > @@ -899,7 +899,7 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
> >   *
> >   * Return: a GPIO offset, or negative error code if translation can't be done.
> >   */
> > -static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
> > +static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
> >  {
> >  	const struct intel_community *community;
> >  	const struct intel_padgroup *padgrp;
> > @@ -1682,7 +1682,6 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_
> >  }
> >  EXPORT_SYMBOL_NS_GPL(intel_pinctrl_get_soc_data, PINCTRL_INTEL);
> >  
> > -#ifdef CONFIG_PM_SLEEP
> >  static bool __intel_gpio_is_direct_irq(u32 value)
> >  {
> >  	return (value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) &&
> > @@ -1883,7 +1882,10 @@ int intel_pinctrl_resume_noirq(struct device *dev)
> >  	return 0;
> >  }
> >  EXPORT_SYMBOL_GPL(intel_pinctrl_resume_noirq);
> > -#endif
> > +
> > +EXPORT_NS_GPL_DEV_PM_OPS(intel_pinctrl_pm_ops, PINCTRL_INTEL) = {
> > +	NOIRQ_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend_noirq, intel_pinctrl_resume_noirq)
> > +};
> >  
> >  MODULE_AUTHOR("Mathias Nyman <mathias.nyman@linux.intel.com>");
> >  MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
> > diff --git a/drivers/pinctrl/intel/pinctrl-intel.h b/drivers/pinctrl/intel/pinctrl-intel.h
> > index 2bb553598e8b..d3f511f97ed9 100644
> > --- a/drivers/pinctrl/intel/pinctrl-intel.h
> > +++ b/drivers/pinctrl/intel/pinctrl-intel.h
> > @@ -255,10 +255,8 @@ struct intel_pinctrl {
> >  int intel_pinctrl_probe_by_hid(struct platform_device *pdev);
> >  int intel_pinctrl_probe_by_uid(struct platform_device *pdev);
> >  
> > -#ifdef CONFIG_PM_SLEEP
> >  int intel_pinctrl_suspend_noirq(struct device *dev);
> >  int intel_pinctrl_resume_noirq(struct device *dev);
> > -#endif
> >  
> >  #define INTEL_PINCTRL_PM_OPS(_name)					\
> >  const struct dev_pm_ops _name = {					\
> > @@ -266,6 +264,8 @@ const struct dev_pm_ops _name = {					\
> >  				      intel_pinctrl_resume_noirq)	\
> >  }
> >  
> > +extern const struct dev_pm_ops intel_pinctrl_pm_ops;
> > +
> >  struct intel_community *intel_get_community(struct intel_pinctrl *pctrl, unsigned int pin);
> >  
> >  int intel_get_groups_count(struct pinctrl_dev *pctldev);  
> 


  reply	other threads:[~2023-10-30 19:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 12:07 [PATCH v3 00/17] pinctrl: intel: Use NOIRQ PM helper Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 01/17] pinctrl: intel: Provide Intel pin control wide PM ops structure Andy Shevchenko
2023-10-30 19:41   ` Jonathan Cameron
2023-10-30 19:43     ` Jonathan Cameron [this message]
2023-10-30 19:56       ` Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 02/17] pinctrl: alderlake: Switch to use Intel pin control PM ops Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 03/17] pinctrl: broxton: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 04/17] pinctrl: cannonlake: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 05/17] pinctrl: cedarfork: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 06/17] pinctrl: denverton: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 07/17] pinctrl: elkhartlake: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 08/17] pinctrl: emmitsburg: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 09/17] pinctrl: geminilake: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 10/17] pinctrl: icelake: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 11/17] pinctrl: jasperlake: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 12/17] pinctrl: lakefield: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 13/17] pinctrl: lewisburg: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 14/17] pinctrl: meteorlake: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 15/17] pinctrl: sunrisepoint: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 16/17] pinctrl: tigerlake: " Andy Shevchenko
2023-10-30 12:07 ` [PATCH v3 17/17] pinctrl: intel: Make PM ops functions static Andy Shevchenko
2023-11-02 12:57 ` [PATCH v3 00/17] pinctrl: intel: Use NOIRQ PM helper Linus Walleij
2023-11-10  6:14 ` Mika Westerberg
2023-11-13 11:35   ` Andy Shevchenko

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=20231030194350.0000581f@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=paul@crapouillou.net \
    /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).