From: Linus Walleij <linus.walleij@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
Alexander Aring <alex.aring@gmail.com>,
Stefan Schmidt <stefan@datenfreihafen.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API
Date: Mon, 3 Mar 2025 21:00:39 +0100 [thread overview]
Message-ID: <CACRpkdbCfhqRGOGrCgP-e3AnK_tmHX+eUpZKjitbfemzAXCcWg@mail.gmail.com> (raw)
In-Reply-To: <20250303164928.1466246-4-andriy.shevchenko@linux.intel.com>
On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> This updates the driver to gpiod API, and removes yet another use of
> of_get_named_gpio().
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
But note:
> @@ -632,10 +630,10 @@ static void ca8210_reset_send(struct spi_device *spi, unsigned int ms)
> struct ca8210_priv *priv = spi_get_drvdata(spi);
> long status;
>
> - gpio_set_value(pdata->gpio_reset, 0);
> + gpiod_set_value(pdata->reset_gpio, 0);
> reinit_completion(&priv->ca8210_is_awake);
> msleep(ms);
> - gpio_set_value(pdata->gpio_reset, 1);
> + gpiod_set_value(pdata->reset_gpio, 1);
This drives the GPIO low to assert reset, meaning it is something
that should have GPIO_ACTIVE_LOW set in the device tree,
and it might even have, so let's check what we can check:
git grep cascoda,ca8210
Documentation/devicetree/bindings/net/ieee802154/ca8210.txt: -
compatible: Should be "cascoda,ca8210"
Documentation/devicetree/bindings/net/ieee802154/ca8210.txt:
compatible = "cascoda,ca8210";
drivers/net/ieee802154/ca8210.c: {.compatible = "cascoda,ca8210", },
well ain't that typical, all users are out of tree. The example
in the bindings file is wrong, setting ACTIVE_HIGH. Sigh, let's
assume all those DTS files somewhere are wrong and they
didn't set GPIO_ACTIVE_LOW in them...
Maybe add a comment in the code that this is wrong and the
driver and DTS files should be fixed.
Alternatively patch Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
to set GPIO_ACTIVE_LOW and fix the code to invert it both
here and when getting the GPIO, but it could cause problems
for outoftree users.
Either way, this is good progress:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
next prev parent reply other threads:[~2025-03-03 20:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 16:49 [PATCH v2 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion Andy Shevchenko
2025-03-03 16:49 ` [PATCH net-next v2 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types Andy Shevchenko
2025-03-03 19:51 ` Linus Walleij
2025-03-03 16:49 ` [PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata() Andy Shevchenko
2025-03-03 19:53 ` Linus Walleij
2025-03-04 8:18 ` Miquel Raynal
2025-03-03 16:49 ` [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API Andy Shevchenko
2025-03-03 20:00 ` Linus Walleij [this message]
2025-03-03 20:39 ` Andy Shevchenko
2025-03-04 0:03 ` Linus Walleij
2025-03-04 11:13 ` Andy Shevchenko
2025-03-05 7:40 ` Linus Walleij
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=CACRpkdbCfhqRGOGrCgP-e3AnK_tmHX+eUpZKjitbfemzAXCcWg@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=alex.aring@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stefan@datenfreihafen.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).