u-boot/drivers/gpio
Patrick Delaunay 477ca57b9a gpio: add support of new GPIO direction flag
This commit manages the new dir flags that can be used in gpio
specifiers to indicate the pull-up or pull-down resistor
configuration for output gpio (GPIO_PULL_UP, GPIO_PULL_DOWN)
or the Open Drain/Open Source configuration for input gpio
(GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE).

These flags are already supported in Linux kernel in gpio lib.

This patch only parse and save the direction flags in GPIO
descriptor (desc->flags), it prepares the introduction of new ops
to manage them.
The GPIO uclass supports new GPIO flags from device-tree
(GPIO_XXX define in include/dt-bindings/gpio/gpio.h)
and translate them in the dir flags (GPIOD_XXX):
- GPIO_PULL_UP     => GPIOD_PULL_UP
- GPIO_PULL_DOWN   => GPIOD_PULL_DOWN
- GPIO_OPEN_DRAIN  => GPIOD_OPEN_DRAIN
- GPIO_OPEN_SOURCE => GPIOD_OPEN_SOURCE

This patch also adds protection in the check_dir_flags function for
new invalid configuration of the dir flags.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-16 23:06:54 -04:00
..
74x164_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
adi_gpio2.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
altera_pio.c gpio: altera_pio: fix get_value 2019-02-25 16:07:36 +01:00
at91_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
atmel_pio4.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
axp_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bcm2835_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bcm6345_gpio.c gpio: bcm6345: switch to raw I/O functions 2019-04-12 17:32:51 +02:00
cortina_gpio.c gpio: cortina_gpio: add DM_GPIO driver for CAxxxx SoCs 2020-02-07 14:01:21 -05:00
da8xx_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
da8xx_gpio.h dm: gpio: Allow control of GPIO uclass in SPL 2019-12-15 08:52:29 +08:00
db8500_gpio.c GPIO: Correct doc typo "confguration" -> "configuration" 2017-02-08 16:24:29 -05:00
dwapb_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
gpio-rcar.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
gpio-rza1.c gpio: renesas: Add RZ/A1 R7S72100 GPIO driver 2019-05-07 05:41:32 +02:00
gpio-uclass.c gpio: add support of new GPIO direction flag 2020-04-16 23:06:54 -04:00
gpio-uniphier.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
hi6220_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
hsdk-creg-gpio.c GPIO: CREG: improve flexibility of hsdk-creg-gpio driver 2018-07-31 07:49:47 +03:00
imx_rgpio2p.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
intel_broadwell_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
intel_gpio.c gpio: intel_gpio: Fix register/bit offsets intel_gpio_get_value() 2020-02-04 12:54:55 +08:00
intel_ich6_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Kconfig gpio/mpc83xx_spisel_boot.c: gpio driver for SPISEL_BOOT signal 2020-03-31 10:06:52 -04:00
kona_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
kw_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lpc32xx_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile gpio/mpc83xx_spisel_boot.c: gpio driver for SPISEL_BOOT signal 2020-03-31 10:06:52 -04:00
mpc8xxx_gpio.c gpio: remove the open_drain API and ops 2020-04-16 23:06:54 -04:00
mpc83xx_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
mpc83xx_spisel_boot.c gpio/mpc83xx_spisel_boot.c: gpio driver for SPISEL_BOOT signal 2020-03-31 10:06:52 -04:00
mscc_sgpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
msm_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mt7621_gpio.c gpio: Add MT7621 GPIO support 2018-11-18 16:02:22 +01:00
mvebu_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mvgpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
mvgpio.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mvmfp.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxc_gpio.c gpio: mxc_gpio: add support for i.MXRT1050 2020-01-14 22:53:59 +01:00
mxs_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
omap_gpio.c dm: gpio: Allow control of GPIO uclass in SPL 2019-12-15 08:52:29 +08:00
pca953x_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
pca953x.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pca9698.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
pcf8575_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pic32_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pm8916_gpio.c sandbox: spmi: Add ranges property for address translation 2019-10-08 13:57:39 +08:00
rk_gpio.c rockchip: use 'arch-rockchip' as header file path 2019-05-01 00:00:05 +02:00
s5p_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sandbox.c gpio: remove the open_drain API and ops 2020-04-16 23:06:54 -04:00
sh_pfc.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
sifive-gpio.c gpio: sifive: add support for DM based gpio driver for FU540-SoC 2019-10-18 09:04:01 +08:00
spear_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
stm32_gpio.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
sunxi_gpio.c dm: gpio: Allow control of GPIO uclass in SPL 2019-12-15 08:52:29 +08:00
tca642x.c GPIO: tca642x: Rework to not include commands in SPL 2018-01-19 15:49:29 -05:00
tegra186_gpio_priv.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
tegra186_gpio.c gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers 2018-11-14 09:16:28 -08:00
tegra_gpio.c gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers 2018-11-14 09:16:28 -08:00
vybrid_gpio.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
xilinx_gpio.c gpio: xilinx: Add support for using label property 2018-08-07 11:03:43 +02:00
zynq_gpio.c gpio: zynq: Add gpio driver support for PMC gpio 2019-10-24 13:37:01 +02:00