diff mbox

[1/2] devicetree: power: add bindings for GPIO-driven power switches

Message ID 1481494905-18037-2-git-send-email-bgolaszewski@baylibre.com
State New
Headers show

Commit Message

Bartosz Golaszewski Dec. 11, 2016, 10:21 p.m. UTC
Some boards are equipped with simple, GPIO-driven power load switches.
An example of such ICs is the TI tps229* series.

Add device tree bindings allowing to describe them.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

---
 .../bindings/power/gpio-power-switch.txt           | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/gpio-power-switch.txt

-- 
2.9.3

Comments

Rob Herring (Arm) Dec. 13, 2016, 7:27 p.m. UTC | #1
On Sun, Dec 11, 2016 at 11:21:44PM +0100, Bartosz Golaszewski wrote:
> Some boards are equipped with simple, GPIO-driven power load switches.

> An example of such ICs is the TI tps229* series.


How is this different than a GPIO regulator? The input and output 
voltages just happen to be the same. I could be convinced this is 
different enough to have a different compatible, but it somewhat seems 
you want to use this for IIO, so you are creating a different binding 
for that usecase.

Rob
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/power/gpio-power-switch.txt b/Documentation/devicetree/bindings/power/gpio-power-switch.txt
new file mode 100644
index 0000000..21420ed
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/gpio-power-switch.txt
@@ -0,0 +1,25 @@ 
+GPIO Power Switch
+-----------------
+
+This is the device tree binding for simple, GPIO-driven power load switches
+that do not have any control signals.
+
+Required properties:
+
+- compatible:           must be "gpio-power-switch"
+- power-gpios:          phandle for the GPIO driving the power load switch
+
+Optional properties:
+
+- power-switch-name:    the name of the power switch
+- power-switch-on:      the power switch GPIO is driven high by default
+
+Example
+-------
+
+acme_probe0_power_switch: gpio_power_switch@0 {
+	compatible = "gpio-power-switch";
+	power-switch-name = "acme_probe0_switch";
+	power-gpios = <&pca9535 1 GPIO_ACTIVE_HIGH>;
+	power-switch-on;
+};