Re: [PATCH] spi: dt-bindings: Move 'rx-sample-delay-ns' to spi-peripheral-props.yaml

From: Pratyush Yadav
Date: Wed Jun 01 2022 - 01:30:08 EST


On 26/05/22 08:54AM, Rob Herring wrote:
> On Thu, May 26, 2022 at 11:16:42AM +0530, Pratyush Yadav wrote:
> > Hi Rob,
> >
> > On 25/05/22 04:00PM, Rob Herring wrote:
> > > SPI bus per device properties must be defined in spi-peripheral-props.yaml
> > > for unevaluatedProperties checks to work correctly on device nodes.
> > >
> > > This has the side effect of promoting 'rx-sample-delay-ns' to be a
> > > common property, but functionally it's no different if it was defined in
> > > a Synopsys specific schema file.
> >
> > Functionally it is no different, but does this property make sense for
> > other controllers? If not then I don't see why we should pollute the
> > common list with controller-specific ones. For one, this now no longer
> > makes it obvious that this property should only be used with the
> > Synopsys controller. And if you keep making small exceptions for other
> > controllers too, soon the common list will be full of controller
> > properties and it will be a mess finding out what belongs to who.
>
> There's at least one other case already:
>
> cdns,read-delay:
> $ref: /schemas/types.yaml#/definitions/uint32
> description:
> Delay for read capture logic, in clock cycles.
>
>
> Too many common properties is not a problem we have. Too many custom
> properties doing the same thing is the problem.

I agree. But in this case these two properties have different units.
rx-sample-delay-ns is obviously in nanoseconds. cdns,read-delay is in
number of ref clock cycles. If other controllers also use this property,
it could make sense to make rx-sample-delay-ns the default/common
property and drivers can then make conversions between the units that
should actually be programmed.

--
Regards,
Pratyush Yadav
Texas Instruments Inc.