u-boot/drivers/pinctrl
Patrice Chotard 427f452cb9 gpio: stm32_gpio: Rework GPIO hole management
On some STM32 SoC's package, GPIO bank may have hole in their GPIO bank
Example:
  If GPIO bank have 16 GPIO pins [0-15].
  In particular SoC's package case, some GPIO bank can have less GPIO pins:
    - [0-10] => 11 pins;
    - [2-7] => 6 pins.

Commit dbf928dd26 ("gpio: stm32f7: Add gpio bank holes management")
proposed a first implementation by not counting GPIO "inside" hole. GPIO
are not displaying correctly using gpio or pinmux command when GPIO holes
are located at the beginning of GPIO bank.

To simplify, consider that all GPIO have 16 GPIO and use the gpio_ranges
struct to indicate if a GPIO is mapped or not. GPIO uclass offers several
GPIO functions ("input", "output", "unused", "unknown" and "func"), use
"unknown" GPIO function to indicate that a GPIO is not mapped.

stm32_offset_to_index() is no more needed and removed.

This must be reflected using the "gpio" command to indicate to user
that a particular GPIO is not mapped (marked as "unknown") as shown below:

Example for a 16 pins GPIO bank with the [2-7] mapping (only 6 pins
mapped):
GPIOI0          : unknown
GPIOI1          : unknown
GPIOI2          : analog
GPIOI3          : analog
GPIOI4          : alt function 0 push-pull pull-down
GPIOI5          : alt function 0 push-pull pull-down
GPIOI6          : alt function 0 push-pull pull-down
GPIOI7          : analog
GPIOI8          : unknown
GPIOI9          : unknown
GPIOI10         : unknown
GPIOI11         : unknown
GPIOI12         : unknown
GPIOI13         : unknown
GPIOI14         : unknown
GPIOI15         : unknown

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-05-10 13:54:48 +02:00
..
aspeed pinctrl: Add the pinctrl setting for PWM. 2022-03-25 13:35:50 -04:00
ath79 common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
broadcom dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
exynos exynos78x0: pinctrl: set const to structs 2021-11-09 14:07:46 +09:00
intel doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
mediatek pinctrl: mediatek: add support for different types of IO pins 2022-05-05 09:29:58 -04:00
meson pinctrl: meson: Correct the driver GPIO declaration 2021-11-19 18:15:26 +01:00
mscc pinctrl: mscc: Fix multiple definition error 2021-07-07 10:17:54 -04:00
mtmips common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mvebu arm64: a37xx: pinctrl: Fix PWM pins indexes 2022-03-04 08:38:05 +01:00
nexell global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
nxp pinctrl: nxp: don't automatically select DEVRES 2022-04-12 15:36:17 +02:00
renesas WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
rockchip rockchip: rk3066: add rk3066 pinctrl driver 2022-04-18 11:25:13 +08:00
sunxi pinctrl: sunxi: Add SPI0 pinmuxes 2022-04-04 23:24:17 +01:00
uniphier dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
Kconfig vpl: Add Kconfig options for VPL 2022-05-02 09:58:13 -04:00
Makefile Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi 2022-04-05 08:33:32 -04:00
pinctrl-apple.c pinctrl: Add Apple pinctrl driver 2021-11-17 17:04:58 -05:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: add support for slew-rate 2021-03-02 09:28:33 +02:00
pinctrl-at91.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
pinctrl-generic.c pinctrl: Add pinmux property support to pinctrl-generic 2020-10-08 11:42:36 -04:00
pinctrl-k210.c pinctrl: k210: Fix bias-pull-up 2022-03-15 17:43:11 +08:00
pinctrl-qe-io.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
pinctrl-sandbox.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
pinctrl-single.c pinctrl: single: add support for pinctrl-single, pins when #pinctrl-cells = 2 2022-01-18 08:31:02 -05:00
pinctrl-sti.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
pinctrl-stmfx.c pinctrl: stmfx: define LOG_CATEGORY 2021-11-30 11:20:34 +01:00
pinctrl-uclass.c treewide: Use OF_REAL instead of !OF_PLATDATA 2021-09-25 09:46:15 -06:00
pinctrl-zynqmp.c pinctrl: zynqmp: Add pinctrl driver 2022-03-14 15:23:31 +01:00
pinctrl_pic32.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
pinctrl_stm32.c gpio: stm32_gpio: Rework GPIO hole management 2022-05-10 13:54:48 +02:00