]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: gpiolib: Generalise state persistence beyond sleep
authorAndrew Jeffery <andrew@aj.id.au>
Thu, 30 Nov 2017 03:55:24 +0000 (14:25 +1030)
committerLinus Walleij <linus.walleij@linaro.org>
Sat, 2 Dec 2017 21:42:34 +0000 (22:42 +0100)
commit92b0a74c34b485db6e4cf74db18f7d0ab3a13dbe
tree12f85b22ea1e17f9bb38f9cbb61a62da2abe44cd
parent2215cda1f8d4f3b683390b0ec496d6afa9b05dc7
gpio: gpiolib: Generalise state persistence beyond sleep

General support for state persistence is added to gpiolib with the
introduction of a new pinconf parameter to propagate the request to
hardware. The existing persistence support for sleep is adapted to
include hardware support if the GPIO driver provides it. Persistence
continues to be enabled by default; in-kernel consumers can opt out, but
userspace (currently) does not have a choice.

The *_SLEEP_MAY_LOSE_VALUE and *_SLEEP_MAINTAIN_VALUE symbols are
renamed, dropping the SLEEP prefix to reflect that the concept is no
longer sleep-specific.  I feel that renaming to just *_MAY_LOSE_VALUE
could initially be misinterpreted, so I've further changed the symbols
to *_TRANSITORY and *_PERSISTENT to address this.

The sysfs interface is modified only to keep consistency with the
chardev interface in enforcing persistence for userspace exports.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-of.c
drivers/gpio/gpiolib-sysfs.c
drivers/gpio/gpiolib.c
drivers/gpio/gpiolib.h
include/dt-bindings/gpio/gpio.h
include/linux/gpio/consumer.h
include/linux/gpio/machine.h
include/linux/of_gpio.h
include/linux/pinctrl/pinconf-generic.h