[PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation

Jerome Brunet posted 3 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation
Posted by Jerome Brunet 2 months, 3 weeks ago
Add DT binding documentation for the Texas Instruments TPS25990 eFuse

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 .../bindings/hwmon/pmbus/ti,tps25990.yaml          | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
new file mode 100644
index 000000000000..e717942b3598
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/pmbus/ti,tps25990.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TPS25990 Stackable eFuse
+
+maintainers:
+  - Jerome Brunet <jbrunet@baylibre.com>
+
+description: |
+  The TI TPS25990 is an integrated, high-current circuit
+  protection and power management device with PMBUS interface
+
+properties:
+  compatible:
+    const: ti,tps25990
+
+  reg:
+    maxItems: 1
+
+  ti,rimon-milli-ohms:
+    description:
+      milli Ohms value of the resistance installed between the Imon pin
+      and the ground reference.
+
+  interrupts:
+    description: PMBUS SMB Alert Interrupt.
+    maxItems: 1
+
+  regulators:
+    type: object
+    description:
+      list of regulators provided by this controller.
+
+    properties:
+      vout:
+        $ref: /schemas/regulator/regulator.yaml#
+        type: object
+        unevaluatedProperties: false
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - ti,rimon-milli-ohms
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        hw-monitor@46 {
+            compatible = "ti,tps25990";
+            reg = <0x46>;
+
+            interrupt-parent = <&gpio>;
+            interrupts = <42 IRQ_TYPE_LEVEL_LOW>;
+            ti,rimon-milli-ohms = <1370000>;
+
+            regulators {
+                cpu0_vout: vout {
+                    regulator-name = "main_cpu0";
+                };
+            };
+        };
+    };

-- 
2.45.2
Re: [PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation
Posted by Krzysztof Kozlowski 2 months, 3 weeks ago
On Mon, Sep 09, 2024 at 05:39:03PM +0200, Jerome Brunet wrote:
> Add DT binding documentation for the Texas Instruments TPS25990 eFuse
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  .../bindings/hwmon/pmbus/ti,tps25990.yaml          | 73 ++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
>

A nit, subject: drop second/last, redundant "documentation". The
"dt-bindings" prefix is already stating that these are bindings/docs.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
> new file mode 100644
> index 000000000000..e717942b3598
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
> @@ -0,0 +1,73 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +

Drop blank line.

> +$id: http://devicetree.org/schemas/hwmon/pmbus/ti,tps25990.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments TPS25990 Stackable eFuse
> +
> +maintainers:
> +  - Jerome Brunet <jbrunet@baylibre.com>
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> +  The TI TPS25990 is an integrated, high-current circuit
> +  protection and power management device with PMBUS interface
> +
> +properties:
> +  compatible:
> +    const: ti,tps25990
> +
> +  reg:
> +    maxItems: 1
> +
> +  ti,rimon-milli-ohms:
> +    description:
> +      milli Ohms value of the resistance installed between the Imon pin
> +      and the ground reference.

Ohms is not enough? We don't have mOhm in property units.
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml

> +
> +  interrupts:
> +    description: PMBUS SMB Alert Interrupt.
> +    maxItems: 1
> +
> +  regulators:
> +    type: object
> +    description:
> +      list of regulators provided by this controller.

You have just one regulator, so drop "regulators" node and use directly
vout here.

> +
> +    properties:
> +      vout:
> +        $ref: /schemas/regulator/regulator.yaml#
> +        type: object
> +        unevaluatedProperties: false
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - ti,rimon-milli-ohms
> +
> +additionalProperties: false

Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation
Posted by Jerome Brunet 2 months, 3 weeks ago
On Tue 10 Sep 2024 at 09:48, Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On Mon, Sep 09, 2024 at 05:39:03PM +0200, Jerome Brunet wrote:
>> Add DT binding documentation for the Texas Instruments TPS25990 eFuse
>> 
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>  .../bindings/hwmon/pmbus/ti,tps25990.yaml          | 73 ++++++++++++++++++++++
>>  1 file changed, 73 insertions(+)
>>
>
> A nit, subject: drop second/last, redundant "documentation". The
> "dt-bindings" prefix is already stating that these are bindings/docs.
> See also:
> https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>
>> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
>> new file mode 100644
>> index 000000000000..e717942b3598
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
>> @@ -0,0 +1,73 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +
>
> Drop blank line.
>
>> +$id: http://devicetree.org/schemas/hwmon/pmbus/ti,tps25990.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Texas Instruments TPS25990 Stackable eFuse
>> +
>> +maintainers:
>> +  - Jerome Brunet <jbrunet@baylibre.com>
>> +
>> +description: |
>
> Do not need '|' unless you need to preserve formatting.
>
>> +  The TI TPS25990 is an integrated, high-current circuit
>> +  protection and power management device with PMBUS interface
>> +
>> +properties:
>> +  compatible:
>> +    const: ti,tps25990
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  ti,rimon-milli-ohms:
>> +    description:
>> +      milli Ohms value of the resistance installed between the Imon pin
>> +      and the ground reference.
>
> Ohms is not enough? We don't have mOhm in property units.
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
>

Same discussion as we've had on the driver change.
At the moment Ohms is enough for the cases I've seen.

Will it be, not sure.
Using mOhms is' way to avoid "S**t, R is 80.2 Ohms, I
need another digit to not loose precision " kind of situation and
introduce a second property just for that.

No idea if Rimon will get that low. Probably not.

I'll switch to Ohms.

>> +
>> +  interrupts:
>> +    description: PMBUS SMB Alert Interrupt.
>> +    maxItems: 1
>> +
>> +  regulators:
>> +    type: object
>> +    description:
>> +      list of regulators provided by this controller.
>
> You have just one regulator, so drop "regulators" node and use directly
> vout here.

Just took the example the other pmbus device and did the same for
consistency.

In that case, there other (possible) regulator called gpdac1 and gpdac2.
I haven't even tried to implement the support for those.

Since it would not break old DTs to add that later, I thought it would be OK
to add them later. Should I add them now ?

>
>> +
>> +    properties:
>> +      vout:
>> +        $ref: /schemas/regulator/regulator.yaml#
>> +        type: object
>> +        unevaluatedProperties: false
>> +    additionalProperties: false
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - ti,rimon-milli-ohms
>> +
>> +additionalProperties: false
>
> Best regards,
> Krzysztof

-- 
Jerome
Re: [PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation
Posted by Krzysztof Kozlowski 2 months, 2 weeks ago
On 10/09/2024 11:31, Jerome Brunet wrote:
>>> +
>>> +  interrupts:
>>> +    description: PMBUS SMB Alert Interrupt.
>>> +    maxItems: 1
>>> +
>>> +  regulators:
>>> +    type: object
>>> +    description:
>>> +      list of regulators provided by this controller.
>>
>> You have just one regulator, so drop "regulators" node and use directly
>> vout here.
> 
> Just took the example the other pmbus device and did the same for
> consistency.
> 
> In that case, there other (possible) regulator called gpdac1 and gpdac2.
> I haven't even tried to implement the support for those.

Your binding should be complete. Does not matter whether you implemented
it in drivers or not.

> 
> Since it would not break old DTs to add that later, I thought it would be OK
> to add them later. Should I add them now ?

This should be added now.



Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation
Posted by Rob Herring 2 months, 2 weeks ago
gOn Tue, Sep 10, 2024 at 11:31:18AM +0200, Jerome Brunet wrote:
> On Tue 10 Sep 2024 at 09:48, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
> > On Mon, Sep 09, 2024 at 05:39:03PM +0200, Jerome Brunet wrote:
> >> Add DT binding documentation for the Texas Instruments TPS25990 eFuse
> >> 
> >> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> >> ---
> >>  .../bindings/hwmon/pmbus/ti,tps25990.yaml          | 73 ++++++++++++++++++++++
> >>  1 file changed, 73 insertions(+)
> >>
> >
> > A nit, subject: drop second/last, redundant "documentation". The
> > "dt-bindings" prefix is already stating that these are bindings/docs.
> > See also:
> > https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> >
> >> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
> >> new file mode 100644
> >> index 000000000000..e717942b3598
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
> >> @@ -0,0 +1,73 @@
> >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >> +%YAML 1.2
> >> +---
> >> +
> >
> > Drop blank line.
> >
> >> +$id: http://devicetree.org/schemas/hwmon/pmbus/ti,tps25990.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: Texas Instruments TPS25990 Stackable eFuse
> >> +
> >> +maintainers:
> >> +  - Jerome Brunet <jbrunet@baylibre.com>
> >> +
> >> +description: |
> >
> > Do not need '|' unless you need to preserve formatting.
> >
> >> +  The TI TPS25990 is an integrated, high-current circuit
> >> +  protection and power management device with PMBUS interface

And wrap at 80.

> >> +
> >> +properties:
> >> +  compatible:
> >> +    const: ti,tps25990
> >> +
> >> +  reg:
> >> +    maxItems: 1
> >> +
> >> +  ti,rimon-milli-ohms:
> >> +    description:
> >> +      milli Ohms value of the resistance installed between the Imon pin
> >> +      and the ground reference.
> >
> > Ohms is not enough? We don't have mOhm in property units.
> > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
> >
> 
> Same discussion as we've had on the driver change.
> At the moment Ohms is enough for the cases I've seen.
> 
> Will it be, not sure.
> Using mOhms is' way to avoid "S**t, R is 80.2 Ohms, I
> need another digit to not loose precision " kind of situation and
> introduce a second property just for that.
> 
> No idea if Rimon will get that low. Probably not.
> 
> I'll switch to Ohms.

You can can use "-micro-ohms" too. The reason we don't have every 
possible unit is so we have everyone picking their own.

Rob
Re: [PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation
Posted by Jerome Brunet 2 months, 2 weeks ago
On Wed 11 Sep 2024 at 09:45, Rob Herring <robh@kernel.org> wrote:

> gOn Tue, Sep 10, 2024 at 11:31:18AM +0200, Jerome Brunet wrote:
>> On Tue 10 Sep 2024 at 09:48, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>> 
>> > On Mon, Sep 09, 2024 at 05:39:03PM +0200, Jerome Brunet wrote:
>> >> Add DT binding documentation for the Texas Instruments TPS25990 eFuse
>> >> 
>> >> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> >> ---
>> >>  .../bindings/hwmon/pmbus/ti,tps25990.yaml          | 73 ++++++++++++++++++++++
>> >>  1 file changed, 73 insertions(+)
>> >>
>> >
>> > A nit, subject: drop second/last, redundant "documentation". The
>> > "dt-bindings" prefix is already stating that these are bindings/docs.
>> > See also:
>> > https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>> >
>> >> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
>> >> new file mode 100644
>> >> index 000000000000..e717942b3598
>> >> --- /dev/null
>> >> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
>> >> @@ -0,0 +1,73 @@
>> >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> >> +%YAML 1.2
>> >> +---
>> >> +
>> >
>> > Drop blank line.
>> >
>> >> +$id: http://devicetree.org/schemas/hwmon/pmbus/ti,tps25990.yaml#
>> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> >> +
>> >> +title: Texas Instruments TPS25990 Stackable eFuse
>> >> +
>> >> +maintainers:
>> >> +  - Jerome Brunet <jbrunet@baylibre.com>
>> >> +
>> >> +description: |
>> >
>> > Do not need '|' unless you need to preserve formatting.
>> >
>> >> +  The TI TPS25990 is an integrated, high-current circuit
>> >> +  protection and power management device with PMBUS interface
>
> And wrap at 80.
>
>> >> +
>> >> +properties:
>> >> +  compatible:
>> >> +    const: ti,tps25990
>> >> +
>> >> +  reg:
>> >> +    maxItems: 1
>> >> +
>> >> +  ti,rimon-milli-ohms:
>> >> +    description:
>> >> +      milli Ohms value of the resistance installed between the Imon pin
>> >> +      and the ground reference.
>> >
>> > Ohms is not enough? We don't have mOhm in property units.
>> > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
>> >
>> 
>> Same discussion as we've had on the driver change.
>> At the moment Ohms is enough for the cases I've seen.
>> 
>> Will it be, not sure.
>> Using mOhms is' way to avoid "S**t, R is 80.2 Ohms, I
>> need another digit to not loose precision " kind of situation and
>> introduce a second property just for that.
>> 
>> No idea if Rimon will get that low. Probably not.
>> 
>> I'll switch to Ohms.
>
> You can can use "-micro-ohms" too. The reason we don't have every 
> possible unit is so we have everyone picking their own.

Noted. after discussing with Guenter, I'll use micro-ohms in the next
version, not ohms

>
> Rob

-- 
Jerome