[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150427100436.GP5627@lukather>
Date: Mon, 27 Apr 2015 12:04:36 +0200
From: Maxime Ripard <maxime.ripard@...e-electrons.com>
To: Michal Suchanek <hramrach@...il.com>
Cc: Martin Sperl <kernel@...tin.sperl.org>,
Hans de Goede <hdegoede@...hat.com>,
Mark Brown <broonie@...nel.org>,
linux-sunxi <linux-sunxi@...glegroups.com>,
Jonathan Corbet <corbet@....net>,
linux-spi <linux-spi@...r.kernel.org>,
linux-doc <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [linux-sunxi] [PATCH 2/3] spidev: Add DT binding example.
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.
> >> >> > https://lkml.org/lkml/2014/4/28/612
> >> >> >
> >> >> >> But how do you know there is a device?
> >> >> >>
> >> >> >> Devices on i2c can be probed. On spi you just transfer random data and
> >> >> >> hope it does something useful. Some devices have readable registers
> >> >> >> and can be probed in a device-specific way but others are write-only.
> >> >> >
> >> >> > Well, what's the point of communicating with a non-existent device in
> >> >> > the first place?
> >> >>
> >> >> I have multitude of SPI devices which are not part of the board and
> >> >> hence its DT and can be connected to the board with jumper wires.
> >> >>
> >> >> Most of them don't have a linux driver or compatible to bind with.
> >> >
> >> > Then create such a compatible...
> >>
> >> I will if and when the device is usable.
> >
> > That's backward. The fact that your "driver" works really doesn't
> > depend on what the device actually is.
>
> Indeed.
>
> However, for the device to have a compatible the compatible must be
> specified in a driver and then I need a driver for the device to
> record the compatible in.
>
> Or do you suggest that I patch the compatible into spidev, write a
> driver for it, and then back out the compatible from spidev and check
> in the compatible again with the driver?
>
> Now that is backwards.
What Mark was suggesting was that you add a compatible to the spidev
driver, and then you have access to spidev from userspace, period.
If later on, you introduce a real driver for that, then yes, you would
have to remove the compatible from spidev, and have that matching
compatible in that new driver.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists