[PATCH] SPI: spidev: Add DT compatible string for spidev driver.

Maxime Ripard maxime.ripard at free-electrons.com
Fri Apr 12 09:30:57 EDT 2013


Hi Martin,

Le 12/04/2013 14:56, Martin Fuzzey a écrit :
> The spidev driver is useful to allow userspace access
> to SPI devices that have no kernel SPI driver.
> 
> However DT requires a compatible tree to allow the driver
> to be probed.
> 
> To avoid having to modify the driver for every extra device
> add a generic "linux,spidev" compatible string that may be
> used in the DT to match such devices.

I submitted a similar patch quite some time ago [1], and at the time,
this patch was found inadequate, and we decided to add the compatible of
the particular device that we drive through spidev.

The rationale behind that is that the device tree is a hardware
description, so it's only interested about which device there is on the
SPI bus, and not the driver that will eventually handle it. That allows
both to have a meaningful devicetree, but also to easily handle the case
where a driver for that particular device is finally implemented, since
we won't have to change the device tree in itself to reflect this.

So I suggest you only add to the "real" compatible string instead of a
generic one.

Maxime

[1] http://comments.gmane.org/gmane.linux.kernel.spi.devel/11734

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the linux-arm-kernel mailing list