Skip to content

Commit

Permalink
spi: spidev: Add device tree bindings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maxime Ripard authored and Mark Brown committed Nov 1, 2012
1 parent 8f0d816 commit 880cfd4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/spi/spidev.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <linux/of.h>
#include <linux/of_device.h>

#include <linux/spi/spi.h>
#include <linux/spi/spidev.h>
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 880cfd4

Please sign in to comment.