gpio: emulate open drain & open source in dm_gpio_set_value()
authorNeil Armstrong <narmstrong@baylibre.com>
Tue, 5 May 2020 08:43:17 +0000 (10:43 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Mon, 11 May 2020 13:12:53 +0000 (15:12 +0200)
commit47bd533e9dd0f967ff7b62f3edfd6c97131e1501
tree2454f95a2f6666d56fa3351f78fdad2cb435cda0
parent375d79cdbb6bdeaa9bc10dd34c3b22dd6838d4f3
gpio: emulate open drain & open source in dm_gpio_set_value()

Handle the GPIOD_OPEN_DRAIN & GPIOD_OPEN_SOURCE flags to emulate open drain
and open source by setting the GPIO line as input depending on the
requested value.

The behaviour is taken from the Linux gpiolib.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/gpio/gpio-uclass.c