drivers/rtc/rtc-twl.c: add DT support for RTC inside twl4030/twl6030
authorBenoit Cousson <b-cousson@ti.com>
Tue, 10 Jan 2012 23:10:59 +0000 (15:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Jan 2012 00:30:53 +0000 (16:30 -0800)
Add the DT support for the TI rtc-twl present in the twl4030 and twl6030
devices.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Documentation/devicetree/bindings/rtc/twl-rtc.txt [new file with mode: 0644]
drivers/rtc/rtc-twl.c

diff --git a/Documentation/devicetree/bindings/rtc/twl-rtc.txt b/Documentation/devicetree/bindings/rtc/twl-rtc.txt
new file mode 100644 (file)
index 0000000..596e0c9
--- /dev/null
@@ -0,0 +1,12 @@
+* TI twl RTC
+
+The TWL family (twl4030/6030) contains a RTC.
+
+Required properties:
+- compatible : Should be twl4030-rtc
+
+Examples:
+
+rtc@0 {
+    compatible = "ti,twl4030-rtc";
+};
index 20687d55e7a72d5eb2871fd8504d6a2fa457e9e5..d43b4f6eb4e420c79327566e3444351cf86c8185 100644 (file)
@@ -550,6 +550,11 @@ static int twl_rtc_resume(struct platform_device *pdev)
 #define twl_rtc_resume  NULL
 #endif
 
+static const struct of_device_id twl_rtc_of_match[] = {
+       {.compatible = "ti,twl4030-rtc", },
+       { },
+};
+MODULE_DEVICE_TABLE(of, twl_rtc_of_match);
 MODULE_ALIAS("platform:twl_rtc");
 
 static struct platform_driver twl4030rtc_driver = {
@@ -559,8 +564,9 @@ static struct platform_driver twl4030rtc_driver = {
        .suspend        = twl_rtc_suspend,
        .resume         = twl_rtc_resume,
        .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = "twl_rtc",
+               .owner          = THIS_MODULE,
+               .name           = "twl_rtc",
+               .of_match_table = twl_rtc_of_match,
        },
 };