[PATCH 16/18 v2] regulator: fixed/gpio: Update device tree bindings

From: Linus Walleij
Date: Sun Apr 22 2018 - 19:10:44 EST


Deprecate the open drain binding for fixed regulator and indicate
that we prefer this to be passed in the GPIO phandle flags.

Clarify that the line inversion semantics for fixed and GPIO
regulators completely overrides the active low flags in the
phandle flags.

Unfortunately this can not be changed to prefer that we pass
the flags in the phandle: the bindings have been specified and
deployed such that the presence/absence of this flag and only
that controls the line inversion semantics. The crucial semantic
is that the absence of the flag means the core will assume
the line is active low, which in GPIO terms is an exception,
as GPIO lines are normally assumed to be active high.

This special device tree semantic cannot be changed without
introducing a whole new compatible string for the fixed and
GPIO regulators, so we just contain the situation.

Cc: devicetree@xxxxxxxxxxxxxxx
Reviewed-by: Rob Herring <robh@xxxxxxxxxx>
Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
---
ChangeLog v1->v2:
- Collect Rob's ACK.
---
.../devicetree/bindings/regulator/fixed-regulator.txt | 13 +++++++++++--
.../devicetree/bindings/regulator/gpio-regulator.txt | 4 ++++
2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
index 0c2a6c8a1536..a7a1cd0dfa6e 100644
--- a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
@@ -8,10 +8,19 @@ Optional properties:
- gpio: gpio to use for enable control
- startup-delay-us: startup time in microseconds
- enable-active-high: Polarity of GPIO is Active high
-If this property is missing, the default assumed is Active low.
+ If this property is missing, the default assumed is Active low.
+ If the phandle flags to the GPIO handle also flag the line as active
+ low or high, that will be ignored for fixed regulators and the
+ presence or absence of this flag solely controls the inversion
+ semantics.
+-vin-supply: Input supply name.
+
+Deprecated properties:
- gpio-open-drain: GPIO is open drain type.
If this property is missing then default assumption is false.
--vin-supply: Input supply name.
+ Do not use this property in new device trees: instead use the
+ phandle flag to indicate to the GPIO provider that the line
+ should be handled as open drain.

Any property defined as part of the core regulator
binding, defined in regulator.txt, can also be used.
diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
index 1f496159e2bb..8fef3e5358a2 100644
--- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
@@ -14,6 +14,10 @@ Optional properties:
defualt is LOW if nothing is specified.
- startup-delay-us : Startup time in microseconds.
- enable-active-high : Polarity of GPIO is active high (default is low).
+ If the phandle flags to the GPIO handle also flag the line as
+ active low or high, that will be ignored for fixed regulators
+ and the presence or absence of this flag solely controls the
+ inversion semantics.
- regulator-type : Specifies what is being regulated, must be either
"voltage" or "current", defaults to voltage.

--
2.14.3