]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rtc: stmp3xxx: Add simple binding for the stmp3xxx-rtc
authorMarek Vasut <marex@denx.de>
Tue, 26 Jun 2012 08:29:27 +0000 (16:29 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Tue, 3 Jul 2012 05:22:36 +0000 (13:22 +0800)
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: rtc-linux@googlegroups.com
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt [new file with mode: 0644]
drivers/rtc/rtc-stmp3xxx.c

diff --git a/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt b/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt
new file mode 100644 (file)
index 0000000..b800070
--- /dev/null
@@ -0,0 +1,16 @@
+* STMP3xxx/i.MX28 Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
+    * "fsl,stmp3xxx-rtc"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: rtc alarm interrupt
+
+Example:
+
+rtc@80056000 {
+       compatible = "fsl,imx28-rtc", "fsl,stmp3xxx-rtc";
+       reg = <0x80056000 2000>;
+       interrupts = <29>;
+};
index 10287865e33012a154100b6b674f541273d132d3..739ef55694f4d30c6d7370ae66c5ad42e996430f 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/interrupt.h>
 #include <linux/rtc.h>
 #include <linux/slab.h>
+#include <linux/of_device.h>
 
 #include <mach/common.h>
 
@@ -265,6 +266,12 @@ static int stmp3xxx_rtc_resume(struct platform_device *dev)
 #define stmp3xxx_rtc_resume    NULL
 #endif
 
+static const struct of_device_id rtc_dt_ids[] = {
+       { .compatible = "fsl,stmp3xxx-rtc", },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, rtc_dt_ids);
+
 static struct platform_driver stmp3xxx_rtcdrv = {
        .probe          = stmp3xxx_rtc_probe,
        .remove         = stmp3xxx_rtc_remove,
@@ -273,6 +280,7 @@ static struct platform_driver stmp3xxx_rtcdrv = {
        .driver         = {
                .name   = "stmp3xxx-rtc",
                .owner  = THIS_MODULE,
+               .of_match_table = rtc_dt_ids,
        },
 };