diff mbox

[v5,4/9] rtc: at91sam9: add DT support

Message ID 1411377058-26155-5-git-send-email-boris.brezillon@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boris BREZILLON Sept. 22, 2014, 9:10 a.m. UTC
Add of_match_table to the existing driver so that rtc nodes defined in at91
DTs can be attached to this driver.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/rtc/rtc-at91sam9.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Johan Hovold Sept. 22, 2014, 3:17 p.m. UTC | #1
[ Please don't drop people from CC. ]

On Mon, Sep 22, 2014 at 11:10:53AM +0200, Boris BREZILLON wrote:
> Add of_match_table to the existing driver so that rtc nodes defined in at91
> DTs can be attached to this driver.

That should be rtt nodes.

Johan
Boris BREZILLON Sept. 22, 2014, 3:26 p.m. UTC | #2
On Mon, 22 Sep 2014 17:17:54 +0200
Johan Hovold <johan@kernel.org> wrote:

> [ Please don't drop people from CC. ]
> 
> On Mon, Sep 22, 2014 at 11:10:53AM +0200, Boris BREZILLON wrote:
> > Add of_match_table to the existing driver so that rtc nodes defined in at91
> > DTs can be attached to this driver.
> 
> That should be rtt nodes.

Oh crap! Hopefully this is the last occurrence of 'rtc' in my commit logs :-).

Best Regards,

Boris
diff mbox

Patch

diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index 38a2693..d72c34d 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -445,6 +445,14 @@  static int at91_rtc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
 
+#ifdef CONFIG_OF
+static const struct of_device_id at91_rtc_dt_ids[] = {
+	{ .compatible = "atmel,at91sam9260-rtt" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids);
+#endif
+
 static struct platform_driver at91_rtc_driver = {
 	.probe		= at91_rtc_probe,
 	.remove		= at91_rtc_remove,
@@ -453,6 +461,7 @@  static struct platform_driver at91_rtc_driver = {
 		.name	= "rtc-at91sam9",
 		.owner	= THIS_MODULE,
 		.pm	= &at91_rtc_pm_ops,
+		.of_match_table = of_match_ptr(at91_rtc_dt_ids),
 	},
 };