]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
gpio: Alter semantics of *raw* operations to actually be raw
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 26 Sep 2017 19:20:23 +0000 (21:20 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 4 Oct 2017 06:38:02 +0000 (08:38 +0200)
commit02e479808b5d62f8f09e426968a410e399b1f8ff
tree3659b9b4f53647d592d8f6909e1267ee3467bd12
parentfac9d8850a0c94c1d237fef2a3a238f7dbed39cf
gpio: Alter semantics of *raw* operations to actually be raw

Currently calls to:
gpiod_direction_output_raw()
gpiod_set_raw_value()
gpiod_set_raw_array_value()
gpiod_set_raw_value_cansleep()
gpiod_set_raw_array_value_cansleep()

Respect that we do not want to invert the value written, but will
still apply special open drain/open source semantics if the line has
an open drain/open source flag.

It also forbids us from driving an output marked as an interrupt
line.

This does not fit with the function name and expected semantics. In
the w1 host driver (for example) we need to handle a line as open drain
but sometimes force it to pull up, which means we should be able to
use the gpiod_set_raw_value() for this, but it currently does not
work.

There are also use cases where users actually want to drive a line
used by an interrupt. This is what they should be expected to use
the *raw* accessors for.

I have looked over the current users of this API and they do not seem
to be using the *raw* accessors with open drain or open source so let's
augment this behaviour before we have users expecting the inconsistent
semantic.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c