linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
@ 2023-11-20 19:48 Andy Shevchenko
  2023-11-21 18:11 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-11-20 19:48 UTC (permalink / raw)
  To: openbmc, linux-gpio, linux-kernel
  Cc: Jonathan Neuschäfer, Linus Walleij, Andy Shevchenko

The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
Utilize them instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
index 0cff44b07b29..4589900244c7 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
@@ -474,9 +474,8 @@ enum {
 #undef WPCM450_GRP
 };
 
-static struct group_desc wpcm450_groups[] = {
-#define WPCM450_GRP(x) { .name = #x, .pins = x ## _pins, \
-			.num_pins = ARRAY_SIZE(x ## _pins) }
+static struct pingroup wpcm450_groups[] = {
+#define WPCM450_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
 	WPCM450_GRPS
 #undef WPCM450_GRP
 };
@@ -852,7 +851,7 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev,
 				  const unsigned int **pins,
 				  unsigned int *npins)
 {
-	*npins = wpcm450_groups[selector].num_pins;
+	*npins = wpcm450_groups[selector].npins;
 	*pins  = wpcm450_groups[selector].pins;
 
 	return 0;
@@ -901,7 +900,7 @@ static int wpcm450_pinmux_set_mux(struct pinctrl_dev *pctldev,
 	struct wpcm450_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
 
 	wpcm450_setfunc(pctrl->gcr_regmap, wpcm450_groups[group].pins,
-			wpcm450_groups[group].num_pins, function);
+			wpcm450_groups[group].npins, function);
 
 	return 0;
 }
-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
  2023-11-20 19:48 [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP() Andy Shevchenko
@ 2023-11-21 18:11 ` Andy Shevchenko
  2023-11-24 10:09   ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-11-21 18:11 UTC (permalink / raw)
  To: openbmc, linux-gpio, linux-kernel; +Cc: Jonathan Neuschäfer, Linus Walleij

On Mon, Nov 20, 2023 at 09:48:02PM +0200, Andy Shevchenko wrote:
> The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
> Utilize them instead of open coded variants in the driver.

Linus, I dunno if you are going to apply this sooner (assuming Jonathan is okay
with the change), but I have a bigger pending series where this will be a
prerequisite. So, when I will be ready and if it's not being applied (yet),
I'll include it into the bigger series as well.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
  2023-11-21 18:11 ` Andy Shevchenko
@ 2023-11-24 10:09   ` Linus Walleij
  2023-11-24 11:30     ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2023-11-24 10:09 UTC (permalink / raw)
  To: Andy Shevchenko, Tomer Maimon
  Cc: openbmc, linux-gpio, linux-kernel, Jonathan Neuschäfer

On Tue, Nov 21, 2023 at 7:11 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Mon, Nov 20, 2023 at 09:48:02PM +0200, Andy Shevchenko wrote:

> > The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
> > Utilize them instead of open coded variants in the driver.
>
> Linus, I dunno if you are going to apply this sooner (assuming Jonathan is okay
> with the change), but I have a bigger pending series where this will be a
> prerequisite. So, when I will be ready and if it's not being applied (yet),
> I'll include it into the bigger series as well.

No answer from Jonathan but I just applied another Nuvoton patch from
Tomer, so maybe Tomer can look at/test this patch?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
  2023-11-24 10:09   ` Linus Walleij
@ 2023-11-24 11:30     ` Andy Shevchenko
  2023-11-27 15:05       ` Tomer Maimon
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-11-24 11:30 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tomer Maimon, openbmc, linux-gpio, linux-kernel,
	Jonathan Neuschäfer

On Fri, Nov 24, 2023 at 11:09:07AM +0100, Linus Walleij wrote:
> On Tue, Nov 21, 2023 at 7:11 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Mon, Nov 20, 2023 at 09:48:02PM +0200, Andy Shevchenko wrote:
> 
> > > The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
> > > Utilize them instead of open coded variants in the driver.
> >
> > Linus, I dunno if you are going to apply this sooner (assuming Jonathan is okay
> > with the change), but I have a bigger pending series where this will be a
> > prerequisite. So, when I will be ready and if it's not being applied (yet),
> > I'll include it into the bigger series as well.
> 
> No answer from Jonathan but I just applied another Nuvoton patch from
> Tomer, so maybe Tomer can look at/test this patch?

Jonathan acked it  in the reincarnation in the series (see my big one).

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
  2023-11-24 11:30     ` Andy Shevchenko
@ 2023-11-27 15:05       ` Tomer Maimon
  0 siblings, 0 replies; 5+ messages in thread
From: Tomer Maimon @ 2023-11-27 15:05 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, openbmc, linux-gpio, linux-kernel,
	Jonathan Neuschäfer

Hi Linus,

On Fri, 24 Nov 2023 at 13:30, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Fri, Nov 24, 2023 at 11:09:07AM +0100, Linus Walleij wrote:
> > On Tue, Nov 21, 2023 at 7:11 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Mon, Nov 20, 2023 at 09:48:02PM +0200, Andy Shevchenko wrote:
> >
> > > > The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
> > > > Utilize them instead of open coded variants in the driver.
> > >
> > > Linus, I dunno if you are going to apply this sooner (assuming Jonathan is okay
> > > with the change), but I have a bigger pending series where this will be a
> > > prerequisite. So, when I will be ready and if it's not being applied (yet),
> > > I'll include it into the bigger series as well.
> >
> > No answer from Jonathan but I just applied another Nuvoton patch from
> > Tomer, so maybe Tomer can look at/test this patch?
Sorry, but I do not have wpcm450 board to test this patch.
In general, the patch looks fine.
>
> Jonathan acked it  in the reincarnation in the series (see my big one).
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

Sorry I couldn't help.

Best regards,

Tomer

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-27 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20 19:48 [PATCH v1 1/1] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP() Andy Shevchenko
2023-11-21 18:11 ` Andy Shevchenko
2023-11-24 10:09   ` Linus Walleij
2023-11-24 11:30     ` Andy Shevchenko
2023-11-27 15:05       ` Tomer Maimon

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).