Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/rtc/rtc-imxdi.c: add devicetree support

Add device tree support to the rtc-imxdi driver.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Roland Stigge and committed by
Linus Torvalds
968d21c2 ef216ad0

+28
+17
Documentation/devicetree/bindings/rtc/imxdi-rtc.txt
··· 1 + * i.MX25 Real Time Clock controller 2 + 3 + This binding supports the following chips: i.MX25, i.MX53 4 + 5 + Required properties: 6 + - compatible: should be: "fsl,imx25-rtc" 7 + - reg: physical base address of the controller and length of memory mapped 8 + region. 9 + - interrupts: rtc alarm interrupt 10 + 11 + Example: 12 + 13 + rtc@80056000 { 14 + compatible = "fsl,imx53-rtc", "fsl,imx25-rtc"; 15 + reg = <0x80056000 2000>; 16 + interrupts = <29>; 17 + };
+11
drivers/rtc/rtc-imxdi.c
··· 37 37 #include <linux/rtc.h> 38 38 #include <linux/sched.h> 39 39 #include <linux/workqueue.h> 40 + #include <linux/of.h> 40 41 41 42 /* DryIce Register Definitions */ 42 43 ··· 496 495 return 0; 497 496 } 498 497 498 + #ifdef CONFIG_OF 499 + static const struct of_device_id dryice_dt_ids[] = { 500 + { .compatible = "fsl,imx25-rtc" }, 501 + { /* sentinel */ } 502 + }; 503 + 504 + MODULE_DEVICE_TABLE(of, dryice_dt_ids); 505 + #endif 506 + 499 507 static struct platform_driver dryice_rtc_driver = { 500 508 .driver = { 501 509 .name = "imxdi_rtc", 502 510 .owner = THIS_MODULE, 511 + .of_match_table = of_match_ptr(dryice_dt_ids), 503 512 }, 504 513 .remove = __devexit_p(dryice_rtc_remove), 505 514 };