linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930
Date: Sun, 9 Nov 2025 18:13:11 +0100	[thread overview]
Message-ID: <aa54cf7c-cabd-490b-9bdd-a7a077ced35c@kernel.org> (raw)
In-Reply-To: <20251108175244.0b51fac6@kemnade.info>

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

  reply	other threads:[~2025-11-09 17:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 20:06 [PATCH 0/3] regulator: Add FP9931/JD9930 Andreas Kemnade
2025-11-07 20:06 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower Andreas Kemnade
2025-11-08 12:10   ` Krzysztof Kozlowski
2025-11-07 20:06 ` [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 Andreas Kemnade
2025-11-08 12:17   ` Krzysztof Kozlowski
2025-11-08 14:21     ` Andreas Kemnade
2025-11-08 14:46       ` Krzysztof Kozlowski
2025-11-08 16:52         ` Andreas Kemnade
2025-11-09 17:13           ` Krzysztof Kozlowski [this message]
2025-11-09 21:12             ` Andreas Kemnade
2025-11-10  7:30               ` Krzysztof Kozlowski
2025-11-10 12:28                 ` Andreas Kemnade
2025-11-07 20:06 ` [PATCH 3/3] regulator: Add FP9931/JD9930 driver Andreas Kemnade
2025-11-08 12:21   ` Krzysztof Kozlowski
2025-11-08 23:03     ` Andreas Kemnade
2025-11-10  3:31   ` kernel test robot
2025-11-10 11:29   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa54cf7c-cabd-490b-9bdd-a7a077ced35c@kernel.org \
    --to=krzk@kernel.org \
    --cc=andreas@kemnade.info \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).