linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] pinctrl: Add output-disable
@ 2014-10-28 20:57 Doug Anderson
  2014-10-28 20:57 ` [RFC PATCH 2/2] pinctrl: rockchip: Implement PIN_CONFIG_OUTPUT_DISABLE Doug Anderson
  2014-10-31  8:49 ` [RFC PATCH 1/2] pinctrl: Add output-disable Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Doug Anderson @ 2014-10-28 20:57 UTC (permalink / raw)
  To: linux-arm-kernel

The pinctrl bindings / API allow you to specify that:
- a pin should be an output
- a pin should have its input path enabled / disabled

...but they don't allow you to tell a pin to stop outputting.  Lets
add a new setting for that just in case the bootloader (or the default
state) left a pin as an output and we don't want it that way anymore.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt | 1 +
 drivers/pinctrl/pinconf-generic.c                              | 1 +
 include/linux/pinctrl/pinconf-generic.h                        | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
index 98eb94d..9ac8591 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
@@ -183,6 +183,7 @@ low-power-enable	- enable low power mode
 low-power-disable	- disable low power mode
 output-low		- set the pin to output mode with low level
 output-high		- set the pin to output mode with high level
+output-disable		- disable output to the pin
 slew-rate		- set the slew rate
 
 For example:
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index 29ff77f..ec4d95f 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -171,6 +171,7 @@ static struct pinconf_generic_dt_params dt_params[] = {
 	{ "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 },
 	{ "output-low", PIN_CONFIG_OUTPUT, 0, },
 	{ "output-high", PIN_CONFIG_OUTPUT, 1, },
+	{ "output-disable", PIN_CONFIG_OUTPUT_DISABLE, 1, },
 	{ "slew-rate", PIN_CONFIG_SLEW_RATE, 0},
 };
 
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index d578a60..52b0429 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -89,6 +89,8 @@
  *	1 to indicate high level, argument 0 to indicate low level. (Please
  *	see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a
  *	discussion around this parameter.)
+ * @PIN_CONFIG_OUTPUT_DISABLE: this will configure the pin _not_ to output.
+ *	Parameter should be 1.
  * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
  *	you need to pass in custom configurations to the pin controller, use
  *	PIN_CONFIG_END+1 as the base offset.
@@ -112,6 +114,7 @@ enum pin_config_param {
 	PIN_CONFIG_SLEW_RATE,
 	PIN_CONFIG_LOW_POWER_MODE,
 	PIN_CONFIG_OUTPUT,
+	PIN_CONFIG_OUTPUT_DISABLE,
 	PIN_CONFIG_END = 0x7FFF,
 };
 
-- 
2.1.0.rc2.206.gedb03e5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-14  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-28 20:57 [RFC PATCH 1/2] pinctrl: Add output-disable Doug Anderson
2014-10-28 20:57 ` [RFC PATCH 2/2] pinctrl: rockchip: Implement PIN_CONFIG_OUTPUT_DISABLE Doug Anderson
2014-10-31  8:49 ` [RFC PATCH 1/2] pinctrl: Add output-disable Linus Walleij
2014-11-03 21:09   ` Doug Anderson
2014-11-14  8:37     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).