]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: don't clear FLAG_IS_OUT when emulating open-drain/open-source
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 1 Oct 2019 09:44:53 +0000 (11:44 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 1 Oct 2019 09:44:53 +0000 (11:44 +0200)
commitfd5b8223f8797b416cc6a96790e3039bb65ac43e
treed754d7427e44d9f89a64c9ed2a6c216dbdf60f6c
parentf5c4776cd5b591eea4e9be9f421e34f61b98ebb2
gpiolib: don't clear FLAG_IS_OUT when emulating open-drain/open-source

When emulating open-drain/open-source by not actively driving the output
lines - we're simply changing their mode to input. This is wrong as it
will then make it impossible to change the value of such line - it's now
considered to actually be in input mode. If we want to still use the
direction_input() callback for simplicity then we need to set FLAG_IS_OUT
manually in gpiod_direction_output() and not clear it in
gpio_set_open_drain_value_commit() and
gpio_set_open_source_value_commit().

Fixes: 026a10d27283 ("gpio: support native single-ended hardware drivers")
Cc: stable@vger.kernel.org
Reported-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib.c