[openwrt/openwrt] ramips: adjusted pinctrl-aw9523 for kernel 6.6

LEDE Commits lede-commits at lists.infradead.org
Thu Apr 4 22:58:48 PDT 2024


nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/359a9295f2e3385afa867a6c350252d46dd39f6c

commit 359a9295f2e3385afa867a6c350252d46dd39f6c
Author: Mieczyslaw Nalewaj <namiltd at yahoo.com>
AuthorDate: Fri Mar 15 09:08:09 2024 +0100

    ramips: adjusted pinctrl-aw9523 for kernel 6.6
    
    Compatiblity with kernel 6.6 for Awinic AW9523B i2c pin controller driver.
    It follows the kernel patch: i2c: Drop legacy callback .probe_new() (https://github.com/torvalds/linux/commit/5eb1e6e459cfa025f79c43014f66ff62a55542f1)
    and kernel patch: gpiolib: Get rid of not used of_node member (https://github.com/torvalds/linux/commit/70d0fc4288dabd65025fde7774b4f9262afa9034)
    
    Signed-off-by: Mieczyslaw Nalewaj <namiltd at yahoo.com>
---
 target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
index 65babf9946..a429bb82a3 100644
--- a/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
+++ b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
@@ -810,7 +810,11 @@ static int aw9523_init_gpiochip(struct aw9523 *awi, unsigned int npins)
 	gpiochip->set_multiple = aw9523_gpio_set_multiple;
 	gpiochip->set_config = gpiochip_generic_config;
 	gpiochip->parent = dev;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
+	gpiochip->fwnode = dev->fwnode;
+#else
 	gpiochip->of_node = dev->of_node;
+#endif
 	gpiochip->owner = THIS_MODULE;
 	gpiochip->can_sleep = true;
 
@@ -984,8 +988,12 @@ static int aw9523_hw_init(struct aw9523 *awi)
 	return regmap_reinit_cache(awi->regmap, &aw9523_regmap);
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
+static int aw9523_probe(struct i2c_client *client)
+#else
 static int aw9523_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
+#endif
 {
 	struct device *dev = &client->dev;
 	struct pinctrl_desc *pdesc;




More information about the lede-commits mailing list