diff mbox series

[7/9] dt-bindings: regulator: add binding for ncv6336 regulator

Message ID 20241218-ncv6336-v1-7-b8d973747f7a@gmail.com
State New
Headers show
Series Regulator driver with I2C/Regmap Rust abstractions | expand

Commit Message

Fabien Parent Dec. 18, 2024, 11:36 p.m. UTC
From: Fabien Parent <fabien.parent@linaro.org>

Add binding documentation for the Onsemi NCV6336 regulator.

Signed-off-by: Fabien Parent <fabien.parent@linaro.org>
---
 .../bindings/regulator/onnn,ncv6336.yaml           | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Comments

Krzysztof Kozlowski Dec. 19, 2024, 9:28 a.m. UTC | #1
On Wed, Dec 18, 2024 at 03:36:37PM -0800, Fabien Parent wrote:
> From: Fabien Parent <fabien.parent@linaro.org>
> 
> Add binding documentation for the Onsemi NCV6336 regulator.
> 
> Signed-off-by: Fabien Parent <fabien.parent@linaro.org>
> ---
>  .../bindings/regulator/onnn,ncv6336.yaml           | 54 ++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
> 

subject: regulator first, then dt-bindings.

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


> diff --git a/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml b/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..c69d126cab33668febe18e77bb34bd4bef52c993
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/onnn,ncv6336.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Onsemi NCV6336 Buck converter
> +
> +maintainers:
> +  - Fabien Parent <fabien.parent@linaro.org>
> +
> +description: |

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

> +  The NCV6336 is an I2C programmable BUCK (step-down) converter.
> +  It is designed for mobile power applications.
> +
> +properties:
> +  $nodename:
> +    pattern: "regulator@[0-9a-f]{2}"

Drop nodename, not really needed in device schema.

> +
> +  compatible:
> +    const: onnn,ncv6336
> +
> +  reg:
> +    maxItems: 1
> +
> +  buck:
> +    description: buck regulator description

Why do you need "buck" node? Just merge the properties into this device
node.

> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - buck
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        regulator@1c {
> +            compatible = "onnn,ncv6336";
> +            reg = <0x1c>;
> +
> +            buck {
> +                regulator-name = "ncv6336,buck";
> +            };
> +       };

Messed indentation.

Best regards,
Krzysztof
Fabien Parent Dec. 19, 2024, 4:13 p.m. UTC | #2
On Thu, Dec 19, 2024 at 1:28 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Wed, Dec 18, 2024 at 03:36:37PM -0800, Fabien Parent wrote:
> > From: Fabien Parent <fabien.parent@linaro.org>
> >
> > Add binding documentation for the Onsemi NCV6336 regulator.
> >
> > Signed-off-by: Fabien Parent <fabien.parent@linaro.org>
> > ---
> >  .../bindings/regulator/onnn,ncv6336.yaml           | 54 ++++++++++++++++++++++
> >  1 file changed, 54 insertions(+)
> >
>
> subject: regulator first, then dt-bindings.
>
> 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
>
>
> > diff --git a/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml b/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..c69d126cab33668febe18e77bb34bd4bef52c993
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml
> > @@ -0,0 +1,54 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/regulator/onnn,ncv6336.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Onsemi NCV6336 Buck converter
> > +
> > +maintainers:
> > +  - Fabien Parent <fabien.parent@linaro.org>
> > +
> > +description: |
>
> Do not need '|' unless you need to preserve formatting.
>
> > +  The NCV6336 is an I2C programmable BUCK (step-down) converter.
> > +  It is designed for mobile power applications.
> > +
> > +properties:
> > +  $nodename:
> > +    pattern: "regulator@[0-9a-f]{2}"
>
> Drop nodename, not really needed in device schema.
>
> > +
> > +  compatible:
> > +    const: onnn,ncv6336
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  buck:
> > +    description: buck regulator description
>
> Why do you need "buck" node? Just merge the properties into this device
> node.

I decided to move the properties into a "buck" node to make the
upstream process of the driver
a little bit simpler. The driver is written in Rust, and if I want to
move the properties to the device
node I will need to provide a Rust abstraction for "struct
device_node". I decided to avoid this
to keep the patch series simpler by having one less abstraction to review.
If you think that's a problem, let me know and I will implement it the
way you are suggesting for v2.

>
> > +    type: object
> > +    $ref: regulator.yaml#
> > +    unevaluatedProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - buck
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        regulator@1c {
> > +            compatible = "onnn,ncv6336";
> > +            reg = <0x1c>;
> > +
> > +            buck {
> > +                regulator-name = "ncv6336,buck";
> > +            };
> > +       };
>
> Messed indentation.
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Dec. 21, 2024, 8:20 p.m. UTC | #3
On 19/12/2024 17:13, Fabien Parent wrote:
>>
>>> +
>>> +  compatible:
>>> +    const: onnn,ncv6336
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  buck:
>>> +    description: buck regulator description
>>
>> Why do you need "buck" node? Just merge the properties into this device
>> node.
> 
> I decided to move the properties into a "buck" node to make the
> upstream process of the driver
> a little bit simpler. The driver is written in Rust, and if I want to
> move the properties to the device
> node I will need to provide a Rust abstraction for "struct
> device_node". I decided to avoid this

buck is already a device node, so I don't quite get how this design
avoids such abstraction, but anyway driver design choices like this do
not shape DT.

> to keep the patch series simpler by having one less abstraction to review.
> If you think that's a problem, let me know and I will implement it the
> way you are suggesting for v2.
> 
Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml b/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..c69d126cab33668febe18e77bb34bd4bef52c993
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/onnn,ncv6336.yaml
@@ -0,0 +1,54 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/onnn,ncv6336.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Onsemi NCV6336 Buck converter
+
+maintainers:
+  - Fabien Parent <fabien.parent@linaro.org>
+
+description: |
+  The NCV6336 is an I2C programmable BUCK (step-down) converter.
+  It is designed for mobile power applications.
+
+properties:
+  $nodename:
+    pattern: "regulator@[0-9a-f]{2}"
+
+  compatible:
+    const: onnn,ncv6336
+
+  reg:
+    maxItems: 1
+
+  buck:
+    description: buck regulator description
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - buck
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@1c {
+            compatible = "onnn,ncv6336";
+            reg = <0x1c>;
+
+            buck {
+                regulator-name = "ncv6336,buck";
+            };
+       };
+     };
+...