]> git.baikalelectronics.ru Git - uboot.git/commit
dm: gpio: Add a way to update flags
authorSimon Glass <sjg@chromium.org>
Fri, 5 Feb 2021 04:22:03 +0000 (21:22 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 3 Mar 2021 20:40:10 +0000 (15:40 -0500)
commitf1a91a7c8d14c3fc4abe9ac54456c689ce5ef9ae
treef88b161ef06be9f95832f3b3dabe62a6dbcd3128
parent90a55b79cc0e340948f86c7171e37bc1f6e7a29a
dm: gpio: Add a way to update flags

It is convenient to be able to adjust some of the flags for a GPIO while
leaving others alone. Add a function for this.

Update dm_gpio_set_dir_flags() to make use of this.

Also update dm_gpio_set_value() to use this also, since this allows the
open-drain / open-source features to be implemented directly in the
driver, rather than using the uclass workaround.

Update the sandbox tests accordingly. This involves a lot of changes to
dm_test_gpio_opendrain_opensource() since we no-longer have the direciion
being reported differently depending on the open drain/open source flags.

Also update the STM32 drivers to let the uclass handle the active low/high
logic.

Drop the GPIOD_FLAGS_OUTPUT() macro which is no-longer used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
drivers/gpio/gpio-uclass.c
drivers/gpio/stm32_gpio.c
drivers/pinctrl/pinctrl-stmfx.c
include/asm-generic/gpio.h
test/dm/gpio.c