Message ID | 20250303164928.1466246-1-andriy.shevchenko@linux.intel.com |
---|---|
Headers | show |
Series | ieee802154: ca8210: Sparse fix and GPIOd conversion | expand |
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
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!
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
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.
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