[PATCH 2/3] dt-bindings: regulator: Add mps,mpq2286 power-management IC

Saravanan Sekar posted 3 patches 2 years, 3 months ago
There is a newer version of this series
[PATCH 2/3] dt-bindings: regulator: Add mps,mpq2286 power-management IC
Posted by Saravanan Sekar 2 years, 3 months ago
Document mpq2286 power-management IC

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
---
 .../bindings/regulator/mps,mpq2286.yaml       | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml

diff --git a/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
new file mode 100644
index 000000000000..d00d887870a9
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mps,mpq2286.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Monolithic Power System MPQ2286 PMIC
+
+maintainers:
+  - Saravanan Sekar <saravanan@linumiz.com>
+
+properties:
+  compatible:
+    enum:
+      - mps,mpq2286
+
+  reg:
+    maxItems: 1
+
+  regulators:
+    type: object
+
+    properties:
+      "buck0":
+        type: object
+        $ref: regulator.yaml#
+
+        unevaluatedProperties: false
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pmic@3 {
+            compatible = "mps,mpq2286";
+            reg = <0x3>;
+
+            regulators {
+                buck {
+                    regulator-name = "buck0";
+                    regulator-min-microvolt = <1600000>;
+                    regulator-max-microvolt = <1800000>;
+                    regulator-boot-on;
+                };
+            };
+        };
+    };
+...
-- 
2.34.1
Re: [PATCH 2/3] dt-bindings: regulator: Add mps,mpq2286 power-management IC
Posted by Krzysztof Kozlowski 2 years, 3 months ago
On 11/09/2023 05:41, Saravanan Sekar wrote:
> Document mpq2286 power-management IC
> 
> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>

Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. It's: regulator: dt-bindings:

> ---
>  .../bindings/regulator/mps,mpq2286.yaml       | 59 +++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
> 
> diff --git a/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
> new file mode 100644
> index 000000000000..d00d887870a9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
> @@ -0,0 +1,59 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mps,mpq2286.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Monolithic Power System MPQ2286 PMIC
> +
> +maintainers:
> +  - Saravanan Sekar <saravanan@linumiz.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - mps,mpq2286
> +
> +  reg:
> +    maxItems: 1
> +
> +  regulators:
> +    type: object
> +
> +    properties:
> +      "buck0":

You did not test it... Sigh. Anyway, there is no need for entire
regulators node for one regulator. Can the device do anything else than
being a regulator?

Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: regulator: Add mps,mpq2286 power-management IC
Posted by Saravanan Sekar 2 years, 3 months ago
On 11/09/23 11:56, Krzysztof Kozlowski wrote:
> On 11/09/2023 05:41, Saravanan Sekar wrote:
>> Document mpq2286 power-management IC
>>
>> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
> 
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching. It's: regulator: dt-bindings:

Thanks for your time to review. git log has mix of "regulator: 
dt-bindings" and "dt-bindings: regualtor". I had referred my own 
accepted driver regulator/mps,mpq7932.yaml

> 
>> ---
>>   .../bindings/regulator/mps,mpq2286.yaml       | 59 +++++++++++++++++++
>>   1 file changed, 59 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
>> new file mode 100644
>> index 000000000000..d00d887870a9
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
>> @@ -0,0 +1,59 @@
>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/regulator/mps,mpq2286.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Monolithic Power System MPQ2286 PMIC
>> +
>> +maintainers:
>> +  - Saravanan Sekar <saravanan@linumiz.com>
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - mps,mpq2286
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  regulators:
>> +    type: object
>> +
>> +    properties:
>> +      "buck0":
> 
> You did not test it... Sigh. Anyway, there is no need for entire
> regulators node for one regulator. Can the device do anything else than
> being a regulator?
> 

I tested it, but documentation is not updated with test findings (buck0).

Other chipset has multiple regulator so dts has regulators node to keep 
the driver common

Primarily device is a regulator with pmbus capability like fault status 
(OV,OC, VIN, VOUT, Power good status), temperature status.

> Best regards,
> Krzysztof
>
Thanks,
Saravanan
Re: [PATCH 2/3] dt-bindings: regulator: Add mps,mpq2286 power-management IC
Posted by Krzysztof Kozlowski 2 years, 3 months ago
On 11/09/2023 09:12, Saravanan Sekar wrote:
> On 11/09/23 11:56, Krzysztof Kozlowski wrote:
>> On 11/09/2023 05:41, Saravanan Sekar wrote:
>>> Document mpq2286 power-management IC
>>>
>>> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
>>
>> Please use subject prefixes matching the subsystem. You can get them for
>> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
>> your patch is touching. It's: regulator: dt-bindings:
> 
> Thanks for your time to review. git log has mix of "regulator: 
> dt-bindings" and "dt-bindings: regualtor".

Just take a look how many times each appear... they are just few cases
of the latter.


> I had referred my own 
> accepted driver regulator/mps,mpq7932.yaml
> 
>>
>>> ---
>>>   .../bindings/regulator/mps,mpq2286.yaml       | 59 +++++++++++++++++++
>>>   1 file changed, 59 insertions(+)
>>>   create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
>>> new file mode 100644
>>> index 000000000000..d00d887870a9
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
>>> @@ -0,0 +1,59 @@
>>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/regulator/mps,mpq2286.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Monolithic Power System MPQ2286 PMIC
>>> +
>>> +maintainers:
>>> +  - Saravanan Sekar <saravanan@linumiz.com>
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - mps,mpq2286
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  regulators:
>>> +    type: object
>>> +
>>> +    properties:
>>> +      "buck0":
>>
>> You did not test it... Sigh. Anyway, there is no need for entire
>> regulators node for one regulator. Can the device do anything else than
>> being a regulator?
>>
> 
> I tested it, but documentation is not updated with test findings (buck0).

I mean, testing bindings. You did not test this patch. Testing this
patch produces warnings, so this is considered a failed test.

> 
> Other chipset has multiple regulator so dts has regulators node to keep 
> the driver common
> 
> Primarily device is a regulator with pmbus capability like fault status 
> (OV,OC, VIN, VOUT, Power good status), temperature status.

OK, then regulators node seems fine. Anyway, drop quotes and test this
patch (which means: test the bindings).

Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: regulator: Add mps,mpq2286 power-management IC
Posted by Guenter Roeck 2 years, 3 months ago
On 9/10/23 20:41, Saravanan Sekar wrote:
> Document mpq2286 power-management IC
> 
> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>

I don't know how this kind of thing is typically handled in .yaml
files, but given that the chip is supposedly almost the same as MPQ7932
(except for the number of regulators), would it possibly make sense
to describe both in a single devicetree file ?

Guenter

> ---
>   .../bindings/regulator/mps,mpq2286.yaml       | 59 +++++++++++++++++++
>   1 file changed, 59 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
> 
> diff --git a/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
> new file mode 100644
> index 000000000000..d00d887870a9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
> @@ -0,0 +1,59 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mps,mpq2286.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Monolithic Power System MPQ2286 PMIC
> +
> +maintainers:
> +  - Saravanan Sekar <saravanan@linumiz.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - mps,mpq2286
> +
> +  reg:
> +    maxItems: 1
> +
> +  regulators:
> +    type: object
> +
> +    properties:
> +      "buck0":
> +        type: object
> +        $ref: regulator.yaml#
> +
> +        unevaluatedProperties: false
> +
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - regulators
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        pmic@3 {
> +            compatible = "mps,mpq2286";
> +            reg = <0x3>;
> +
> +            regulators {
> +                buck {
> +                    regulator-name = "buck0";
> +                    regulator-min-microvolt = <1600000>;
> +                    regulator-max-microvolt = <1800000>;
> +                    regulator-boot-on;
> +                };
> +            };
> +        };
> +    };
> +...
Re: [PATCH 2/3] dt-bindings: regulator: Add mps,mpq2286 power-management IC
Posted by Rob Herring 2 years, 3 months ago
On Mon, 11 Sep 2023 09:11:49 +0530, Saravanan Sekar wrote:
> Document mpq2286 power-management IC
> 
> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
> ---
>  .../bindings/regulator/mps,mpq2286.yaml       | 59 +++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq2286.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/mps,mpq2286.example.dtb: pmic@3: regulators: 'buck' does not match any of the regexes: 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/regulator/mps,mpq2286.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230911034150.181880-3-saravanan@linumiz.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.