drivers/rtc/rtc-at91rm9200.c: add DT support
authorJoachim Eastwood <manabian@gmail.com>
Mon, 29 Apr 2013 23:20:15 +0000 (16:20 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:34 +0000 (18:28 -0700)
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt [new file with mode: 0644]
drivers/rtc/rtc-at91rm9200.c

diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt
new file mode 100644 (file)
index 0000000..2a3feab
--- /dev/null
@@ -0,0 +1,15 @@
+Atmel AT91RM9200 Real Time Clock
+
+Required properties:
+- compatible: should be: "atmel,at91rm9200-rtc"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: rtc alarm/event interrupt
+
+Example:
+
+rtc@fffffe00 {
+       compatible = "atmel,at91rm9200-rtc";
+       reg = <0xfffffe00 0x100>;
+       interrupts = <1 4 7>;
+};
index f07bd318260ce57803f6ed9297f643f33caf8d42..a654071f57df64a8454f8bdaca86d7c2d2d83cd2 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/ioctl.h>
 #include <linux/completion.h>
 #include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <asm/uaccess.h>
 
@@ -373,12 +375,19 @@ static int at91_rtc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
 
+static const struct of_device_id at91_rtc_dt_ids[] = {
+       { .compatible = "atmel,at91rm9200-rtc" },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids);
+
 static struct platform_driver at91_rtc_driver = {
        .remove         = __exit_p(at91_rtc_remove),
        .driver         = {
                .name   = "at91_rtc",
                .owner  = THIS_MODULE,
                .pm     = &at91_rtc_pm_ops,
+               .of_match_table = of_match_ptr(at91_rtc_dt_ids),
        },
 };