diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2012-10-31 06:30:08 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-01 10:54:47 -0400 |
commit | 880cfd43ea50b3c2d880d94935f07c77bf7c7116 (patch) | |
tree | c75ced05921bae1cd619f7cbeaf5b226e9c9adba /drivers/spi/spidev.c | |
parent | 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff) |
spi: spidev: Add device tree bindings
This will allow to probe spidev from device tree by adding the
compatible string of each device to this array.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi/spidev.c')
-rw-r--r-- | drivers/spi/spidev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 830adbed1d7a..9fc5788f2095 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/compat.h> | 33 | #include <linux/compat.h> |
34 | #include <linux/of.h> | ||
35 | #include <linux/of_device.h> | ||
34 | 36 | ||
35 | #include <linux/spi/spi.h> | 37 | #include <linux/spi/spi.h> |
36 | #include <linux/spi/spidev.h> | 38 | #include <linux/spi/spidev.h> |
@@ -642,10 +644,17 @@ static int __devexit spidev_remove(struct spi_device *spi) | |||
642 | return 0; | 644 | return 0; |
643 | } | 645 | } |
644 | 646 | ||
647 | static const struct of_device_id spidev_dt_ids[] = { | ||
648 | {}, | ||
649 | }; | ||
650 | |||
651 | MODULE_DEVICE_TABLE(of, spidev_dt_ids); | ||
652 | |||
645 | static struct spi_driver spidev_spi_driver = { | 653 | static struct spi_driver spidev_spi_driver = { |
646 | .driver = { | 654 | .driver = { |
647 | .name = "spidev", | 655 | .name = "spidev", |
648 | .owner = THIS_MODULE, | 656 | .owner = THIS_MODULE, |
657 | .of_match_table = of_match_ptr(spidev_dt_ids), | ||
649 | }, | 658 | }, |
650 | .probe = spidev_probe, | 659 | .probe = spidev_probe, |
651 | .remove = __devexit_p(spidev_remove), | 660 | .remove = __devexit_p(spidev_remove), |