* [PATCH v2 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion
@ 2025-03-03 16:49 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
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Andy Shevchenko @ 2025-03-03 16:49 UTC (permalink / raw)
To: Andy Shevchenko, linux-wpan, netdev, linux-kernel, linux-gpio
Cc: Alexander Aring, Stefan Schmidt, Miquel Raynal, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Linus Walleij, Bartosz Golaszewski
The main part is the patch 3 that converts the driver to GPIO descriptor APIs,
the first one is just an ad-hoc fix WRT sparse complains on the bitwise
types misuse. The second one is a small cleanup that helps patch 3 to be nicer.
In v2:
- split and extended cleanup pieces into patch 2 (Miquel)
- updated kernel doc for changed members (Miquel)
- unfolded PTR_ERR_OR_ZERO() to the preferred pattern (Miquel)
- collected tags (Miquel)
Andy Shevchenko (3):
ieee802154: ca8210: Use proper setter and getters for bitwise types
ieee802154: ca8210: Get platform data via dev_get_platdata()
ieee802154: ca8210: Switch to using gpiod API
drivers/net/ieee802154/ca8210.c | 78 +++++++++++++--------------------
1 file changed, 31 insertions(+), 47 deletions(-)
--
2.47.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH net-next v2 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types
2025-03-03 16:49 [PATCH v2 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion Andy Shevchenko
@ 2025-03-03 16:49 ` 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 16:49 ` [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API Andy Shevchenko
2 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2025-03-03 16:49 UTC (permalink / raw)
To: Andy Shevchenko, linux-wpan, netdev, linux-kernel, linux-gpio
Cc: Alexander Aring, Stefan Schmidt, Miquel Raynal, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Linus Walleij, Bartosz Golaszewski
Sparse complains that the driver doesn't respect the bitwise types:
drivers/net/ieee802154/ca8210.c:1796:27: warning: incorrect type in assignment (different base types)
drivers/net/ieee802154/ca8210.c:1796:27: expected restricted __le16 [addressable] [assigned] [usertype] pan_id
drivers/net/ieee802154/ca8210.c:1796:27: got unsigned short [usertype]
drivers/net/ieee802154/ca8210.c:1801:25: warning: incorrect type in assignment (different base types)
drivers/net/ieee802154/ca8210.c:1801:25: expected restricted __le16 [addressable] [assigned] [usertype] pan_id
drivers/net/ieee802154/ca8210.c:1801:25: got unsigned short [usertype]
drivers/net/ieee802154/ca8210.c:1928:28: warning: incorrect type in argument 3 (different base types)
drivers/net/ieee802154/ca8210.c:1928:28: expected unsigned short [usertype] dst_pan_id
drivers/net/ieee802154/ca8210.c:1928:28: got restricted __le16 [addressable] [usertype] pan_id
Use proper setter and getters for bitwise types.
Note, in accordance with [1] the protocol is little endian.
Link: https://www.cascoda.com/wp-content/uploads/2018/11/CA-8210_datasheet_0418.pdf [1]
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/net/ieee802154/ca8210.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 753215ebc67c..a036910f6082 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -1446,8 +1446,7 @@ static u8 mcps_data_request(
command.pdata.data_req.src_addr_mode = src_addr_mode;
command.pdata.data_req.dst.mode = dst_address_mode;
if (dst_address_mode != MAC_MODE_NO_ADDR) {
- command.pdata.data_req.dst.pan_id[0] = LS_BYTE(dst_pan_id);
- command.pdata.data_req.dst.pan_id[1] = MS_BYTE(dst_pan_id);
+ put_unaligned_le16(dst_pan_id, command.pdata.data_req.dst.pan_id);
if (dst_address_mode == MAC_MODE_SHORT_ADDR) {
command.pdata.data_req.dst.address[0] = LS_BYTE(
dst_addr->short_address
@@ -1795,12 +1794,12 @@ static int ca8210_skb_rx(
}
hdr.source.mode = data_ind[0];
dev_dbg(&priv->spi->dev, "srcAddrMode: %#03x\n", hdr.source.mode);
- hdr.source.pan_id = *(u16 *)&data_ind[1];
+ hdr.source.pan_id = cpu_to_le16(get_unaligned_le16(&data_ind[1]));
dev_dbg(&priv->spi->dev, "srcPanId: %#06x\n", hdr.source.pan_id);
memcpy(&hdr.source.extended_addr, &data_ind[3], 8);
hdr.dest.mode = data_ind[11];
dev_dbg(&priv->spi->dev, "dstAddrMode: %#03x\n", hdr.dest.mode);
- hdr.dest.pan_id = *(u16 *)&data_ind[12];
+ hdr.dest.pan_id = cpu_to_le16(get_unaligned_le16(&data_ind[12]));
dev_dbg(&priv->spi->dev, "dstPanId: %#06x\n", hdr.dest.pan_id);
memcpy(&hdr.dest.extended_addr, &data_ind[14], 8);
@@ -1927,7 +1926,7 @@ static int ca8210_skb_tx(
status = mcps_data_request(
header.source.mode,
header.dest.mode,
- header.dest.pan_id,
+ le16_to_cpu(header.dest.pan_id),
(union macaddr *)&header.dest.extended_addr,
skb->len - mac_len,
&skb->data[mac_len],
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()
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 16:49 ` 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
2 siblings, 2 replies; 12+ messages in thread
From: Andy Shevchenko @ 2025-03-03 16:49 UTC (permalink / raw)
To: Andy Shevchenko, linux-wpan, netdev, linux-kernel, linux-gpio
Cc: Alexander Aring, Stefan Schmidt, Miquel Raynal, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Linus Walleij, Bartosz Golaszewski
Access to platform data via dev_get_platdata() getter to make code cleaner.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/net/ieee802154/ca8210.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index a036910f6082..65f042c8734b 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -627,7 +627,8 @@ static int ca8210_spi_transfer(
*/
static void ca8210_reset_send(struct spi_device *spi, unsigned int ms)
{
- struct ca8210_platform_data *pdata = spi->dev.platform_data;
+ struct device *dev = &spi->dev;
+ struct ca8210_platform_data *pdata = dev_get_platdata(dev);
struct ca8210_priv *priv = spi_get_drvdata(spi);
long status;
@@ -2736,9 +2737,10 @@ static int ca8210_config_extern_clk(
*/
static int ca8210_register_ext_clock(struct spi_device *spi)
{
+ struct device *dev = &spi->dev;
+ struct ca8210_platform_data *pdata = dev_get_platdata(dev);
struct device_node *np = spi->dev.of_node;
struct ca8210_priv *priv = spi_get_drvdata(spi);
- struct ca8210_platform_data *pdata = spi->dev.platform_data;
if (!np)
return -EFAULT;
@@ -2784,8 +2786,9 @@ static void ca8210_unregister_ext_clock(struct spi_device *spi)
*/
static int ca8210_reset_init(struct spi_device *spi)
{
+ struct device *dev = &spi->dev;
+ struct ca8210_platform_data *pdata = dev_get_platdata(dev);
int ret;
- struct ca8210_platform_data *pdata = spi->dev.platform_data;
pdata->gpio_reset = of_get_named_gpio(
spi->dev.of_node,
@@ -2813,8 +2816,9 @@ static int ca8210_reset_init(struct spi_device *spi)
*/
static int ca8210_interrupt_init(struct spi_device *spi)
{
+ struct device *dev = &spi->dev;
+ struct ca8210_platform_data *pdata = dev_get_platdata(dev);
int ret;
- struct ca8210_platform_data *pdata = spi->dev.platform_data;
pdata->gpio_irq = of_get_named_gpio(
spi->dev.of_node,
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API
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 16:49 ` [PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata() Andy Shevchenko
@ 2025-03-03 16:49 ` Andy Shevchenko
2025-03-03 20:00 ` Linus Walleij
2 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2025-03-03 16:49 UTC (permalink / raw)
To: Andy Shevchenko, linux-wpan, netdev, linux-kernel, linux-gpio
Cc: Alexander Aring, Stefan Schmidt, Miquel Raynal, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Linus Walleij, Bartosz Golaszewski
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>
---
drivers/net/ieee802154/ca8210.c | 57 +++++++++++----------------------
1 file changed, 19 insertions(+), 38 deletions(-)
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 65f042c8734b..d4c1f00d29fe 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -52,12 +52,10 @@
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
-#include <linux/gpio.h>
#include <linux/ieee802154.h>
#include <linux/io.h>
#include <linux/kfifo.h>
#include <linux/of.h>
-#include <linux/of_gpio.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/poll.h>
@@ -350,8 +348,8 @@ struct work_priv_container {
* @extclockenable: true if the external clock is to be enabled
* @extclockfreq: frequency of the external clock
* @extclockgpio: ca8210 output gpio of the external clock
- * @gpio_reset: gpio number of ca8210 reset line
- * @gpio_irq: gpio number of ca8210 interrupt line
+ * @reset_gpio: ca8210 reset GPIO descriptor
+ * @irq_gpio: ca8210 interrupt GPIO descriptor
* @irq_id: identifier for the ca8210 irq
*
*/
@@ -359,8 +357,8 @@ struct ca8210_platform_data {
bool extclockenable;
unsigned int extclockfreq;
unsigned int extclockgpio;
- int gpio_reset;
- int gpio_irq;
+ struct gpio_desc *reset_gpio;
+ struct gpio_desc *irq_gpio;
int irq_id;
};
@@ -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);
priv->promiscuous = false;
/* Wait until wakeup indication seen */
@@ -2788,24 +2786,14 @@ static int ca8210_reset_init(struct spi_device *spi)
{
struct device *dev = &spi->dev;
struct ca8210_platform_data *pdata = dev_get_platdata(dev);
- int ret;
- pdata->gpio_reset = of_get_named_gpio(
- spi->dev.of_node,
- "reset-gpio",
- 0
- );
-
- ret = gpio_direction_output(pdata->gpio_reset, 1);
- if (ret < 0) {
- dev_crit(
- &spi->dev,
- "Reset GPIO %d did not set to output mode\n",
- pdata->gpio_reset
- );
+ pdata->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(pdata->reset_gpio)) {
+ dev_crit(dev, "Reset GPIO did not set to output mode\n");
+ return PTR_ERR(pdata->reset_gpio);
}
- return ret;
+ return 0;
}
/**
@@ -2820,20 +2808,15 @@ static int ca8210_interrupt_init(struct spi_device *spi)
struct ca8210_platform_data *pdata = dev_get_platdata(dev);
int ret;
- pdata->gpio_irq = of_get_named_gpio(
- spi->dev.of_node,
- "irq-gpio",
- 0
- );
+ pdata->irq_gpio = devm_gpiod_get(dev, "irq", GPIOD_IN);
+ if (IS_ERR(pdata->irq_gpio)) {
+ dev_crit(dev, "Could not retrieve IRQ GPIO\n");
+ return PTR_ERR(pdata->irq_gpio);
+ }
- pdata->irq_id = gpio_to_irq(pdata->gpio_irq);
+ pdata->irq_id = gpiod_to_irq(pdata->irq_gpio);
if (pdata->irq_id < 0) {
- dev_crit(
- &spi->dev,
- "Could not get irq for gpio pin %d\n",
- pdata->gpio_irq
- );
- gpio_free(pdata->gpio_irq);
+ dev_crit(dev, "Could not get irq for IRQ GPIO\n");
return pdata->irq_id;
}
@@ -2844,10 +2827,8 @@ static int ca8210_interrupt_init(struct spi_device *spi)
"ca8210-irq",
spi_get_drvdata(spi)
);
- if (ret) {
+ if (ret)
dev_crit(&spi->dev, "request_irq %d failed\n", pdata->irq_id);
- gpio_free(pdata->gpio_irq);
- }
return ret;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types
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
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2025-03-03 19:51 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-wpan, netdev, linux-kernel, linux-gpio, Alexander Aring,
Stefan Schmidt, Miquel Raynal, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Bartosz Golaszewski
On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Sparse complains that the driver doesn't respect the bitwise types:
>
> drivers/net/ieee802154/ca8210.c:1796:27: warning: incorrect type in assignment (different base types)
> drivers/net/ieee802154/ca8210.c:1796:27: expected restricted __le16 [addressable] [assigned] [usertype] pan_id
> drivers/net/ieee802154/ca8210.c:1796:27: got unsigned short [usertype]
> drivers/net/ieee802154/ca8210.c:1801:25: warning: incorrect type in assignment (different base types)
> drivers/net/ieee802154/ca8210.c:1801:25: expected restricted __le16 [addressable] [assigned] [usertype] pan_id
> drivers/net/ieee802154/ca8210.c:1801:25: got unsigned short [usertype]
> drivers/net/ieee802154/ca8210.c:1928:28: warning: incorrect type in argument 3 (different base types)
> drivers/net/ieee802154/ca8210.c:1928:28: expected unsigned short [usertype] dst_pan_id
> drivers/net/ieee802154/ca8210.c:1928:28: got restricted __le16 [addressable] [usertype] pan_id
>
> Use proper setter and getters for bitwise types.
>
> Note, in accordance with [1] the protocol is little endian.
>
> Link: https://www.cascoda.com/wp-content/uploads/2018/11/CA-8210_datasheet_0418.pdf [1]
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()
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
1 sibling, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2025-03-03 19:53 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-wpan, netdev, linux-kernel, linux-gpio, Alexander Aring,
Stefan Schmidt, Miquel Raynal, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Bartosz Golaszewski
On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Access to platform data via dev_get_platdata() getter to make code cleaner.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API
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
2025-03-03 20:39 ` Andy Shevchenko
0 siblings, 1 reply; 12+ messages in thread
From: Linus Walleij @ 2025-03-03 20:00 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-wpan, netdev, linux-kernel, linux-gpio, Alexander Aring,
Stefan Schmidt, Miquel Raynal, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Bartosz Golaszewski
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API
2025-03-03 20:00 ` Linus Walleij
@ 2025-03-03 20:39 ` Andy Shevchenko
2025-03-04 0:03 ` Linus Walleij
0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2025-03-03 20:39 UTC (permalink / raw)
To: Linus Walleij
Cc: Andy Shevchenko, linux-wpan, netdev, linux-kernel, linux-gpio,
Alexander Aring, Stefan Schmidt, Miquel Raynal, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Bartosz Golaszewski
Mon, Mar 03, 2025 at 09:00:39PM +0100, Linus Walleij kirjoitti:
> On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
...
> > 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,
Yeah, the pin 27 is marked as NRESET and description is pointing out to it as
active low.
> 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.
Or maybe fix in the driver and schema and add a quirk to gpiolib-of.c?
> 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.
Would it? We have such quirks to fix a polarity for other drivers/devices.
> Either way, this is good progress:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Thank you!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API
2025-03-03 20:39 ` Andy Shevchenko
@ 2025-03-04 0:03 ` Linus Walleij
2025-03-04 11:13 ` Andy Shevchenko
0 siblings, 1 reply; 12+ messages in thread
From: Linus Walleij @ 2025-03-04 0:03 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, linux-wpan, netdev, linux-kernel, linux-gpio,
Alexander Aring, Stefan Schmidt, Miquel Raynal, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Bartosz Golaszewski
On Mon, Mar 3, 2025 at 9:39 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> > Maybe add a comment in the code that this is wrong and the
> > driver and DTS files should be fixed.
>
> Or maybe fix in the driver and schema and add a quirk to gpiolib-of.c?
Even better!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()
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
1 sibling, 0 replies; 12+ messages in thread
From: Miquel Raynal @ 2025-03-04 8:18 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-wpan, netdev, linux-kernel, linux-gpio, Alexander Aring,
Stefan Schmidt, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Linus Walleij, Bartosz Golaszewski
On 03/03/2025 at 18:49:09 +02, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> Access to platform data via dev_get_platdata() getter to make code cleaner.
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API
2025-03-04 0:03 ` Linus Walleij
@ 2025-03-04 11:13 ` Andy Shevchenko
2025-03-05 7:40 ` Linus Walleij
0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2025-03-04 11:13 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-wpan, netdev, linux-kernel, linux-gpio, Alexander Aring,
Stefan Schmidt, Miquel Raynal, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Bartosz Golaszewski
On Tue, Mar 04, 2025 at 01:03:41AM +0100, Linus Walleij wrote:
> On Mon, Mar 3, 2025 at 9:39 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>
> > > Maybe add a comment in the code that this is wrong and the
> > > driver and DTS files should be fixed.
> >
> > Or maybe fix in the driver and schema and add a quirk to gpiolib-of.c?
>
> Even better!
I am about to send a v3, I'm going to leave your tag despite a few changes as
discussed. I hope this is okay with you.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API
2025-03-04 11:13 ` Andy Shevchenko
@ 2025-03-05 7:40 ` Linus Walleij
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2025-03-05 7:40 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-wpan, netdev, linux-kernel, linux-gpio, Alexander Aring,
Stefan Schmidt, Miquel Raynal, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Bartosz Golaszewski
On Tue, Mar 4, 2025 at 12:13 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Tue, Mar 04, 2025 at 01:03:41AM +0100, Linus Walleij wrote:
> > On Mon, Mar 3, 2025 at 9:39 PM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> >
> > > > Maybe add a comment in the code that this is wrong and the
> > > > driver and DTS files should be fixed.
> > >
> > > Or maybe fix in the driver and schema and add a quirk to gpiolib-of.c?
> >
> > Even better!
>
> I am about to send a v3, I'm going to leave your tag despite a few changes as
> discussed. I hope this is okay with you.
Of course!
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-03-05 7:40 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).