[PATCH 2/2] dt-bindings: regulator: Document the ltc7871 regulator

Celine Joy A. Capua posted 2 patches 12 months ago
[PATCH 2/2] dt-bindings: regulator: Document the ltc7871 regulator
Posted by Celine Joy A. Capua 12 months ago
The LTC7871 is a bidirectional buck or boost
switching regulator controller that operates in
either buck or boost mode on demand. Add
corresponding DT bindings.

Signed-off-by: Celine Joy A. Capua <celinejoy.capua@analog.com>
---
 .../bindings/regulator/adi,ltc7871-regulator.yaml  | 98 ++++++++++++++++++++++
 1 file changed, 98 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/adi,ltc7871-regulator.yaml b/Documentation/devicetree/bindings/regulator/adi,ltc7871-regulator.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..b1ae8b16e19c11b3faf2d4a41a4ae4f615ca3c1e
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/adi,ltc7871-regulator.yaml
@@ -0,0 +1,98 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright (c) 2025 Analog Devices, Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/adi,ltc7871-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices LTC7871 Buck-Boost Voltage Regulator
+maintainers:
+  - Celine Joy Capua <celinejoy.capua@analog.com>
+
+description:
+  The LTC7871 is a high performance bidirectional buck or boost switching
+  regulator controller that operates in either buck or boost mode on demand.
+  It regulates in buck mode from VHIGH-to-VLOW and boost mode from
+  VLOW-to-VHIGH depending on a control signal, making it ideal for 48V/12V
+  automotive dual battery systems
+properties:
+  compatible:
+    enum:
+      - adi,ltc7871
+      - adi,ltc7872
+
+  reg:
+    maxItems: 1
+
+  adi,enable-chip-ctrl-wp:
+    description: If present, this indicates the use of regulator's
+      internal write protection.
+    type: boolean
+
+  adi,ra-external-ohms:
+    description: External Resistor used to compute the value of
+      programmable VLOW in buck mode.
+    default: 10000
+
+  adi,rb-external-ohms:
+    description: External Resistor used to compute the value of
+      programmable VLOW in buck mode.
+    default: 107000
+
+  adi,rc-external-ohms:
+    description: External Resistor used to compute the value of
+      programmable VHIGH in boost mode.
+    default: 12700
+
+  adi,rd-external-ohms:
+    description: External Resistor used to compute the value of
+      programmable VHIGH in boost mode.
+    default: 499000
+
+  adi,idac-setcur-microamp:
+    description: Adjusts the IDAC_SETCUR to program SETCUR
+      pin's sourcing current.
+    minimum: -63
+    maximum: 64
+    default: 0
+
+  adi,freq-spread-percentage:
+    description: Sets the range of modulation with respect to the
+      switching frequency.
+    enum: [+-12%, +-15%, +-10%, +-8%]
+    default: +-12%
+
+  adi,switching-freq-divider:
+    description: The factor at which the switching frequency is
+      divided to get the modulation frequency.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [512, 1024, 2048, 4096, 256, 128, 64]
+    default: 512
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: regulator.yaml#
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      regulator@0 {
+        compatible = "adi,ltc7871";
+        reg = <0>;
+        adi,ra-external-ohm = <10000>;
+        adi,rb-external-ohm = <107000>;
+        adi,rc-external-ohm = <12700>;
+        adi,rd-external-ohm = <499000>;
+        adi,idac-setcur-microamp = <0>;
+        adi,freq-spread-percentage = "+-12%";
+        adi,switching-freq-divider = <512>;
+      };
+    };

-- 
2.34.1
Re: [PATCH 2/2] dt-bindings: regulator: Document the ltc7871 regulator
Posted by Krzysztof Kozlowski 12 months ago
On Mon, Feb 10, 2025 at 10:30:53AM +0800, Celine Joy A. Capua wrote:
> The LTC7871 is a bidirectional buck or boost
> switching regulator controller that operates in
> either buck or boost mode on demand. Add
> corresponding DT bindings.

This fails tests, so limited review follows.


Please wrap commit message according to Linux coding style / submission
process (neither too early nor over the limit):
https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597

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. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

> 
> Signed-off-by: Celine Joy A. Capua <celinejoy.capua@analog.com>
> ---
>  .../bindings/regulator/adi,ltc7871-regulator.yaml  | 98 ++++++++++++++++++++++
>  1 file changed, 98 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/adi,ltc7871-regulator.yaml b/Documentation/devicetree/bindings/regulator/adi,ltc7871-regulator.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..b1ae8b16e19c11b3faf2d4a41a4ae4f615ca3c1e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/adi,ltc7871-regulator.yaml
> @@ -0,0 +1,98 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright (c) 2025 Analog Devices, Inc.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/adi,ltc7871-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices LTC7871 Buck-Boost Voltage Regulator

Blank line

> +maintainers:
> +  - Celine Joy Capua <celinejoy.capua@analog.com>
> +
> +description:
> +  The LTC7871 is a high performance bidirectional buck or boost switching
> +  regulator controller that operates in either buck or boost mode on demand.
> +  It regulates in buck mode from VHIGH-to-VLOW and boost mode from
> +  VLOW-to-VHIGH depending on a control signal, making it ideal for 48V/12V
> +  automotive dual battery systems

Blank line. Open existing bindings and see how it is done there.

> +properties:
> +  compatible:
> +    enum:
> +      - adi,ltc7871
> +      - adi,ltc7872

Are devices compatible?

> +
> +  reg:
> +    maxItems: 1
> +
> +  adi,enable-chip-ctrl-wp:
> +    description: If present, this indicates the use of regulator's
> +      internal write protection.
> +    type: boolean
> +
> +  adi,ra-external-ohms:
> +    description: External Resistor used to compute the value of
> +      programmable VLOW in buck mode.
> +    default: 10000
> +
> +  adi,rb-external-ohms:
> +    description: External Resistor used to compute the value of
> +      programmable VLOW in buck mode.
> +    default: 107000
> +
> +  adi,rc-external-ohms:
> +    description: External Resistor used to compute the value of
> +      programmable VHIGH in boost mode.
> +    default: 12700
> +
> +  adi,rd-external-ohms:
> +    description: External Resistor used to compute the value of
> +      programmable VHIGH in boost mode.
> +    default: 499000
> +
> +  adi,idac-setcur-microamp:
> +    description: Adjusts the IDAC_SETCUR to program SETCUR
> +      pin's sourcing current.
> +    minimum: -63
> +    maximum: 64
> +    default: 0
> +
> +  adi,freq-spread-percentage:
> +    description: Sets the range of modulation with respect to the
> +      switching frequency.
> +    enum: [+-12%, +-15%, +-10%, +-8%]

That's something new. Where is such property suffix defined?

> +    default: +-12%
> +
> +  adi,switching-freq-divider:
> +    description: The factor at which the switching frequency is
> +      divided to get the modulation frequency.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [512, 1024, 2048, 4096, 256, 128, 64]

Keep this ordered by increasing value.

> +    default: 512
> +
> +required:
> +  - compatible
> +  - reg

Best regards,
Krzysztof
Re: [PATCH 2/2] dt-bindings: regulator: Document the ltc7871 regulator
Posted by Rob Herring (Arm) 12 months ago
On Mon, 10 Feb 2025 10:30:53 +0800, Celine Joy A. Capua wrote:
> The LTC7871 is a bidirectional buck or boost
> switching regulator controller that operates in
> either buck or boost mode on demand. Add
> corresponding DT bindings.
> 
> Signed-off-by: Celine Joy A. Capua <celinejoy.capua@analog.com>
> ---
>  .../bindings/regulator/adi,ltc7871-regulator.yaml  | 98 ++++++++++++++++++++++
>  1 file changed, 98 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/adi,ltc7871-regulator.example.dtb: regulator@0: Unevaluated properties are not allowed ('adi,ra-external-ohm', 'adi,rb-external-ohm', 'adi,rc-external-ohm', 'adi,rd-external-ohm' were unexpected)
	from schema $id: http://devicetree.org/schemas/regulator/adi,ltc7871-regulator.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250210-staging-ltc7871-v1-2-c593ad86aab2@analog.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.