Input: arc_ps2 - add support for device tree
authorMischa Jonker <Mischa.Jonker@synopsys.com>
Sun, 31 Mar 2013 07:25:33 +0000 (00:25 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 31 Mar 2013 07:48:14 +0000 (00:48 -0700)
Add match table for device tree binding and dts binding doc.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/devicetree/bindings/serio/snps-arc_ps2.txt [new file with mode: 0644]
drivers/input/serio/arc_ps2.c

diff --git a/Documentation/devicetree/bindings/serio/snps-arc_ps2.txt b/Documentation/devicetree/bindings/serio/snps-arc_ps2.txt
new file mode 100644 (file)
index 0000000..38c2f21
--- /dev/null
@@ -0,0 +1,16 @@
+* ARC PS/2 driver: PS/2 block used in some ARC FPGA's & nSIM OSCI model
+
+Required properties:
+- compatible           : "snps,arc_ps2"
+- reg                  : offset and length (always 0x14) of registers
+- interrupts           : interrupt
+- interrupt-names      : name of interrupt, must be "arc_ps2_irq"
+
+Example:
+
+serio@c9000400 {
+       compatible = "snps,arc_ps2";
+       reg = <0xc9000400 0x14>;
+       interrupts = <13>;
+       interrupt-names = "arc_ps2_irq";
+}
index c52e3e589f7283bef15c502c9e14fb3625ad2d43..3fb7727c8ea5679b9a443dc729d568d02c0788c6 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -259,10 +260,19 @@ static int arc_ps2_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id arc_ps2_match[] = {
+       { .compatible = "snps,arc_ps2" },
+       { },
+};
+MODULE_DEVICE_TABLE(of, arc_ps2_match);
+#endif
+
 static struct platform_driver arc_ps2_driver = {
        .driver = {
-               .name   = "arc_ps2",
-               .owner  = THIS_MODULE,
+               .name           = "arc_ps2",
+               .owner          = THIS_MODULE,
+               .of_match_table = of_match_ptr(arc_ps2_match),
        },
        .probe  = arc_ps2_probe,
        .remove = arc_ps2_remove,