diff options
| author | Marek Vasut <marex@denx.de> | 2012-06-26 04:29:27 -0400 |
|---|---|---|
| committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-03 01:22:36 -0400 |
| commit | dd8d20a3f32a7ba37526f5b4dfd4d35a93e5342f (patch) | |
| tree | 03975eb19e0629c7e5eb1af83fe8d32a4818769b | |
| parent | e1d4f23ec0688f58b7d60265f38e1cbe8c3a4432 (diff) | |
rtc: stmp3xxx: Add simple binding for the stmp3xxx-rtc
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>
| -rw-r--r-- | Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt | 16 | ||||
| -rw-r--r-- | drivers/rtc/rtc-stmp3xxx.c | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt b/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file mode 100644 index 000000000000..b800070fe6e9 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | * STMP3xxx/i.MX28 Time Clock controller | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible: should be one of the following. | ||
| 5 | * "fsl,stmp3xxx-rtc" | ||
| 6 | - reg: physical base address of the controller and length of memory mapped | ||
| 7 | region. | ||
| 8 | - interrupts: rtc alarm interrupt | ||
| 9 | |||
| 10 | Example: | ||
| 11 | |||
| 12 | rtc@80056000 { | ||
| 13 | compatible = "fsl,imx28-rtc", "fsl,stmp3xxx-rtc"; | ||
| 14 | reg = <0x80056000 2000>; | ||
| 15 | interrupts = <29>; | ||
| 16 | }; | ||
diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c index 10287865e330..739ef55694f4 100644 --- a/drivers/rtc/rtc-stmp3xxx.c +++ b/drivers/rtc/rtc-stmp3xxx.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
| 26 | #include <linux/rtc.h> | 26 | #include <linux/rtc.h> |
| 27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 28 | #include <linux/of_device.h> | ||
| 28 | 29 | ||
| 29 | #include <mach/common.h> | 30 | #include <mach/common.h> |
| 30 | 31 | ||
| @@ -265,6 +266,12 @@ static int stmp3xxx_rtc_resume(struct platform_device *dev) | |||
| 265 | #define stmp3xxx_rtc_resume NULL | 266 | #define stmp3xxx_rtc_resume NULL |
| 266 | #endif | 267 | #endif |
| 267 | 268 | ||
| 269 | static const struct of_device_id rtc_dt_ids[] = { | ||
| 270 | { .compatible = "fsl,stmp3xxx-rtc", }, | ||
| 271 | { /* sentinel */ } | ||
| 272 | }; | ||
| 273 | MODULE_DEVICE_TABLE(of, rtc_dt_ids); | ||
| 274 | |||
| 268 | static struct platform_driver stmp3xxx_rtcdrv = { | 275 | static struct platform_driver stmp3xxx_rtcdrv = { |
| 269 | .probe = stmp3xxx_rtc_probe, | 276 | .probe = stmp3xxx_rtc_probe, |
| 270 | .remove = stmp3xxx_rtc_remove, | 277 | .remove = stmp3xxx_rtc_remove, |
| @@ -273,6 +280,7 @@ static struct platform_driver stmp3xxx_rtcdrv = { | |||
| 273 | .driver = { | 280 | .driver = { |
| 274 | .name = "stmp3xxx-rtc", | 281 | .name = "stmp3xxx-rtc", |
| 275 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
| 283 | .of_match_table = rtc_dt_ids, | ||
| 276 | }, | 284 | }, |
| 277 | }; | 285 | }; |
| 278 | 286 | ||
