diff options
-rw-r--r-- | Documentation/devicetree/bindings/rtc/spear-rtc.txt | 17 | ||||
-rw-r--r-- | drivers/rtc/rtc-spear.c | 10 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/rtc/spear-rtc.txt b/Documentation/devicetree/bindings/rtc/spear-rtc.txt new file mode 100644 index 000000000000..ca67ac62108e --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/spear-rtc.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * SPEAr RTC | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "st,spear600-rtc" | ||
5 | - reg : Address range of the rtc registers | ||
6 | - interrupt-parent: Should be the phandle for the interrupt controller | ||
7 | that services interrupts for this device | ||
8 | - interrupt: Should contain the rtc interrupt number | ||
9 | |||
10 | Example: | ||
11 | |||
12 | rtc@fc000000 { | ||
13 | compatible = "st,spear600-rtc"; | ||
14 | reg = <0xfc000000 0x1000>; | ||
15 | interrupt-parent = <&vic1>; | ||
16 | interrupts = <12>; | ||
17 | }; | ||
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index e38da0dc4187..1f76320e545b 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/of.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/rtc.h> | 21 | #include <linux/rtc.h> |
21 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
@@ -519,6 +520,14 @@ static void spear_rtc_shutdown(struct platform_device *pdev) | |||
519 | clk_disable(config->clk); | 520 | clk_disable(config->clk); |
520 | } | 521 | } |
521 | 522 | ||
523 | #ifdef CONFIG_OF | ||
524 | static const struct of_device_id spear_rtc_id_table[] = { | ||
525 | { .compatible = "st,spear600-rtc" }, | ||
526 | {} | ||
527 | }; | ||
528 | MODULE_DEVICE_TABLE(of, spear_rtc_id_table); | ||
529 | #endif | ||
530 | |||
522 | static struct platform_driver spear_rtc_driver = { | 531 | static struct platform_driver spear_rtc_driver = { |
523 | .probe = spear_rtc_probe, | 532 | .probe = spear_rtc_probe, |
524 | .remove = __devexit_p(spear_rtc_remove), | 533 | .remove = __devexit_p(spear_rtc_remove), |
@@ -527,6 +536,7 @@ static struct platform_driver spear_rtc_driver = { | |||
527 | .shutdown = spear_rtc_shutdown, | 536 | .shutdown = spear_rtc_shutdown, |
528 | .driver = { | 537 | .driver = { |
529 | .name = "rtc-spear", | 538 | .name = "rtc-spear", |
539 | .of_match_table = of_match_ptr(spear_rtc_id_table), | ||
530 | }, | 540 | }, |
531 | }; | 541 | }; |
532 | 542 | ||