drivers/rtc/rtc-at91rm9200.c: add DT support
[cascardo/linux.git] / drivers / rtc / rtc-at91rm9200.c
index f07bd31..a654071 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),
        },
 };