From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, Krzysztof Kozlowski <krzk@kernel.org>,
Arnd Bergmann <arnd@arndb.de>, Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 17/21] nfc: marvell: convert to gpio descriptors
Date: Sat, 9 Aug 2025 13:09:47 +0300 [thread overview]
Message-ID: <aJcea90siAod5Apw@smile.fi.intel.com> (raw)
In-Reply-To: <20250808151822.536879-18-arnd@kernel.org>
On Fri, Aug 08, 2025 at 05:18:01PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The only reason this driver seems to still use the legacy gpio
> numbers is for the module parameter that lets users pass a different
> reset gpio.
>
> Since the fixed numbers are on their way out, and none of the platforms
> this driver is used on would have them any more, remove the module
> parameter and instead just use the reset information from firmware.
This patch is my love in the series, thanks for doing it!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
But note some comments below.
...
> - if (gpio_is_valid(priv->config.reset_n_io)) {
> - rc = gpio_request_one(priv->config.reset_n_io,
> - GPIOF_OUT_INIT_LOW,
> - "nfcmrvl_reset_n");
> - if (rc < 0) {
> - priv->config.reset_n_io = -EINVAL;
> - nfc_err(dev, "failed to request reset_n io\n");
> - }
> + priv->reset_n_io = gpiod_get_optional(dev, "reset-n-io", GPIOD_OUT_LOW);
> + if (IS_ERR(priv->reset_n_io)) {
> + nfc_err(dev, "failed to get reset_n gpio\n");
> + return ERR_CAST(priv->reset_n_io);
> }
This also needs a call to gpiod_set_consumer_name(), IIRC the API name.
...
> - if (gpio_is_valid(priv->config.reset_n_io)) {
> - nfc_info(priv->dev, "reset the chip\n");
> - gpio_set_value(priv->config.reset_n_io, 0);
> - usleep_range(5000, 10000);
> - gpio_set_value(priv->config.reset_n_io, 1);
> - } else
> - nfc_info(priv->dev, "no reset available on this interface\n");
> + nfc_info(priv->dev, "reset the chip\n");
> + gpiod_set_value(priv->reset_n_io, 0);
> + usleep_range(5000, 10000);
Side note, this would be nice to use fsleep(), but I see that's just a
copy'n'paste of the original piece.
> + gpiod_set_value(priv->reset_n_io, 1);
...
> void nfcmrvl_chip_halt(struct nfcmrvl_private *priv)
> {
> - if (gpio_is_valid(priv->config.reset_n_io))
> - gpio_set_value(priv->config.reset_n_io, 0);
> + if (priv->reset_n_io)
Not sure why we need this dup check.
> + gpiod_set_value(priv->reset_n_io, 0);
> }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-08-09 10:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 15:17 [PATCH 00/21] gpiolib: fence off legacy interfaces Arnd Bergmann
2025-08-08 15:17 ` [PATCH 15/21] dsa: b53: hide legacy gpiolib usage on non-mips Arnd Bergmann
2025-08-09 10:01 ` Jonas Gorski
2025-08-09 20:55 ` Arnd Bergmann
2025-08-08 15:18 ` [PATCH 17/21] nfc: marvell: convert to gpio descriptors Arnd Bergmann
2025-08-09 10:09 ` Andy Shevchenko [this message]
2025-08-11 21:43 ` Dmitry Torokhov
2025-08-13 12:35 ` Andy Shevchenko
2025-08-11 7:49 ` Bartosz Golaszewski
2025-08-13 7:48 ` Krzysztof Kozlowski
2025-08-08 15:18 ` [PATCH 18/21] nfc: s3fwrn5: " Arnd Bergmann
2025-08-11 22:08 ` Dmitry Torokhov
2025-08-11 13:10 ` [PATCH 00/21] gpiolib: fence off legacy interfaces Bartosz Golaszewski
2025-08-12 16:23 ` (subset) " Mark Brown
2025-09-02 12:56 ` Lee Jones
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=aJcea90siAod5Apw@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=brgl@bgdev.pl \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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).