diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2017-11-30 14:25:24 +1030 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-12-02 22:42:34 +0100 |
commit | e10f72bf4b3e8885c1915a119141481e7fc45ca8 (patch) | |
tree | 12f85b22ea1e17f9bb38f9cbb61a62da2abe44cd /drivers/gpio/gpiolib.h | |
parent | e2843cb6cd6ba433d18d87e3e922b6e49ecccf01 (diff) | |
download | linux-e10f72bf4b3e8885c1915a119141481e7fc45ca8.tar.gz linux-e10f72bf4b3e8885c1915a119141481e7fc45ca8.tar.bz2 linux-e10f72bf4b3e8885c1915a119141481e7fc45ca8.zip |
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>
Diffstat (limited to 'drivers/gpio/gpiolib.h')
-rw-r--r-- | drivers/gpio/gpiolib.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index cd4622863fe1..5e1f7cc6eeb6 100644 --- a/drivers/gpio/gpiolib.h +++ b/drivers/gpio/gpiolib.h @@ -209,7 +209,7 @@ struct gpio_desc { #define FLAG_OPEN_SOURCE 8 /* Gpio is open source type */ #define FLAG_USED_AS_IRQ 9 /* GPIO is connected to an IRQ */ #define FLAG_IS_HOGGED 11 /* GPIO is hogged */ -#define FLAG_SLEEP_MAY_LOSE_VALUE 12 /* GPIO may lose value in sleep */ +#define FLAG_TRANSITORY 12 /* GPIO may lose value in sleep or reset */ /* Connection label */ const char *label; |