Skip to content

Commit 07d4d72

Browse files
Boris BREZILLONNicolas Ferre
Boris BREZILLON
authored and
Nicolas Ferre
committed
rtc: at91sam9: add DT support
Add of_match_table to the existing driver so that rtt nodes defined in at91 DTs can be attached to this driver. Signed-off-by: Boris BREZILLON <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Acked-by: Johan Hovold <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]>
1 parent d41da3e commit 07d4d72

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/rtc/rtc-at91sam9.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,14 @@ static int at91_rtc_resume(struct device *dev)
445445

446446
static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
447447

448+
#ifdef CONFIG_OF
449+
static const struct of_device_id at91_rtc_dt_ids[] = {
450+
{ .compatible = "atmel,at91sam9260-rtt" },
451+
{ /* sentinel */ }
452+
};
453+
MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids);
454+
#endif
455+
448456
static struct platform_driver at91_rtc_driver = {
449457
.probe = at91_rtc_probe,
450458
.remove = at91_rtc_remove,
@@ -453,6 +461,7 @@ static struct platform_driver at91_rtc_driver = {
453461
.name = "rtc-at91sam9",
454462
.owner = THIS_MODULE,
455463
.pm = &at91_rtc_pm_ops,
464+
.of_match_table = of_match_ptr(at91_rtc_dt_ids),
456465
},
457466
};
458467

0 commit comments

Comments
 (0)