diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-09-22 16:46:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 07:39:43 -0700 |
commit | 75368bf6c2876d8f33abfe77aa3864869a3893eb (patch) | |
tree | 97a543508a8aeb45646d059f8cdd561ae0a76ef2 /include/linux/mod_devicetable.h | |
parent | b5f3294f0be5496aec01e5aa709a5fab8bb2f225 (diff) | |
download | linux-stable-75368bf6c2876d8f33abfe77aa3864869a3893eb.tar.gz linux-stable-75368bf6c2876d8f33abfe77aa3864869a3893eb.tar.bz2 linux-stable-75368bf6c2876d8f33abfe77aa3864869a3893eb.zip |
spi: add support for device table matching
With this patch spi drivers can use standard spi_driver.id_table and
MODULE_DEVICE_TABLE() mechanisms to bind against the devices. Just like
we do with I2C drivers.
This is useful when a single driver supports several variants of devices
but it is not possible to detect them in run-time (like non-JEDEC chips
probing in drivers/mtd/devices/m25p80.c), and when platform_data usage is
overkill.
This patch also makes life a lot easier on OpenFirmware platforms, since
with OF we extensively use proper device IDs in modaliases.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mod_devicetable.h')
-rw-r--r-- | include/linux/mod_devicetable.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 1bf5900ffe43..b34f1ef2f1fe 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -399,6 +399,16 @@ struct i2c_device_id { __attribute__((aligned(sizeof(kernel_ulong_t)))); }; +/* spi */ + +#define SPI_NAME_SIZE 32 + +struct spi_device_id { + char name[SPI_NAME_SIZE]; + kernel_ulong_t driver_data /* Data private to the driver */ + __attribute__((aligned(sizeof(kernel_ulong_t)))); +}; + /* dmi */ enum dmi_field { DMI_NONE, |