summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2019-01-04 10:55:05 +0100
committerTom Rini <trini@konsulko.com>2019-01-09 07:13:32 -0500
commit39a8f0be2d3df589ba227310e66dca706e154920 (patch)
tree44da907d86a4c537b50bf897e426bb6e2364c6d7 /drivers/gpio
parent17be909a1b67e919de6fc20b23f35c66a4cdf4c6 (diff)
gpio: stm32f7: Fix gpio bank hole management
In case "gpio-ranges" property is not present in device tree, use default value for gpio_count and gpio_range. This fixes an issue on stm32 F7 and H7 boards where "pinmux status -a" command didn't return any pin status due to the fact that both stm32 F7 and H7 board DT doesn't use the gpio-ranges property. Fixes: dbf928dd2634a6("gpio: stm32f7: Add gpio bank holes management") Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/stm32f7_gpio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/stm32f7_gpio.c b/drivers/gpio/stm32f7_gpio.c
index f160b4e689..dbaa80cf8c 100644
--- a/drivers/gpio/stm32f7_gpio.c
+++ b/drivers/gpio/stm32f7_gpio.c
@@ -171,6 +171,11 @@ static int gpio_stm32_probe(struct udevice *dev)
ret = dev_read_phandle_with_args(dev, "gpio-ranges",
NULL, 3, i, &args);
+ if (ret == -ENOENT) {
+ uc_priv->gpio_count = STM32_GPIOS_PER_BANK;
+ priv->gpio_range = GENMASK(STM32_GPIOS_PER_BANK - 1, 0);
+ }
+
while (ret != -ENOENT) {
priv->gpio_range |= GENMASK(args.args[2] + args.args[0] - 1,
args.args[0]);