aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pinctrl
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2017-11-29 22:55:24 -0500
committerLinus Walleij <linus.walleij@linaro.org>2017-12-02 16:42:34 -0500
commite10f72bf4b3e8885c1915a119141481e7fc45ca8 (patch)
tree12f85b22ea1e17f9bb38f9cbb61a62da2abe44cd /include/linux/pinctrl
parente2843cb6cd6ba433d18d87e3e922b6e49ecccf01 (diff)
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 'include/linux/pinctrl')
-rw-r--r--include/linux/pinctrl/pinconf-generic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index ec6dadcc1fde..6c0680641108 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -94,6 +94,7 @@
94 * or latch delay (on outputs) this parameter (in a custom format) 94 * or latch delay (on outputs) this parameter (in a custom format)
95 * specifies the clock skew or latch delay. It typically controls how 95 * specifies the clock skew or latch delay. It typically controls how
96 * many double inverters are put in front of the line. 96 * many double inverters are put in front of the line.
97 * @PIN_CONFIG_PERSIST_STATE: retain pin state across sleep or controller reset
97 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if 98 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
98 * you need to pass in custom configurations to the pin controller, use 99 * you need to pass in custom configurations to the pin controller, use
99 * PIN_CONFIG_END+1 as the base offset. 100 * PIN_CONFIG_END+1 as the base offset.
@@ -122,6 +123,7 @@ enum pin_config_param {
122 PIN_CONFIG_SLEEP_HARDWARE_STATE, 123 PIN_CONFIG_SLEEP_HARDWARE_STATE,
123 PIN_CONFIG_SLEW_RATE, 124 PIN_CONFIG_SLEW_RATE,
124 PIN_CONFIG_SKEW_DELAY, 125 PIN_CONFIG_SKEW_DELAY,
126 PIN_CONFIG_PERSIST_STATE,
125 PIN_CONFIG_END = 0x7F, 127 PIN_CONFIG_END = 0x7F,
126 PIN_CONFIG_MAX = 0xFF, 128 PIN_CONFIG_MAX = 0xFF,
127}; 129};