2022-05-16 19:23:09

by Robert Marko

[permalink] [raw]
Subject: [PATCH 1/6] dt-bindings: regulator: qcom,spmi-regulator: Convert to dtschema

Convert the bindings of Qualcomm SPMI regulators to DT schema.

Signed-off-by: Robert Marko <[email protected]>
---
I am aware that syscon alone is not really acceptable, its converted
directly from the old text bindings.

There is also the issue of some MSM8994, MSM8996 and APQ8096 devices using
'#address-cells', '#size-cells', some even defining reg property for
regulators.

Any advice on how to solve these issues is appreciated.
---
.../regulator/qcom,spmi-regulator.yaml | 176 ++++++++++++++++++
1 file changed, 176 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml

diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
new file mode 100644
index 000000000000..f7da310f1845
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
@@ -0,0 +1,176 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/qcom,spmi-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SPMI Regulators
+
+maintainers:
+ - Robert Marko <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - qcom,pm660-regulators
+ - qcom,pm660l-regulators
+ - qcom,pm8004-regulators
+ - qcom,pm8005-regulators
+ - qcom,pm8226-regulators
+ - qcom,pm8841-regulators
+ - qcom,pm8916-regulators
+ - qcom,pm8941-regulators
+ - qcom,pm8950-regulators
+ - qcom,pm8994-regulators
+ - qcom,pmi8994-regulators
+ - qcom,pms405-regulators
+
+ qcom,saw-reg:
+ description: Reference to syscon node defining the SAW registers
+ $ref: "/schemas/types.yaml#/definitions/phandle"
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,pm8941-regulators
+ then:
+ properties:
+ interrupts:
+ items:
+ - description: Over-current protection interrupt for 5V S1
+ - description: Over-current protection interrupt for 5V S2
+ interrupt-names:
+ items:
+ - const: ocp-5vs1
+ - const: ocp-5vs2
+
+patternProperties:
+ ".*-supply$":
+ description: Input supply phandle(s) for this node
+ $ref: "/schemas/types.yaml#/definitions/phandle"
+
+ "^((s|l|lvs|5vs)[0-9]*)$":
+ description: List of regulators and its properties
+ $ref: regulator.yaml#
+
+ properties:
+ qcom,ocp-max-retries:
+ description:
+ Maximum number of times to try toggling a voltage switch off and
+ back on as a result of consecutive over current events
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+
+ qcom,ocp-retry-delay:
+ description:
+ Time to delay in milliseconds between each voltage switch toggle
+ after an over current event takes place
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+
+ qcom,pin-ctrl-enable:
+ description:
+ Bit mask specifying which hardware pins should be used to enable the
+ regulator, if any.
+ Supported bits are
+ 0 = ignore all hardware enable signals
+ BIT(0) = follow HW0_EN signal
+ BIT(1) = follow HW1_EN signal
+ BIT(2) = follow HW2_EN signal
+ BIT(3) = follow HW3_EN signal
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ minimum: 0
+ maximum: 15
+
+ qcom,pin-ctrl-hpm:
+ description:
+ Bit mask specifying which hardware pins should be used to force the
+ regulator into high power mode, if any.
+ Supported bits are
+ 0 = ignore all hardware enable signals
+ BIT(0) = follow HW0_EN signal
+ BIT(1) = follow HW1_EN signal
+ BIT(2) = follow HW2_EN signal
+ BIT(3) = follow HW3_EN signal
+ BIT(4) = follow PMIC awake state
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ minimum: 0
+ maximum: 31
+
+ qcom,vs-soft-start-strength:
+ description:
+ This property sets the soft start strength for voltage switch type
+ regulators.
+ Supported values are
+ 0 = 0.05 uA
+ 1 = 0.25 uA
+ 2 = 0.55 uA
+ 3 = 0.75 uA
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ minimum: 0
+ maximum: 3
+
+ qcom,saw-slave:
+ description: SAW controlled gang slave. Will not be configured.
+ type: boolean
+
+ qcom,saw-leader:
+ description:
+ SAW controlled gang leader. Will be configured as SAW regulator.
+ type: boolean
+
+ unevaluatedProperties: false
+
+unevaluatedProperties: false
+
+required:
+ - compatible
+
+examples:
+ - |
+ regulators {
+ compatible = "qcom,pm8941-regulators";
+ vdd_l1_l3-supply = <&s1>;
+
+ s1: s1 {
+ regulator-min-microvolt = <1300000>;
+ regulator-max-microvolt = <1400000>;
+ };
+
+ l1: l1 {
+ regulator-min-microvolt = <1225000>;
+ regulator-max-microvolt = <1300000>;
+ };
+ };
+
+ - |
+ saw3: syscon@9a10000 {
+ compatible = "syscon";
+ reg = <0x9a10000 0x1000>;
+ };
+
+ regulators {
+ compatible = "qcom,pm8994-regulators";
+ qcom,saw-reg = <&saw3>;
+
+ s8 {
+ qcom,saw-slave;
+ };
+
+ s9 {
+ qcom,saw-slave;
+ };
+
+ s10 {
+ qcom,saw-slave;
+ };
+
+ pm8994_s11_saw: s11 {
+ qcom,saw-leader;
+ regulator-always-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1140000>;
+ };
+ };
+...
--
2.36.1



2022-05-16 19:55:57

by Robert Marko

[permalink] [raw]
Subject: [PATCH 5/6] arm64: dts: ipq8074: add SPMI PMP8074 PMIC regulators

PMP8074 is used in IPQ8074 and provides S3 for cores,
S4 for UBI core and LDO11 for SDIO/eMMC.

So, lets add the nodes in preparation for DVFS later.

Signed-off-by: Robert Marko <[email protected]>
---
arch/arm64/boot/dts/qcom/ipq8074.dtsi | 34 +++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
index dbe23793e4d9..906468ee990e 100644
--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
@@ -5,6 +5,7 @@

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,gcc-ipq8074.h>
+#include <dt-bindings/spmi/spmi.h>

/ {
model = "Qualcomm Technologies, Inc. IPQ8074";
@@ -421,6 +422,39 @@ spmi_bus: spmi@200f000 {
interrupt-controller;
#interrupt-cells = <4>;
cell-index = <0>;
+
+ pmic@1 {
+ compatible ="qcom,spmi-pmic";
+ reg = <0x1 SPMI_USID>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ regulators {
+ compatible = "qcom,pmp8074-regulators";
+
+ s3: s3 {
+ regulator-name = "vdd_s3";
+ regulator-min-microvolt = <592000>;
+ regulator-max-microvolt = <1064000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ s4: s4 {
+ regulator-name = "vdd_s4";
+ regulator-min-microvolt = <712000>;
+ regulator-max-microvolt = <992000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ l11: l11 {
+ regulator-name = "l11";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+ };
+ };
};

sdhc_1: sdhci@7824900 {
--
2.36.1


2022-05-17 03:30:09

by Robert Marko

[permalink] [raw]
Subject: [PATCH 3/6] dt-bindings: regulator: qcom,spmi-regulator: add PMP8074 PMIC

Document the PMP8074 PMIC compatible.

Signed-off-by: Robert Marko <[email protected]>
---
.../devicetree/bindings/regulator/qcom,spmi-regulator.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
index f7da310f1845..960e61661bc8 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
@@ -23,6 +23,7 @@ properties:
- qcom,pm8950-regulators
- qcom,pm8994-regulators
- qcom,pmi8994-regulators
+ - qcom,pmp8074-regulators
- qcom,pms405-regulators

qcom,saw-reg:
--
2.36.1


2022-05-17 13:57:32

by Robert Marko

[permalink] [raw]
Subject: Re: [PATCH 1/6] dt-bindings: regulator: qcom,spmi-regulator: Convert to dtschema

On Tue, 17 May 2022 at 09:26, Krzysztof Kozlowski
<[email protected]> wrote:
>
> On 15/05/2022 22:31, Robert Marko wrote:
> > Convert the bindings of Qualcomm SPMI regulators to DT schema.
> >
> > Signed-off-by: Robert Marko <[email protected]>
> > ---
> > I am aware that syscon alone is not really acceptable, its converted
> > directly from the old text bindings.
> >
> > There is also the issue of some MSM8994, MSM8996 and APQ8096 devices using
> > '#address-cells', '#size-cells', some even defining reg property for
> > regulators.
> >
> > Any advice on how to solve these issues is appreciated.
> > ---
> > .../regulator/qcom,spmi-regulator.yaml | 176 ++++++++++++++++++
>
> You miss here the actual conversion... where is the removal of old file?

Hi,

Oh yeah, sorry for forgetting this.
Will fixup in v2.

>
> > 1 file changed, 176 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
> > new file mode 100644
> > index 000000000000..f7da310f1845
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
> > @@ -0,0 +1,176 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/regulator/qcom,spmi-regulator.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Qualcomm SPMI Regulators
> > +
> > +maintainers:
> > + - Robert Marko <[email protected]>
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - qcom,pm660-regulators
> > + - qcom,pm660l-regulators
> > + - qcom,pm8004-regulators
> > + - qcom,pm8005-regulators
> > + - qcom,pm8226-regulators
> > + - qcom,pm8841-regulators
> > + - qcom,pm8916-regulators
> > + - qcom,pm8941-regulators
> > + - qcom,pm8950-regulators
> > + - qcom,pm8994-regulators
> > + - qcom,pmi8994-regulators
> > + - qcom,pms405-regulators
> > +
> > + qcom,saw-reg:
> > + description: Reference to syscon node defining the SAW registers
> > + $ref: "/schemas/types.yaml#/definitions/phandle"
> > +
> > +allOf:
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - qcom,pm8941-regulators
> > + then:
> > + properties:
> > + interrupts:
> > + items:
> > + - description: Over-current protection interrupt for 5V S1
> > + - description: Over-current protection interrupt for 5V S2
> > + interrupt-names:
> > + items:
> > + - const: ocp-5vs1
> > + - const: ocp-5vs2
> > +
> > +patternProperties:
>
> This goes just after "properties:"

Will fixup in v2.

Regards,
Robert
>
> > + ".*-supply$":
> > + description: Input supply phandle(s) for this node
> > + $ref: "/schemas/types.yaml#/definitions/phandle"
> > +
>
> Best regards,
> Krzysztof

2022-05-18 04:46:24

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/6] dt-bindings: regulator: qcom,spmi-regulator: Convert to dtschema

On 15/05/2022 22:31, Robert Marko wrote:
> Convert the bindings of Qualcomm SPMI regulators to DT schema.
>
> Signed-off-by: Robert Marko <[email protected]>
> ---
> I am aware that syscon alone is not really acceptable, its converted
> directly from the old text bindings.
>
> There is also the issue of some MSM8994, MSM8996 and APQ8096 devices using
> '#address-cells', '#size-cells', some even defining reg property for
> regulators.
>
> Any advice on how to solve these issues is appreciated.
> ---
> .../regulator/qcom,spmi-regulator.yaml | 176 ++++++++++++++++++

You miss here the actual conversion... where is the removal of old file?

> 1 file changed, 176 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
>
> diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
> new file mode 100644
> index 000000000000..f7da310f1845
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
> @@ -0,0 +1,176 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/qcom,spmi-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm SPMI Regulators
> +
> +maintainers:
> + - Robert Marko <[email protected]>
> +
> +properties:
> + compatible:
> + enum:
> + - qcom,pm660-regulators
> + - qcom,pm660l-regulators
> + - qcom,pm8004-regulators
> + - qcom,pm8005-regulators
> + - qcom,pm8226-regulators
> + - qcom,pm8841-regulators
> + - qcom,pm8916-regulators
> + - qcom,pm8941-regulators
> + - qcom,pm8950-regulators
> + - qcom,pm8994-regulators
> + - qcom,pmi8994-regulators
> + - qcom,pms405-regulators
> +
> + qcom,saw-reg:
> + description: Reference to syscon node defining the SAW registers
> + $ref: "/schemas/types.yaml#/definitions/phandle"
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - qcom,pm8941-regulators
> + then:
> + properties:
> + interrupts:
> + items:
> + - description: Over-current protection interrupt for 5V S1
> + - description: Over-current protection interrupt for 5V S2
> + interrupt-names:
> + items:
> + - const: ocp-5vs1
> + - const: ocp-5vs2
> +
> +patternProperties:

This goes just after "properties:"

> + ".*-supply$":
> + description: Input supply phandle(s) for this node
> + $ref: "/schemas/types.yaml#/definitions/phandle"
> +

Best regards,
Krzysztof