[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVaJ2Fqc5+YFCO9isUebUaeZE31T3C+SXDeVXOii=Ra4A@mail.gmail.com>
Date: Thu, 15 Jun 2023 09:48:27 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
Alexander Stein <alexander.stein@...tq-group.com>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Andy Shevchenko <andy@...nel.org>
Subject: Re: [PATCH v2 3/4] gpio: aggregator: Set up a parser of delay line parameters
Hi Andy,
On Thu, Jun 15, 2023 at 1:14 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> The aggregator mode can also handle properties of the platform,
> that do not belong to the GPIO controller itself. One of such
> a property is a signal delay line. Set up a parser to support it.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Thanks for your patch!
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
One suggestion for improvement below...
> --- a/drivers/gpio/gpio-aggregator.c
> +++ b/drivers/gpio/gpio-aggregator.c
> @@ -525,7 +580,9 @@ static int gpio_aggregator_probe(struct platform_device *pdev)
> return PTR_ERR(descs[i]);
> }
>
> - fwd = gpiochip_fwd_create(dev, n, descs);
> + delay_line = fwnode_device_is_compatible(dev_fwnode(dev), "gpio-delay");
Please do not use explicit checks for compatible values in .probe()
methods. Instead, use device_get_match_data() to get the feature
flag(s). This will also make it easier to scale to other external
components later.
> +
> + fwd = gpiochip_fwd_create(dev, n, descs, delay_line);
> if (IS_ERR(fwd))
> return PTR_ERR(fwd);
>
> @@ -534,6 +591,15 @@ static int gpio_aggregator_probe(struct platform_device *pdev)
> }
>
> static const struct of_device_id gpio_aggregator_dt_ids[] = {
> + /*
> + * The GPIO delay provides a way to configure platform specific delays
> + * for GPIO ramp-up or ramp-down delays. This can serve the following
> + * purposes:
> + * - Open-drain output using an RC filter
> + */
> + {
> + .compatible = "gpio-delay",
.data = (void *)FWD_FEATURE_DELAY,
> + },
> /*
> * Add GPIO-operated devices controlled from userspace below,
> * or use "driver_override" in sysfs.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists