Re: [PATCH 1/2] dtbindings: clock: Add bindings for Renesas PhiClock

From: Krzysztof Kozlowski
Date: Thu Nov 17 2022 - 02:39:56 EST


On 16/11/2022 21:11, Alex Helms wrote:
>>> + clocks:
>>> + const: 1
>>> +
>>> + compatible:
>>> + enum:
>>> + - renesas,9fgv1006
>>> +
>>> + reg:
>>> + maxItems: 1
>>> +
>>> + renesas,ss-amount-percent:
>>> + description: Spread spectrum absolute amount as hundredths of a percent, e.g. 150 is 1.50%.
>>
>> What? If this is percent then it cannot be hundreds of percent. Percent
>> is percent. Use appropriate units.
>> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdevicetree-org%2Fdt-schema%2Fblob%2Fmain%2Fdtschema%2Fschemas%2Fproperty-units.yaml&data=05%7C01%7Calexander.helms.jy%40renesas.com%7C9c13a32848f3434e217108dac7ab69f6%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7C638041836281252737%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6MULpJhPyyjWSo1SvPCrz6KidE1VEtiiNYk1O5wS1vI%3D&reserved=0
>>
>
> Values like 0.5% or 2.5% must be representable which is why this
> property is an integer of hundredths of percent. How else would you
> represent a non-integer percent?

With an appropriate unit.

>
>>> + minimum: 0
>>> + maximum: 500
>>> +
>>> + renesas,ss-modulation-hz:
>>> + description: Spread spectrum modulation rate in Hz
>>> + minimum: 30000
>>> + maximum: 63000
>>> +
>>> + renesas,ss-direction:
>>> + $ref: /schemas/types.yaml#/definitions/string
>>> + description: Spread spectrum direction
>>> + enum: [ down, center ]
>>> +
>>> +required:
>>> + - clock-names
>>> + - '#clock-cells'
>>> + - compatible
>>> + - reg
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> + - |
>>> + ref25: ref25m {
>>> + compatible = "fixed-clock";
>>> + #clock-cells = <0>;
>>> + clock-frequency = <25000000>;
>>> + };
>>
>> Drop, it's obvious, isn't it?
>>
>
> I disagree, this may be obvious to someone familiar with how clocks in
> the device tree works but not long ago it was entirely new to me and
> examples like these in the dt schemas were very helpful in getting the
> device up and running. There are several other bindings that define
> external crystals and reference clocks in this way.

It is obvious because it is the same for every device being a consumer
of external clock. There is no point to duplicate non-device related
examples in every device binding.

Best regards,
Krzysztof