[PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930

Andreas Kemnade posted 3 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Andreas Kemnade 1 month, 1 week ago
Document the FP9931/JD9930. As the FP9931 is a clear subset of the JD9930,
define it as a fallback compatible. GPIO names are same as in the datasheet
except for the EN pad which is described as "enable".

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 .../devicetree/bindings/regulator/fiti,fp9931.yaml | 133 +++++++++++++++++++++
 1 file changed, 133 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/fiti,fp9931.yaml b/Documentation/devicetree/bindings/regulator/fiti,fp9931.yaml
new file mode 100644
index 000000000000..ce44040a3c02
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/fiti,fp9931.yaml
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/fiti,fp9931.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: FitiPower FP9931/JD9930 Power Management Integrated Circuit
+
+maintainers:
+  - Andreas Kemnade <andreas@kemnade.info>
+
+description:
+  FP9931 is a Power Management IC to provide Power for EPDs with one 3.3V
+  switch, 2 symmetric LDOs behind 2 DC/DC converters, and one unsymmetric
+  regulator for a compensation voltage.
+  JD9930 has in addition some kind of night mode.
+
+properties:
+  compatible:
+    oneOf:
+      - const: fiti,fp9931
+
+      - items:
+          - const: fiti,jd9930
+          - const: fiti,fp9931
+
+  reg:
+    maxItems: 1
+
+  '#thermal-sensor-cells':
+    const: 0
+
+  enable-gpios:
+    maxItems: 1
+
+  pg-gpios:
+    maxItems: 1
+
+  ts-en-gpios:
+    maxItems: 1
+
+  xon-gpios:
+    maxItems: 1
+
+  vin-supply:
+    description:
+      Supply for the whole chip. Some vendor kernels and devicetrees
+      declare this as a non-existing GPIO named "pwrall".
+
+  fiti,tdly:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      Power up soft start delay settings tDLY1-4 bitfields in the
+      POWERON_DELAY register
+
+    minItems: 4
+    maxItems: 4
+
+  VCOM:
+    type: object
+    $ref: /schemas/regulator/regulator.yaml#
+    unevaluatedProperties: false
+    description:
+      The regulator for the compenstation voltage.
+    properties:
+      regulator-name:
+        const: VCOM
+
+  VPOSNEG:
+    type: object
+    $ref: /schemas/regulator/regulator.yaml#
+    unevaluatedProperties: false
+    description:
+      The pair of symmetric LDOs
+    properties:
+      regulator-name:
+        const: VPOSNEG
+
+  V3P3:
+    type: object
+    $ref: /schemas/regulator/regulator.yaml#
+    unevaluatedProperties: false
+    description:
+      The pair of symmetric LDOs
+    properties:
+      regulator-name:
+        const: V3P3
+
+required:
+  - compatible
+  - reg
+  - '#thermal-sensor-cells'
+  - pg-gpios
+  - enable-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        fp9931: pmic@18 {
+          compatible = "fiti,fp9931";
+          reg = <0x18>;
+          pinctrl-names = "default";
+          pinctrl-0 = <&pinctrl_fp9931_gpio>;
+          #thermal-sensor-cells = <0>;
+          vin-supply = <&epd_pmic_supply>;
+          pg-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
+          ts-en-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
+          enable-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
+          fiti,tdly = <2 2 3 3>;
+
+          vcom_reg: VCOM {
+            regulator-name = "VCOM";
+            regulator-min-microvolt = <2352840>;
+            regulator-max-microvolt = <2352840>;
+          };
+
+          vposneg_reg: VPOSNEG {
+            regulator-name = "VPOSNEG";
+            regulator-min-microvolt = <15060000>;
+            regulator-max-microvolt = <15060000>;
+          };
+
+          v3p3_reg: V3P3 {
+            regulator-name = "V3P3";
+          };
+        };
+    };

-- 
2.47.3
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On Fri, Nov 07, 2025 at 09:06:45PM +0100, Andreas Kemnade wrote:
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: fiti,fp9931
> +
> +      - items:
> +          - const: fiti,jd9930
> +          - const: fiti,fp9931
> +
> +  reg:
> +    maxItems: 1
> +
> +  '#thermal-sensor-cells':

Why is this a thermal zone sensor? Aren't you mixing temperature
reading with soc? For temperature reading you can use hwmon, for
example.

> +    const: 0
> +
> +  enable-gpios:
> +    maxItems: 1
> +
> +  pg-gpios:
> +    maxItems: 1
> +
> +  ts-en-gpios:

It's called EN_TS, so en-ts-gpios.


> +    maxItems: 1
> +
> +  xon-gpios:

That's powerdown-gpios, see gpio-consumer-common.

> +    maxItems: 1
> +
> +  vin-supply:
> +    description:
> +      Supply for the whole chip. Some vendor kernels and devicetrees
> +      declare this as a non-existing GPIO named "pwrall".
> +
> +  fiti,tdly:

No, look at datasheet. What values are there? ms.

> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    description:
> +      Power up soft start delay settings tDLY1-4 bitfields in the
> +      POWERON_DELAY register
> +

Drop blank line

> +    minItems: 4
> +    maxItems: 4
> +
> +  VCOM:

Lowercase, just group them under regulators node and use patterns.


> +    type: object
> +    $ref: /schemas/regulator/regulator.yaml#
> +    unevaluatedProperties: false
> +    description:
> +      The regulator for the compenstation voltage.
> +    properties:
> +      regulator-name:
> +        const: VCOM

No, why? Board designers could call it differently. Drop.

> +
> +  VPOSNEG:
> +    type: object
> +    $ref: /schemas/regulator/regulator.yaml#
> +    unevaluatedProperties: false
> +    description:
> +      The pair of symmetric LDOs
> +    properties:
> +      regulator-name:
> +        const: VPOSNEG

Drop

> +
> +  V3P3:
> +    type: object
> +    $ref: /schemas/regulator/regulator.yaml#
> +    unevaluatedProperties: false
> +    description:
> +      The pair of symmetric LDOs
> +    properties:
> +      regulator-name:
> +        const: V3P3

Drop

> +
> +required:
> +  - compatible
> +  - reg
> +  - '#thermal-sensor-cells'
> +  - pg-gpios
> +  - enable-gpios
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        fp9931: pmic@18 {

Drop unused label.

> +          compatible = "fiti,fp9931";
> +          reg = <0x18>;
> +          pinctrl-names = "default";
> +          pinctrl-0 = <&pinctrl_fp9931_gpio>;
> +          #thermal-sensor-cells = <0>;
> +          vin-supply = <&epd_pmic_supply>;
> +          pg-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
> +          ts-en-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
> +          enable-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
> +          fiti,tdly = <2 2 3 3>;
> +
> +          vcom_reg: VCOM {
> +            regulator-name = "VCOM";

Names are always lowercase.

Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Andreas Kemnade 1 month, 1 week ago
On Sat, 8 Nov 2025 13:17:31 +0100
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On Fri, Nov 07, 2025 at 09:06:45PM +0100, Andreas Kemnade wrote:
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - const: fiti,fp9931
> > +
> > +      - items:
> > +          - const: fiti,jd9930
> > +          - const: fiti,fp9931
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  '#thermal-sensor-cells':  
> 
> Why is this a thermal zone sensor? Aren't you mixing temperature
> reading with soc? For temperature reading you can use hwmon, for
> example.
> 
well, I just took the SY7636A as reference. Is there any document describing
the terme "thermal zone sensor". I would define a thermal zone as an area
with things influencing each other thermically. These things are
sensors, heat sources and sinks. Well, the panel typically does not produce
much heat.
But I do not insist on having that property here. As far as I understand,
the hwmon uses this property as an indication to also create a thermal zone
sensor.

> > +    const: 0
> > +
> > +  enable-gpios:
> > +    maxItems: 1
> > +
> > +  pg-gpios:
> > +    maxItems: 1
> > +
> > +  ts-en-gpios:  
> 
> It's called EN_TS, so en-ts-gpios.
> 
ok
> 
> > +    maxItems: 1
> > +
> > +  xon-gpios:  
> 
> That's powerdown-gpios, see gpio-consumer-common.
> 
looking a bit around: powerdown-gpios e.g. in the MCP4801
describe an *input*, which should be connected to an output of the SoC. 
Looking at the datasheet, I see "XON Open Drain N-MOS On-Resistance" so it is
an *output* (same as for PG). So it is something different then the
powerdown-gpios in e.g. the MCP4801.
So it is a signal coming from the JD9930 after EN goes low in the power down
sequence.

> > +    maxItems: 1
> > +
> > +  vin-supply:
> > +    description:
> > +      Supply for the whole chip. Some vendor kernels and devicetrees
> > +      declare this as a non-existing GPIO named "pwrall".
> > +
> > +  fiti,tdly:  
> 
> No, look at datasheet. What values are there? ms.
> 
Hmm, no to what? I do not understand your comment.
So I guess a bit what might be options to discuss here:
- put raw value for the bitfield here (what is currently done).
- put the ms values here (then I would expect a suffix in the property name)
  We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is
  not identical.

Regards,
Andreas
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 08/11/2025 15:21, Andreas Kemnade wrote:
> On Sat, 8 Nov 2025 13:17:31 +0100
> Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
>> On Fri, Nov 07, 2025 at 09:06:45PM +0100, Andreas Kemnade wrote:
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - const: fiti,fp9931
>>> +
>>> +      - items:
>>> +          - const: fiti,jd9930
>>> +          - const: fiti,fp9931
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  '#thermal-sensor-cells':  
>>
>> Why is this a thermal zone sensor? Aren't you mixing temperature
>> reading with soc? For temperature reading you can use hwmon, for
>> example.
>>
> well, I just took the SY7636A as reference. Is there any document describing
> the terme "thermal zone sensor". I would define a thermal zone as an area
> with things influencing each other thermically. These things are
> sensors, heat sources and sinks. Well, the panel typically does not produce
> much heat.
> But I do not insist on having that property here. As far as I understand,
> the hwmon uses this property as an indication to also create a thermal zone
> sensor.

That's Linux detail, but anyway you don't need it. This device does not
look like a part of thermal zones.

> 
>>> +    const: 0
>>> +
>>> +  enable-gpios:
>>> +    maxItems: 1
>>> +
>>> +  pg-gpios:
>>> +    maxItems: 1
>>> +
>>> +  ts-en-gpios:  
>>
>> It's called EN_TS, so en-ts-gpios.
>>
> ok
>>
>>> +    maxItems: 1
>>> +
>>> +  xon-gpios:  
>>
>> That's powerdown-gpios, see gpio-consumer-common.
>>
> looking a bit around: powerdown-gpios e.g. in the MCP4801
> describe an *input*, which should be connected to an output of the SoC. 
> Looking at the datasheet, I see "XON Open Drain N-MOS On-Resistance" so it is
> an *output* (same as for PG). So it is something different then the
> powerdown-gpios in e.g. the MCP4801.
> So it is a signal coming from the JD9930 after EN goes low in the power down
> sequence.

OK, I just briefly skimmed through datasheet.

> 
>>> +    maxItems: 1
>>> +
>>> +  vin-supply:
>>> +    description:
>>> +      Supply for the whole chip. Some vendor kernels and devicetrees
>>> +      declare this as a non-existing GPIO named "pwrall".
>>> +
>>> +  fiti,tdly:  
>>
>> No, look at datasheet. What values are there? ms.
>>
> Hmm, no to what? I do not understand your comment.

Please use proper units for the field expressed in the property name
suffix and possible values (enum).
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml

You also need default.

> So I guess a bit what might be options to discuss here:
> - put raw value for the bitfield here (what is currently done).
> - put the ms values here (then I would expect a suffix in the property name)
>   We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is
>   not identical.
I don't know what has to be identical. You want here 0, 1, 2 or 4 ms.
BTW, if you speak about driver complexity, getting register value out of
above is absolutely trivial, so not a suitable argument.

Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Andreas Kemnade 1 month, 1 week ago
On Sat, 8 Nov 2025 15:46:01 +0100
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> >>> +  fiti,tdly:    
> >>
> >> No, look at datasheet. What values are there? ms.
> >>  
> > Hmm, no to what? I do not understand your comment.  
> 
> Please use proper units for the field expressed in the property name
> suffix and possible values (enum).
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
> 
> You also need default.
> 
> > So I guess a bit what might be options to discuss here:
> > - put raw value for the bitfield here (what is currently done).
> > - put the ms values here (then I would expect a suffix in the property name)
> >   We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is
> >   not identical.  
> I don't know what has to be identical. You want here 0, 1, 2 or 4 ms.
> BTW, if you speak about driver complexity, getting register value out of
> above is absolutely trivial, so not a suitable argument.

Ok, no problem with doing that trivial conversion in the driver.

Playing around with dt-binding-check and add enums (and the -ms in a
second step):
  fitipower,tdlys:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    description:
      Power up soft start delay settings tDLY1-4 bitfields in the
      POWERON_DELAY register
    default: <0 0 0 0>
    items:
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4


dt-binding-check accepts this, including the example. But if I change it to -ms
as you requested, I get

/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'maxItems' is a required property
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'$ref' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('$ref', 'default' were unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'maxItems' is a required property
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'$ref' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('$ref', 'default' were unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

Leaving out the type $ref does not improve things much.
What is going on here?

Regards,
Andreas
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 08/11/2025 17:52, Andreas Kemnade wrote:
> On Sat, 8 Nov 2025 15:46:01 +0100
> Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
>>>>> +  fiti,tdly:    
>>>>
>>>> No, look at datasheet. What values are there? ms.
>>>>  
>>> Hmm, no to what? I do not understand your comment.  
>>
>> Please use proper units for the field expressed in the property name
>> suffix and possible values (enum).
>> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
>>
>> You also need default.
>>
>>> So I guess a bit what might be options to discuss here:
>>> - put raw value for the bitfield here (what is currently done).
>>> - put the ms values here (then I would expect a suffix in the property name)
>>>   We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is
>>>   not identical.  
>> I don't know what has to be identical. You want here 0, 1, 2 or 4 ms.
>> BTW, if you speak about driver complexity, getting register value out of
>> above is absolutely trivial, so not a suitable argument.
> 
> Ok, no problem with doing that trivial conversion in the driver.
> 
> Playing around with dt-binding-check and add enums (and the -ms in a
> second step):
>   fitipower,tdlys:
>     $ref: /schemas/types.yaml#/definitions/uint32-array
>     description:
>       Power up soft start delay settings tDLY1-4 bitfields in the
>       POWERON_DELAY register
>     default: <0 0 0 0>
>     items:
>       - enum:
>           - 0
>           - 1
>           - 2
>           - 4
>       - enum:
>           - 0
>           - 1
>           - 2
>           - 4
>       - enum:
>           - 0
>           - 1
>           - 2
>           - 4
>       - enum:
>           - 0
>           - 1
>           - 2
>           - 4
> 
> 
> dt-binding-check accepts this, including the example. But if I change it to -ms
> as you requested, I get
> 
> /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
> 	'maxItems' is a required property
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	'$ref' is not one of ['maxItems', 'description', 'deprecated']
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	'default' is not one of ['maxItems', 'description', 'deprecated']
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	'items' is not one of ['maxItems', 'description', 'deprecated']
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	Additional properties are not allowed ('$ref', 'default' were unexpected)
> 		hint: Arrays must be described with a combination of minItems/maxItems/items
> 	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
> 	'<0 0 0 0>' is not of type 'integer'
> 	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
> 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
> 	hint: Standard unit suffix properties don't need a type $ref
> 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
> 	'maxItems' is a required property
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	'$ref' is not one of ['maxItems', 'description', 'deprecated']
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	'default' is not one of ['maxItems', 'description', 'deprecated']
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	'items' is not one of ['maxItems', 'description', 'deprecated']
> 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> 	Additional properties are not allowed ('$ref', 'default' were unexpected)
> 		hint: Arrays must be described with a combination of minItems/maxItems/items
> 	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
> 	'<0 0 0 0>' is not of type 'integer'
> 	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
> 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
> 	hint: Standard unit suffix properties don't need a type $ref
> 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

You must drop ref. That's the entire point of common unit suffix.

> 
> Leaving out the type $ref does not improve things much.
> What is going on here?
Please paste the error from correct code, not above.


Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Andreas Kemnade 1 month, 1 week ago
On Sun, 9 Nov 2025 18:13:11 +0100
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On 08/11/2025 17:52, Andreas Kemnade wrote:
> > On Sat, 8 Nov 2025 15:46:01 +0100
> > Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >   
> >>>>> +  fiti,tdly:      
> >>>>
> >>>> No, look at datasheet. What values are there? ms.
> >>>>    
> >>> Hmm, no to what? I do not understand your comment.    
> >>
> >> Please use proper units for the field expressed in the property name
> >> suffix and possible values (enum).
> >> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
> >>
> >> You also need default.
> >>  
> >>> So I guess a bit what might be options to discuss here:
> >>> - put raw value for the bitfield here (what is currently done).
> >>> - put the ms values here (then I would expect a suffix in the property name)
> >>>   We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is
> >>>   not identical.    
> >> I don't know what has to be identical. You want here 0, 1, 2 or 4 ms.
> >> BTW, if you speak about driver complexity, getting register value out of
> >> above is absolutely trivial, so not a suitable argument.  
> > 
> > Ok, no problem with doing that trivial conversion in the driver.
> > 
> > Playing around with dt-binding-check and add enums (and the -ms in a
> > second step):
> >   fitipower,tdlys:
> >     $ref: /schemas/types.yaml#/definitions/uint32-array
> >     description:
> >       Power up soft start delay settings tDLY1-4 bitfields in the
> >       POWERON_DELAY register
> >     default: <0 0 0 0>
> >     items:
> >       - enum:
> >           - 0
> >           - 1
> >           - 2
> >           - 4
> >       - enum:
> >           - 0
> >           - 1
> >           - 2
> >           - 4
> >       - enum:
> >           - 0
> >           - 1
> >           - 2
> >           - 4
> >       - enum:
> >           - 0
> >           - 1
> >           - 2
> >           - 4
> > 
> > 
> > dt-binding-check accepts this, including the example. But if I change it to -ms
> > as you requested, I get
> > 
> > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
> > 	'maxItems' is a required property
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	'$ref' is not one of ['maxItems', 'description', 'deprecated']
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	'default' is not one of ['maxItems', 'description', 'deprecated']
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	'items' is not one of ['maxItems', 'description', 'deprecated']
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	Additional properties are not allowed ('$ref', 'default' were unexpected)
> > 		hint: Arrays must be described with a combination of minItems/maxItems/items
> > 	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
> > 	'<0 0 0 0>' is not of type 'integer'
> > 	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
> > 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
> > 	hint: Standard unit suffix properties don't need a type $ref
> > 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
> > 	'maxItems' is a required property
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	'$ref' is not one of ['maxItems', 'description', 'deprecated']
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	'default' is not one of ['maxItems', 'description', 'deprecated']
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	'items' is not one of ['maxItems', 'description', 'deprecated']
> > 		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
> > 	Additional properties are not allowed ('$ref', 'default' were unexpected)
> > 		hint: Arrays must be described with a combination of minItems/maxItems/items
> > 	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
> > 	'<0 0 0 0>' is not of type 'integer'
> > 	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
> > 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'}
> > 	hint: Standard unit suffix properties don't need a type $ref
> > 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#  
> 
> You must drop ref. That's the entire point of common unit suffix.
> 
I tried without it:

  fitipower,tdly-ms:
    description:
      Power up soft start delay settings tDLY1-4 bitfields in the
      POWERON_DELAY register
    default: <0 0 0 0>
    items:
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4
      - enum:
          - 0
          - 1
          - 2
          - 4


Errors:

  CHKDT   ./Documentation/devicetree/bindings
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'maxItems' is a required property
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('default' was unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'maxItems' is a required property
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('default' was unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

maxItems is required according to error message, so trying with...

  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  CHKDT   ./Documentation/devicetree/bindings
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: {'description': 'Power up soft start delay settings tDLY1-4 bitfields in the POWERON_DELAY register', 'default': '<0 0 0 0>', 'maxItems': 4, 'items': [{'enum': [0, 1, 2, 4]}, {'enum': [0, 1, 2, 4]}, {'enum': [0, 1, 2, 4]}, {'enum': [0, 1, 2, 4]}]} should not be valid under {'required': ['maxItems']}
	hint: "maxItems" is not needed with an "items" list
	from schema $id: http://devicetree.org/meta-schemas/items.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('default' was unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	1 was expected
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed:
	'default' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	'items' is not one of ['maxItems', 'description', 'deprecated']
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	Additional properties are not allowed ('default' was unexpected)
		hint: Arrays must be described with a combination of minItems/maxItems/items
	'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
	'<0 0 0 0>' is not of type 'integer'
	1 was expected
		hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
	hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#


BTW: before you ask: dt-schema is version 2025.8

removing items and default removes all problems. 
So working: 
  - fitipower,tdly without -ms suffix
  - fitipower,tdly-ms without default and items but maxItems.


Regards,
Andreas
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 09/11/2025 22:12, Andreas Kemnade wrote:
>>
>> You must drop ref. That's the entire point of common unit suffix.
>>
> I tried without it:
> 
>   fitipower,tdly-ms:
>     description:
>       Power up soft start delay settings tDLY1-4 bitfields in the
>       POWERON_DELAY register
>     default: <0 0 0 0>

Arrays are in [] (see also some examples of arrays in the example-schema).
[0, 0, 0, 0]

And then it should work, but does not which I think is bug in dtschema.
I think it works fine when you drop the "default:" completely, so please
do so. I'll take a look at the issue.

enum should be in one line, btw.

Your patchset has also blank line warnings.


Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Posted by Andreas Kemnade 1 month, 1 week ago
On Mon, 10 Nov 2025 08:30:41 +0100
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On 09/11/2025 22:12, Andreas Kemnade wrote:
> >>
> >> You must drop ref. That's the entire point of common unit suffix.
> >>  
> > I tried without it:
> > 
> >   fitipower,tdly-ms:
> >     description:
> >       Power up soft start delay settings tDLY1-4 bitfields in the
> >       POWERON_DELAY register
> >     default: <0 0 0 0>  
> 
> Arrays are in [] (see also some examples of arrays in the example-schema).
> [0, 0, 0, 0]
> 
> And then it should work, but does not which I think is bug in dtschema.
> I think it works fine when you drop the "default:" completely, so please
> do so. I'll take a look at the issue.
>
ok, dropping default makes dtschema happy.

> enum should be in one line, btw.
> 
> Your patchset has also blank line warnings.
I fixed the ones shown by

checkpatch.pl --strict

are there any more I am missing?

Regards,
Andreas