Commit 0108c4ff authored by Viresh Kumar's avatar Viresh Kumar Committed by Linus Torvalds

rtc/spear: add Device Tree probing capability

SPEAr platforms now support DT and so must convert all drivers support DT.
This patch adds DT probing support for rtc and updates its documentation
too.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Cc: Rob Herring <robherring2@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7c203422
* SPEAr RTC
Required properties:
- compatible : "st,spear600-rtc"
- reg : Address range of the rtc registers
- interrupt-parent: Should be the phandle for the interrupt controller
that services interrupts for this device
- interrupt: Should contain the rtc interrupt number
Example:
rtc@fc000000 {
compatible = "st,spear600-rtc";
reg = <0xfc000000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <12>;
};
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/rtc.h> #include <linux/rtc.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -519,6 +520,14 @@ static void spear_rtc_shutdown(struct platform_device *pdev) ...@@ -519,6 +520,14 @@ static void spear_rtc_shutdown(struct platform_device *pdev)
clk_disable(config->clk); clk_disable(config->clk);
} }
#ifdef CONFIG_OF
static const struct of_device_id spear_rtc_id_table[] = {
{ .compatible = "st,spear600-rtc" },
{}
};
MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
#endif
static struct platform_driver spear_rtc_driver = { static struct platform_driver spear_rtc_driver = {
.probe = spear_rtc_probe, .probe = spear_rtc_probe,
.remove = __devexit_p(spear_rtc_remove), .remove = __devexit_p(spear_rtc_remove),
...@@ -527,6 +536,7 @@ static struct platform_driver spear_rtc_driver = { ...@@ -527,6 +536,7 @@ static struct platform_driver spear_rtc_driver = {
.shutdown = spear_rtc_shutdown, .shutdown = spear_rtc_shutdown,
.driver = { .driver = {
.name = "rtc-spear", .name = "rtc-spear",
.of_match_table = of_match_ptr(spear_rtc_id_table),
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment