mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Shubin <nikita.shubin@maquefel.me>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org,  linux-gpio@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v6 05/40] pinctrl: add a Cirrus ep93xx SoC pin controller
Date: Sat, 23 Dec 2023 11:55:17 +0300	[thread overview]
Message-ID: <26adbdb01f238b7fb74b2bcd110c1bdec77ab4bc.camel@maquefel.me> (raw)
In-Reply-To: <ZXnvHYjgnc3VsXnX@smile.fi.intel.com>

Hello Andy!

On Wed, 2023-12-13 at 19:51 +0200, Andy Shevchenko wrote:
> On Tue, Dec 12, 2023 at 11:20:22AM +0300, Nikita Shubin wrote:
> > Add a pin control (only multiplexing) driver for ep93xx SoC so
> > we can fully convert ep93xx to device tree.
> > 
> > This driver is capable of muxing ep9301/ep9302/ep9307/ep9312/ep9315
> > variants, this is chosen based on "compatible" in device tree.
> 
> Mostly nit-picks below, with the exception to setting device node.
> See below.
> 
> ...
> 
> > +/*
> > + * There are several system configuration options selectable by
> > the DeviceCfg and SysCfg
> > + * registers. These registers provide the selection of several pin
> > multiplexing options and also
> > + * provide software access to the system reset configuration
> > options. Please refer to the
> > + * descriptions of the registers, “DeviceCfg” on page 5-25 and
> > “SysCfg” on page 5-34, for a
> > + * detailed explanation.
> > + */
> > +#define EP93XX_SYSCON_DEVCFG_D1ONG     BIT(30) /* not used */
> > +#define EP93XX_SYSCON_DEVCFG_D0ONG     BIT(29) /* not used */
> > +#define EP93XX_SYSCON_DEVCFG_IONU2     BIT(28) /* not used */
> > +#define EP93XX_SYSCON_DEVCFG_GONK      BIT(27) /* done */
> > +#define EP93XX_SYSCON_DEVCFG_TONG      BIT(26) /* not used */
> > +#define EP93XX_SYSCON_DEVCFG_MONG      BIT(25) /* not used */
> > +#define EP93XX_SYSCON_DEVCFG_A2ONG     BIT(22) /* not used */
> > +#define EP93XX_SYSCON_DEVCFG_A1ONG     BIT(21) /* not used */
> > +#define EP93XX_SYSCON_DEVCFG_HONIDE    BIT(11) /* done */
> > +#define EP93XX_SYSCON_DEVCFG_GONIDE    BIT(10) /* done */
> > +#define EP93XX_SYSCON_DEVCFG_PONG      BIT(9) /* done */
> > +#define EP93XX_SYSCON_DEVCFG_EONIDE    BIT(8) /* done */
> > +#define EP93XX_SYSCON_DEVCFG_I2SONSSP  BIT(7) /* done */
> > +#define EP93XX_SYSCON_DEVCFG_I2SONAC97 BIT(6) /* done */
> > +#define EP93XX_SYSCON_DEVCFG_RASONP3   BIT(4) /* done */
> 
> What are these comments supposed to mean?
> 
> ...
> 
> > +static const struct pinctrl_ops ep93xx_pctrl_ops = {
> > +       .get_groups_count = ep93xx_get_groups_count,
> > +       .get_group_name = ep93xx_get_group_name,
> > +       .get_group_pins = ep93xx_get_group_pins,
> 
> > +       .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
> > +       .dt_free_map = pinconf_generic_dt_free_map,
> 
> Hmm... Don you need to ifdef these fields?

From now on we can't live without CONFIG_OF, so i don't think it's
necessary.

> 
> > +};
> 
> ...
> 
> > +static const struct pinfunction ep93xx_pmx_functions[] = {
> > +       PINCTRL_PINFUNCTION("spi", spigrps, ARRAY_SIZE(spigrps)),
> 
> Is array_size.h being included?
> 
> > +       PINCTRL_PINFUNCTION("ac97", ac97grps,
> > ARRAY_SIZE(ac97grps)),
> > +       PINCTRL_PINFUNCTION("i2s", i2sgrps, ARRAY_SIZE(i2sgrps)),
> > +       PINCTRL_PINFUNCTION("pwm", pwm1grps, ARRAY_SIZE(pwm1grps)),
> > +       PINCTRL_PINFUNCTION("keypad", keypadgrps,
> > ARRAY_SIZE(keypadgrps)),
> > +       PINCTRL_PINFUNCTION("pata", idegrps, ARRAY_SIZE(idegrps)),
> > +       PINCTRL_PINFUNCTION("lcd", rastergrps,
> > ARRAY_SIZE(rastergrps)),
> > +       PINCTRL_PINFUNCTION("gpio", gpiogrps,
> > ARRAY_SIZE(gpiogrps)),
> > +};
> 
> ...
> 
> > +       switch (pmx->model) {
> > +       case EP93XX_9301_PINCTRL:
> > +               grp = &ep9301_pin_groups[group];
> > +               break;
> > +       case EP93XX_9307_PINCTRL:
> > +               grp = &ep9307_pin_groups[group];
> > +               break;
> > +       case EP93XX_9312_PINCTRL:
> > +               grp = &ep9312_pin_groups[group];
> > +               break;
> 
> default?
> 
> > +       }
> 
> ...
> 
> > +       pmx->model = (int)(uintptr_t)id->driver_data;
> 
> Is the model defined as int (signed)?
> 
> Otherwise can we use proper type?
> 
> ...
> 
> > +       /* using parent of_node to match in
> > get_pinctrl_dev_from_of_node() */
> > +       device_set_of_node_from_dev(dev, adev->dev.parent);
> 
> Hmm... This takes references in comparison to device_set_node(). Is
> it intended?

Nope, switched to "device_set_node(dev, dev_fwnode(adev-dev.parent));".

> 
> ...
> 
> > +       pmx->pctl = devm_pinctrl_register(dev, &ep93xx_pmx_desc,
> > pmx);
> > +       if (IS_ERR(pmx->pctl))
> > +               return dev_err_probe(dev, PTR_ERR(pmx->pctl),
> > "could not register pinmux driver\n");
> 
> It can be written as
> 
>         pmx->pctl = devm_pinctrl_register(dev, &ep93xx_pmx_desc,
> pmx);
>         ret = PTR_ERR_OR_ZERO(...);
>         if (ret)
>                 return dev_err_probe(dev, ret, "could not register
> pinmux driver\n");
> 
> (makes line shorter). But it's up to you.
> 


  reply	other threads:[~2023-12-23  8:55 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  8:20 [PATCH v6 00/40] ep93xx device tree conversion Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 01/40] ARM: ep93xx: Add terminator to gpiod_lookup_table Nikita Shubin via B4 Relay
2023-12-13 17:24   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 02/40] gpio: ep93xx: split device in multiple Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 03/40] ARM: ep93xx: add regmap aux_dev Nikita Shubin via B4 Relay
2023-12-13 17:28   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 04/40] clk: ep93xx: add DT support for Cirrus EP93xx Nikita Shubin via B4 Relay
2023-12-13 17:42   ` Andy Shevchenko
2023-12-23  8:35     ` Nikita Shubin
2023-12-12  8:20 ` [PATCH v6 05/40] pinctrl: add a Cirrus ep93xx SoC pin controller Nikita Shubin via B4 Relay
2023-12-13 17:51   ` Andy Shevchenko
2023-12-23  8:55     ` Nikita Shubin [this message]
2023-12-12  8:20 ` [PATCH v6 06/40] power: reset: Add a driver for the ep93xx reset Nikita Shubin via B4 Relay
2023-12-13 17:54   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 07/40] dt-bindings: soc: Add Cirrus EP93xx Nikita Shubin via B4 Relay
2023-12-13  6:53   ` Krzysztof Kozlowski
2023-12-12  8:20 ` [PATCH v6 08/40] soc: Add SoC driver for Cirrus ep93xx Nikita Shubin via B4 Relay
2023-12-13 18:37   ` Andy Shevchenko
2023-12-23 10:06     ` Nikita Shubin
2023-12-23 11:32       ` Arnd Bergmann
2023-12-12  8:20 ` [PATCH v6 09/40] dt-bindings: dma: Add Cirrus EP93xx Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 10/40] dma: cirrus: Convert to DT for " Nikita Shubin via B4 Relay
2023-12-13 18:28   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 11/40] dt-bindings: watchdog: Add Cirrus EP93x Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 12/40] watchdog: ep93xx: add DT support for Cirrus EP93xx Nikita Shubin via B4 Relay
2023-12-13 17:56   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 13/40] dt-bindings: pwm: Add " Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 14/40] pwm: ep93xx: add DT support for " Nikita Shubin via B4 Relay
2023-12-13 17:56   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 15/40] dt-bindings: spi: Add " Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 16/40] spi: ep93xx: add DT support for " Nikita Shubin via B4 Relay
2023-12-13 18:13   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 17/40] dt-bindings: net: Add " Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 18/40] net: cirrus: add DT support for " Nikita Shubin via B4 Relay
2023-12-13 18:39   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 19/40] dt-bindings: mtd: Add ts7200 nand-controller Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 20/40] mtd: rawnand: add support for ts72xx Nikita Shubin via B4 Relay
2023-12-12  8:30   ` Greg Kroah-Hartman
2023-12-12  8:35     ` Nikita Shubin
2023-12-12 14:05       ` Miquel Raynal
2023-12-15 10:16   ` Miquel Raynal
2023-12-15 12:11     ` Nikita Shubin
2023-12-15 12:27       ` Miquel Raynal
2023-12-12  8:20 ` [PATCH v6 21/40] dt-bindings: ata: Add Cirrus EP93xx Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 22/40] ata: pata_ep93xx: add device tree support Nikita Shubin via B4 Relay
2023-12-13 18:19   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 23/40] dt-bindings: input: Add Cirrus EP93xx keypad Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 24/40] input: keypad: ep93xx: add DT support for Cirrus EP93xx Nikita Shubin via B4 Relay
2023-12-13 18:41   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 25/40] dt-bindings: wdt: Add ts72xx Nikita Shubin via B4 Relay
2023-12-12 15:03   ` Guenter Roeck
2023-12-12  8:20 ` [PATCH v6 26/40] wdt: ts72xx: add DT support for ts72xx Nikita Shubin via B4 Relay
2023-12-13 18:10   ` Andy Shevchenko
2023-12-12  8:20 ` [PATCH v6 27/40] gpio: ep93xx: add DT support for gpio-ep93xx Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 28/40] ASoC: dt-bindings: ep93xx: Document DMA support Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 29/40] ASoC: dt-bindings: ep93xx: Document Audio Port support Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 30/40] ASoC: ep93xx: Drop legacy DMA support Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 31/40] ARM: dts: add Cirrus EP93XX SoC .dtsi Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 32/40] ARM: dts: ep93xx: add ts7250 board Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 33/40] ARM: dts: ep93xx: Add EDB9302 DT Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 34/40] ARM: ep93xx: DT for the Cirrus ep93xx SoC platforms Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 35/40] pwm: ep93xx: drop legacy pinctrl Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 36/40] ata: pata_ep93xx: remove legacy pinctrl use Nikita Shubin via B4 Relay
2023-12-13 18:16   ` Andy Shevchenko
2023-12-13 18:33     ` Uwe Kleine-König
2023-12-13 18:48       ` Andy Shevchenko
2023-12-14 10:26         ` Uwe Kleine-König
2023-12-12  8:20 ` [PATCH v6 37/40] ARM: ep93xx: delete all boardfiles Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 38/40] ARM: ep93xx: soc: drop defines Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 39/40] ASoC: cirrus: edb93xx: Delete driver Nikita Shubin via B4 Relay
2023-12-12  8:20 ` [PATCH v6 40/40] dma: cirrus: remove platform code Nikita Shubin via B4 Relay
2023-12-13 18:30   ` Andy Shevchenko
2023-12-23  9:49     ` Nikita Shubin
2023-12-12 11:53 ` [PATCH v6 00/40] ep93xx device tree conversion Uwe Kleine-König
2023-12-13 17:59 ` Andy Shevchenko
2023-12-23  9:12   ` Nikita Shubin
2023-12-25 19:55     ` 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=26adbdb01f238b7fb74b2bcd110c1bdec77ab4bc.camel@maquefel.me \
    --to=nikita.shubin@maquefel.me \
    --cc=andriy.shevchenko@intel.com \
    --cc=arnd@arndb.de \
    --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

all inboxes | Powered by JetHome®