Skip to content

Commit 752f387

Browse files
Thomas Blocherlinusw
authored andcommitted
pinctrl: at91: make it work with current gpiolib
pinctrl-at91 currently does not support the gpio-groups devicetree property and has no pin-range. Because of this at91 gpios stopped working since patch commit 2ab73c6 ("gpio: Support GPIO controllers without pin-ranges") This was discussed in the patches commit fc328a7 ("gpio: Revert regression in sysfs-gpio (gpiolib.c)") commit 56e337f ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") As a workaround manually set pin-range via gpiochip_add_pin_range() until a) pinctrl-at91 is reworked to support devicetree gpio-groups b) another solution as mentioned in commit 56e337f ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") is found Signed-off-by: Thomas Blocher <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent b7fd103 commit 752f387

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/pinctrl/pinctrl-at91.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,8 +1403,11 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
14031403

14041404
/* We will handle a range of GPIO pins */
14051405
for (i = 0; i < gpio_banks; i++)
1406-
if (gpio_chips[i])
1406+
if (gpio_chips[i]) {
14071407
pinctrl_add_gpio_range(info->pctl, &gpio_chips[i]->range);
1408+
gpiochip_add_pin_range(&gpio_chips[i]->chip, dev_name(info->pctl->dev), 0,
1409+
gpio_chips[i]->range.pin_base, gpio_chips[i]->range.npins);
1410+
}
14081411

14091412
dev_info(dev, "initialized AT91 pinctrl driver\n");
14101413

0 commit comments

Comments
 (0)