[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1414529835-16207-1-git-send-email-dianders@chromium.org>
Date: Tue, 28 Oct 2014 13:57:14 -0700
From: Doug Anderson <dianders@...omium.org>
To: Linus Walleij <linus.walleij@...aro.org>,
Heiko Stuebner <heiko@...ech.de>
Cc: Sonny Rao <sonnyrao@...omium.org>,
linux-rockchip@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
Doug Anderson <dianders@...omium.org>, robh+dt@...nel.org,
pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
iivanov@...sol.com, syin@...adcom.com, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org
Subject: [RFC PATCH 1/2] pinctrl: Add output-disable
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@...omium.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists