Re: [PATCH v2 2/2] dt-bindings: Add documentation for SPI daisy chain driver.

From: Geert Uytterhoeven
Date: Mon Jul 06 2020 - 11:33:05 EST


Hi Adrian,

On Mon, Jul 6, 2020 at 5:19 PM Adrian Fiergolski
<adrian.fiergolski@xxxxxxxxxxxxx> wrote:
> On 06.07.2020 17:10, Geert Uytterhoeven wrote:
> > On Mon, Jul 6, 2020 at 11:23 AM Adrian Fiergolski
> > <adrian.fiergolski@xxxxxxxxxxxxx> wrote:
> >> Add documentation for SPI daisy chain driver.
> >>
> >> Signed-off-by: Adrian Fiergolski <adrian.fiergolski@xxxxxxxxxxxxx>
> > Thanks for your patch!
> >
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/spi/spi-daisy_chain.txt
> >> @@ -0,0 +1,56 @@
> >> +spi-daisy_chain : The driver handling SPI daisy chains.
> >> +-----------------------------------------------------------
> >> +
> >> +Required properties:
> >> +- compatible : Should be "spi,daisy_chain"
> >> +- reg : Chip select assigned to the chain
> >> +
> >> + For the SPI devices on a common SPI chain - nodes of daisy_chain):
> >> +- spi-daisy-chain-len : Length (in bytes) of the SPI transfer,
> >> + when the SPI device is part of a device chain.
> >> +- spi-daisy-chain-noop : Byte string of no-operation command which should
> >> + be send when device is not addressed during the
> >> + given SPI transfer
> > The above two properties are device-specific, and the same for all
> > devices of the same type, thus leading to duplication.
> > Hence I think this should not be specified in DT, but instead handled
> > by the driver. I.e. for Linux, you would retrieve this from struct
> > spi_device, as filled in by the slave driver.
> The problem is that then this patch would not be compatible out of the
> box with all SPI devices (as it's now) and would require rewrite (adding
> this extra information in the spi_driver struct) of all SPI drivers
> which support daisy chain.

That's correct.
However, that information would need to be added to each driver only once.
With your proposal, it has to be added to all affected nodes of all DTSes
of all users.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds