From 880cfd43ea50b3c2d880d94935f07c77bf7c7116 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 31 Oct 2012 11:30:08 +0100 Subject: 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 Signed-off-by: Mark Brown --- drivers/spi/spidev.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/spi') diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 830adbe..9fc5788 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include @@ -642,10 +644,17 @@ static int __devexit spidev_remove(struct spi_device *spi) return 0; } +static const struct of_device_id spidev_dt_ids[] = { + {}, +}; + +MODULE_DEVICE_TABLE(of, spidev_dt_ids); + static struct spi_driver spidev_spi_driver = { .driver = { .name = "spidev", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(spidev_dt_ids), }, .probe = spidev_probe, .remove = __devexit_p(spidev_remove), -- cgit v1.1 From 8fad805bdc5229bf9787b01ca07061bb5967c2d9 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 31 Oct 2012 11:30:09 +0100 Subject: spi: spidev: Add Rohm DH2228FV DAC compatible string Since we don't have a driver for it yet, use spidev instead. Signed-off-by: Maxime Ripard Signed-off-by: Mark Brown --- drivers/spi/spidev.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/spi') diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 9fc5788..e44abc9 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -645,6 +645,7 @@ static int __devexit spidev_remove(struct spi_device *spi) } static const struct of_device_id spidev_dt_ids[] = { + { .compatible = "rohm,dh2228fv" }, {}, }; -- cgit v1.1