[PATCH v3 13/21] gpio: add support of new GPIO direction flag

Tom Rini trini at konsulko.com
Fri Apr 17 23:06:58 CEST 2020


On Mon, Jan 13, 2020 at 11:35:07AM +0100, Patrick Delaunay wrote:

> 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 at st.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200417/5c18f39d/attachment.sig>


More information about the U-Boot mailing list