diff mbox series

[v6,4/5] dt-bindings: arm: add support for SCMI Regulators

Message ID 20201119191051.46363-5-cristian.marussi@arm.com (mailing list archive)
State New, archived
Headers show
Series Add support for SCMIv3.0 Voltage Domain Protocol and SCMI-Regulator | expand

Commit Message

Cristian Marussi Nov. 19, 2020, 7:10 p.m. UTC
Add devicetree bindings to support regulators based on SCMI Voltage
Domain Protocol.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
v3 --> v4
- added list of supported Regulator bindings.
v2 --> v3
- avoid awkard examples based on _cpu/_gpu regulators
v1 --> v2
- removed any reference to negative voltages
---
 .../devicetree/bindings/arm/arm,scmi.txt      | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

Comments

Mark Brown Nov. 23, 2020, 5:30 p.m. UTC | #1
On Thu, Nov 19, 2020 at 07:10:50PM +0000, Cristian Marussi wrote:

> +This binding uses the common regulator binding[6] but, due to SCMI abstractions,
> +supports only a subset of its properties as specified below amongst Optional
> +properties.

> +Required properties:
> + - reg : shall identify an existent SCMI Voltage Domain.

> +Optional properties:
> + - regulator-name
> + - regulator-min-microvolt / regulator-max-microvolt
> + - regulator-always-on / regulator-boot-on
> + - regulator-max-step-microvolt
> + - regulator-coupled-with / regulator-coupled-max-spread

Please send a followup patch removing this stuff about only specific
properties being supported, that's just asking for bitrot and is equally
true for most regulator drivers - people shouldn't have to do do an
audit of every single regulator driver to add a generic feature.
Cristian Marussi Nov. 23, 2020, 6:52 p.m. UTC | #2
On Mon, Nov 23, 2020 at 05:30:08PM +0000, Mark Brown wrote:
> On Thu, Nov 19, 2020 at 07:10:50PM +0000, Cristian Marussi wrote:
> 
> > +This binding uses the common regulator binding[6] but, due to SCMI abstractions,
> > +supports only a subset of its properties as specified below amongst Optional
> > +properties.
> 
> > +Required properties:
> > + - reg : shall identify an existent SCMI Voltage Domain.
> 
> > +Optional properties:
> > + - regulator-name
> > + - regulator-min-microvolt / regulator-max-microvolt
> > + - regulator-always-on / regulator-boot-on
> > + - regulator-max-step-microvolt
> > + - regulator-coupled-with / regulator-coupled-max-spread
> 
> Please send a followup patch removing this stuff about only specific
> properties being supported, that's just asking for bitrot and is equally
> true for most regulator drivers - people shouldn't have to do do an
> audit of every single regulator driver to add a generic feature.

Ok I'll remove any reference to partial SCMI regulator support.

Thanks

Cristian
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt b/Documentation/devicetree/bindings/arm/arm,scmi.txt
index 55deb68230eb..6e011ca97079 100644
--- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
+++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
@@ -62,6 +62,29 @@  Required properties:
  - #power-domain-cells : Should be 1. Contains the device or the power
 			 domain ID value used by SCMI commands.
 
+Regulator bindings for the SCMI Regulator based on SCMI Message Protocol
+------------------------------------------------------------
+An SCMI Regulator is permanently bound to a well defined SCMI Voltage Domain,
+and should be always positioned as a root regulator.
+It does not support any current operation.
+
+SCMI Regulators are grouped under a 'regulators' node which in turn is a child
+of the SCMI Voltage protocol node inside the desired SCMI instance node.
+
+This binding uses the common regulator binding[6] but, due to SCMI abstractions,
+supports only a subset of its properties as specified below amongst Optional
+properties.
+
+Required properties:
+ - reg : shall identify an existent SCMI Voltage Domain.
+
+Optional properties:
+ - regulator-name
+ - regulator-min-microvolt / regulator-max-microvolt
+ - regulator-always-on / regulator-boot-on
+ - regulator-max-step-microvolt
+ - regulator-coupled-with / regulator-coupled-max-spread
+
 Sensor bindings for the sensors based on SCMI Message Protocol
 --------------------------------------------------------------
 SCMI provides an API to access the various sensors on the SoC.
@@ -105,6 +128,7 @@  Required sub-node properties:
 [3] Documentation/devicetree/bindings/thermal/thermal*.yaml
 [4] Documentation/devicetree/bindings/sram/sram.yaml
 [5] Documentation/devicetree/bindings/reset/reset.txt
+[6] Documentation/devicetree/bindings/regulator/regulator.yaml
 
 Example:
 
@@ -169,6 +193,25 @@  firmware {
 			reg = <0x16>;
 			#reset-cells = <1>;
 		};
+
+		scmi_voltage: protocol@17 {
+			reg = <0x17>;
+
+			regulators {
+				regulator_devX: regulator@0 {
+					reg = <0x0>;
+					regulator-max-microvolt = <3300000>;
+				};
+
+				regulator_devY: regulator@9 {
+					reg = <0x9>;
+					regulator-min-microvolt = <500000>;
+					regulator-max-microvolt = <4200000>;
+				};
+
+				...
+			};
+		};
 	};
 };