pinctrl: bcm2835: Add support for BCM2711 pull-up functionality
authorStefan Wahren <wahrenst@gmx.net>
Sun, 21 Jul 2019 14:01:36 +0000 (16:01 +0200)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:06 +0000 (16:33 +0100)
commit e38a9a437fb93ddafab5030165e4c6a3a5021669 upstream.

The BCM2711 has a new way of selecting the pull-up/pull-down setting
for a GPIO pin. The registers used for the BCM2835, GP_PUD and
GP_PUDCLKn0, are no longer connected. A new set of registers,
GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
a new compatible string "brcm,bcm2711-gpio" and the kernel
driver will use it to select which method is used to select
pull-up/pull-down.

This patch based on a patch by Al Cooper which was intended for the
BCM7211. This is a bugfixed and improved version.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Eric Anholt <eric@anholt.net>
drivers/pinctrl/bcm/pinctrl-bcm2835.c

index 76fad11..3cd4c4f 100644 (file)
@@ -1168,6 +1168,12 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
                        (const struct pinconf_ops *)match->data;
        }
 
+       match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
+       if (match) {
+               bcm2835_pinctrl_desc.confops =
+                       (const struct pinconf_ops *)match->data;
+       }
+
        pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
        if (IS_ERR(pc->pctl_dev)) {
                gpiochip_remove(&pc->gpio_chip);