diff options
| author | Patrice Chotard <[email protected]> | 2018-12-03 10:52:51 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2018-12-07 08:13:47 -0500 |
| commit | dbf928dd2634a682e6d549e6dd61e3f2a0e5db90 (patch) | |
| tree | ed7c1475dc616518f772d148f3e8bc762f4f7c61 /arch | |
| parent | 043550415b09c6ffd2d9c0af28cc977bfae9f166 (diff) | |
gpio: stm32f7: Add gpio bank holes management
In some STM32 SoC packages, GPIO bank has not always 16 gpios.
Several cases can occur, gpio hole can be located at the beginning,
middle or end of the gpio bank or a combination of these 3
configurations.
For that, gpio bindings offer the gpio-ranges DT property which
described the gpio bank mapping.
Signed-off-by: Patrice Chotard <[email protected]>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm/include/asm/arch-stm32/gpio.h | 3 | ||||
| -rw-r--r-- | arch/arm/mach-stm32mp/include/mach/gpio.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-stm32/gpio.h b/arch/arm/include/asm/arch-stm32/gpio.h index 84859b14479..8ba15b73559 100644 --- a/arch/arm/include/asm/arch-stm32/gpio.h +++ b/arch/arm/include/asm/arch-stm32/gpio.h @@ -109,6 +109,9 @@ struct stm32_gpio_regs { struct stm32_gpio_priv { struct stm32_gpio_regs *regs; + unsigned int gpio_range; }; +int stm32_offset_to_index(struct udevice *dev, unsigned int offset); + #endif /* _GPIO_H_ */ diff --git a/arch/arm/mach-stm32mp/include/mach/gpio.h b/arch/arm/mach-stm32mp/include/mach/gpio.h index 5151150b8d8..46bef21f79f 100644 --- a/arch/arm/mach-stm32mp/include/mach/gpio.h +++ b/arch/arm/mach-stm32mp/include/mach/gpio.h @@ -110,5 +110,9 @@ struct stm32_gpio_regs { struct stm32_gpio_priv { struct stm32_gpio_regs *regs; + unsigned int gpio_range; }; + +int stm32_offset_to_index(struct udevice *dev, unsigned int offset); + #endif /* _STM32_GPIO_H_ */ |
