devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] generic spidev devices must be registered
@ 2016-08-05 13:11 Fabien Lahoudere
       [not found] ` <1470402714-10798-1-git-send-email-fabien.lahoudere-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Fabien Lahoudere @ 2016-08-05 13:11 UTC (permalink / raw)
  Cc: Fabien Lahoudere, Mark Brown, Rob Herring, Mark Rutland,
	open list:SPI SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

Adding spidev in the compatible list, let configure spidev from device tree
instead of C source code.

Signed-off-by: Fabien Lahoudere <fabien.lahoudere-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
 Documentation/devicetree/bindings/spi/spidev.txt | 16 ++++++++++++++++
 drivers/spi/spidev.c                             |  1 +
 2 files changed, 17 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spidev.txt

diff --git a/Documentation/devicetree/bindings/spi/spidev.txt b/Documentation/devicetree/bindings/spi/spidev.txt
new file mode 100644
index 0000000..23200f2
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spidev.txt
@@ -0,0 +1,16 @@
+* SPIDEV
+
+spidev is a device driver to access to SPI devices using normal userspace I/O calls.
+To make an SPI device compatible with this drivers add:
+
+Required properties:
+- compatible : should be "spidev".
+
+Example:
+
+spidev0: spi@0 {
+	compatible = "spidev";
+	reg = <0>;
+	spi-max-frequency = <1000000>;
+	status = "okay";
+};
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 2e05046..d780491 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -696,6 +696,7 @@ static struct class *spidev_class;
 static const struct of_device_id spidev_dt_ids[] = {
 	{ .compatible = "rohm,dh2228fv" },
 	{ .compatible = "lineartechnology,ltc2488" },
+	{ .compatible = "spidev" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, spidev_dt_ids);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-05 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-05 13:11 [PATCH 1/1] generic spidev devices must be registered Fabien Lahoudere
     [not found] ` <1470402714-10798-1-git-send-email-fabien.lahoudere-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2016-08-05 13:43   ` Mark Rutland
2016-08-05 14:21     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).