]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
gpio: mvebu_gpio: Read number of gpios from DT
authorPali Rohár <pali@kernel.org>
Mon, 25 Jul 2022 11:56:13 +0000 (13:56 +0200)
committerStefan Roese <sr@denx.de>
Thu, 28 Jul 2022 13:17:46 +0000 (15:17 +0200)
Device tree property "ngpios" contains number of gpios.
Use it when available.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/gpio/mvebu_gpio.c

index 888ccfe4d13ed2988fe355ed6c4b9ec523f88f13..55ed685f70f8afea2e8ac8030e7e2f625e7caf02 100644 (file)
@@ -92,7 +92,7 @@ static int mvebu_gpio_probe(struct udevice *dev)
        struct mvebu_gpio_priv *priv = dev_get_priv(dev);
 
        priv->regs = dev_read_addr_ptr(dev);
-       uc_priv->gpio_count = MVEBU_GPIOS_PER_BANK;
+       uc_priv->gpio_count = dev_read_u32_default(dev, "ngpios", MVEBU_GPIOS_PER_BANK);
        priv->name[0] = 'A' + dev_seq(dev);
        uc_priv->bank_name = priv->name;