Thread (15 messages) 15 messages, 4 authors, 2025-09-22

Re: [PATCH v4 5/6] can: mcp251xfd: add gpio functionality

From: Bartosz Golaszewski <hidden>
Date: 2025-09-22 14:29:06
Also in: linux-can, lkml

On Thu, Sep 18, 2025 at 12:58 PM Marc Kleine-Budde [off-list ref] wrote:
On 18.09.2025 05:46:44, Bartosz Golaszewski wrote:
quoted
quoted
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index ea41f04ae1a6..8c253091f498 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -16,6 +16,7 @@
 #include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/device.h>
+#include <linux/gpio/driver.h>
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
@@ -1797,6 +1798,178 @@ static int mcp251xfd_register_check_rx_int(struct mcp251xfd_priv *priv)
    return 0;
 }

+#ifdef CONFIG_GPIOLIB
Any reason why you don't just depend on GPIOLIB in Kconfig? There's no
reason to make it optional if the device always has the GPIO pins.
I don't mind having the ifdef. But it's up to you.

[...]
quoted
quoted
+static void mcp251xfd_gpio_set(struct gpio_chip *chip, unsigned int offset,
+                          int value)
You must be rebased on pre v6.17 code, this will not compile with current
mainline.
You mean "post" v6.17? Best rebase to latest net-next/main, which
already contains the new signatures for the GPIO callbacks.
No, you read that right. The signature of the set() and set_multiple()
callbacks changed in v6.17-rc1 so Viken must have rebased his changes
on v6.16 or earlier.

Bartosz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help