Re: [linux-sunxi] [PATCH 2/3] spidev: Add DT binding example.

Michal Suchanek
2015-04-27T11:19:05Z

On 27 April 2015 at 12:04, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Sun, Apr 26, 2015 at 08:53:16PM +0200, Michal Suchanek wrote:
>> >> Also for driver prototyping you need a compatible which makes the
>> >> device accessible.
>> >>
>> >> If no spidev general compatible is available people will just use
>> >> compatible for some random device which happens to bind to spidev and
>> >> will send many letters of thanks to the DT maintainers when the device
>> >> used for this purpose suddenly grows a Linux driver.
>> >
>> > If people do dumb things, they should expect it to backfire.
>>
>> Yes, dumb things like not allowing people to say in the DT that the
>> board actually has pins on it connected to a SPI bus. Which is the
>> actual hardware which should be described in the DT.
>
> It's not connected to an SPI bus. It's connected to a device using an
> SPI bus. If you just had floating SPI lines, I'm pretty sure you
> wouldn't care about spidev at all.
>
>> Do you have to describe a modem or terminal emulator in DT to connect
>> it to your serial port? You just describe the port. So here you have a
>> SPI port and it should be described in the DT as faithfully as the
>> serial port.
>
> Except that in the serial port, you have a representation of a bus,
> while spidev represents a *device* connected on an SPI bus. So these
> are two different things, really.

No it's the same thing, really.

With serial you just have serial lines which you expose on a connector.

With SPI you have CS so you can technically have several connectors
for the same SPI bus selected by different CS.

So yes, making a spidev entry for the connector under SPI bus is the
equivalent of making an UART entry to specify that there is a
connector.

Thanks

Michal