[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251109221212.182d7862@kemnade.info>
Date: Sun, 9 Nov 2025 22:12:12 +0100
From: Andreas Kemnade <andreas@...nade.info>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Guenter Roeck <linux@...ck-us.net>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hwmon@...r.kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
On Sun, 9 Nov 2025 18:13:11 +0100
Krzysztof Kozlowski <krzk@...nel.org> wrote:
> On 08/11/2025 17:52, Andreas Kemnade wrote:
> > On Sat, 8 Nov 2025 15:46:01 +0100
> > Krzysztof Kozlowski <krzk@...nel.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
Powered by blists - more mailing lists