Re: [PATCH v3 01/13] spi: dt-bindings: allow spi-max-frequency to specify a frequency pair
From: Krzysztof Kozlowski
Date: Sat May 30 2026 - 04:54:26 EST
On Thu, May 28, 2026 at 06:36:57PM +0100, Conor Dooley wrote:
> On Wed, May 27, 2026 at 11:25:15PM +0530, Santhosh Kumar K wrote:
> > Some SPI controllers support high-speed operating modes that require
> > controller-side configuration before the device can be driven at its
> > rated maximum frequency. In these cases two frequencies are relevant:
> > a conservative speed usable without any such configuration, and the
> > maximum speed achievable once the controller is set up accordingly.
> >
> > The existing spi-max-frequency property accepts only a single u32,
> > which cannot express this distinction. Extend it to accept either a
> > single value (retaining full backward compatibility) or a two-element
> > array [base-frequency, max-frequency], where base-frequency is the
> > conservative operating speed and max-frequency is the highest speed
> > the device supports after controller-side configuration.
> >
> > Signed-off-by: Santhosh Kumar K <s-k6@xxxxxx>
> > ---
> > .../devicetree/bindings/spi/spi-peripheral-props.yaml | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
>
> Pretty sure this hasn't been tested, dt_binding_check cannot even build
> processed-schema.json with this applied because there are multiple
> definitions of spi-max-frequency with it applied.
>
> The sashiko makes the point that this breaks every binding that uses
> minimum/maximum to set constraints too, because these properties do not
> apply to arrays unless applied per item.
>
> I also don't get the point of this property, why can't you just set the
> max that the device can do and if the controller can configure itself to
> be fast enough it will do so, and if it can't then it'll pick whatever
> the fastest it can actually do instead?
> Seems like you're abusing a peripheral property to encode information
> about the controller.
Yes, commit msg speaks about controller but patch body changes SPI devices.
Best regards,
Krzysztof