All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc/spear: Add Device Tree probing capability
@ 2012-03-26  9:54 ` Viresh Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Viresh Kumar @ 2012-03-26  9:54 UTC (permalink / raw)
  To: akpm
  Cc: devicetree-discuss, rajeev-dlh.kumar, sr, linux-kernel,
	rtc-linux, a.zummo, spear-devel, viresh.linux, Viresh Kumar

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: Viresh Kumar <viresh.kumar@st.com>
---
 Documentation/devicetree/bindings/rtc/spear-rtc.txt |   18 ++++++++++++++++++
 drivers/rtc/rtc-spear.c                             |   10 ++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/spear-rtc.txt

diff --git a/Documentation/devicetree/bindings/rtc/spear-rtc.txt b/Documentation/devicetree/bindings/rtc/spear-rtc.txt
new file mode 100644
index 0000000..928410f
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/spear-rtc.txt
@@ -0,0 +1,18 @@
+* SPEAr RTC
+
+Required properties:
+- compatible : "st,spear-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,spear-rtc";
+		reg = <0xfc000000 0x1000>;
+		interrupt-parent = <&vic1>;
+		interrupts = <12>;
+	};
+
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index e38da0d..4a12fe5 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -16,6 +16,7 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/rtc.h>
 #include <linux/slab.h>
@@ -519,6 +520,14 @@ static void spear_rtc_shutdown(struct platform_device *pdev)
 	clk_disable(config->clk);
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id spear_rtc_id_table[] = {
+	{ .compatible = "st,spear-rtc" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
+#endif
+
 static struct platform_driver spear_rtc_driver = {
 	.probe = spear_rtc_probe,
 	.remove = __devexit_p(spear_rtc_remove),
@@ -527,6 +536,7 @@ static struct platform_driver spear_rtc_driver = {
 	.shutdown = spear_rtc_shutdown,
 	.driver = {
 		.name = "rtc-spear",
+		.of_match_table = of_match_ptr(spear_rtc_id_table),
 	},
 };
 
-- 
1.7.10.rc2.10.gb47606


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] rtc/spear: Add Device Tree probing capability
@ 2012-03-26  9:54 ` Viresh Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Viresh Kumar @ 2012-03-26  9:54 UTC (permalink / raw)
  To: akpm
  Cc: devicetree-discuss, rajeev-dlh.kumar, sr, linux-kernel,
	rtc-linux, a.zummo, spear-devel, viresh.linux, Viresh Kumar

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: Viresh Kumar <viresh.kumar@st.com>
---
 Documentation/devicetree/bindings/rtc/spear-rtc.txt |   18 ++++++++++++++++++
 drivers/rtc/rtc-spear.c                             |   10 ++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/spear-rtc.txt

diff --git a/Documentation/devicetree/bindings/rtc/spear-rtc.txt b/Documentation/devicetree/bindings/rtc/spear-rtc.txt
new file mode 100644
index 0000000..928410f
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/spear-rtc.txt
@@ -0,0 +1,18 @@
+* SPEAr RTC
+
+Required properties:
+- compatible : "st,spear-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,spear-rtc";
+		reg = <0xfc000000 0x1000>;
+		interrupt-parent = <&vic1>;
+		interrupts = <12>;
+	};
+
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index e38da0d..4a12fe5 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -16,6 +16,7 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/rtc.h>
 #include <linux/slab.h>
@@ -519,6 +520,14 @@ static void spear_rtc_shutdown(struct platform_device *pdev)
 	clk_disable(config->clk);
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id spear_rtc_id_table[] = {
+	{ .compatible = "st,spear-rtc" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
+#endif
+
 static struct platform_driver spear_rtc_driver = {
 	.probe = spear_rtc_probe,
 	.remove = __devexit_p(spear_rtc_remove),
@@ -527,6 +536,7 @@ static struct platform_driver spear_rtc_driver = {
 	.shutdown = spear_rtc_shutdown,
 	.driver = {
 		.name = "rtc-spear",
+		.of_match_table = of_match_ptr(spear_rtc_id_table),
 	},
 };
 
-- 
1.7.10.rc2.10.gb47606

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] rtc/spear: Add Device Tree probing capability
  2012-03-26  9:54 ` Viresh Kumar
  (?)
@ 2012-03-26 11:32 ` Stefan Roese
  2012-03-26 11:39     ` Viresh Kumar
  2012-03-26 12:36   ` Arnd Bergmann
  -1 siblings, 2 replies; 6+ messages in thread
From: Stefan Roese @ 2012-03-26 11:32 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: akpm, devicetree-discuss, rajeev-dlh.kumar, linux-kernel,
	rtc-linux, a.zummo, spear-devel, viresh.linux, Rob Herring

On Monday 26 March 2012 11:54:22 Viresh Kumar wrote:
> 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: Viresh Kumar <viresh.kumar@st.com>
> ---
>  Documentation/devicetree/bindings/rtc/spear-rtc.txt |   18
> ++++++++++++++++++ drivers/rtc/rtc-spear.c                             |  
> 10 ++++++++++ 2 files changed, 28 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rtc/spear-rtc.txt
> 
> diff --git a/Documentation/devicetree/bindings/rtc/spear-rtc.txt
> b/Documentation/devicetree/bindings/rtc/spear-rtc.txt new file mode 100644
> index 0000000..928410f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/spear-rtc.txt
> @@ -0,0 +1,18 @@
> +* SPEAr RTC
> +
> +Required properties:
> +- compatible : "st,spear-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,spear-rtc";

With Rob's comments in mind, wouldn't it be better to use a more specific 
compatible property? Should we stick with "st,spear600-rtc"? Or use "st-
spear300-rtc" as "oldest" SoC variant?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rtc/spear: Add Device Tree probing capability
@ 2012-03-26 11:39     ` Viresh Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Viresh Kumar @ 2012-03-26 11:39 UTC (permalink / raw)
  To: Stefan Roese
  Cc: akpm, devicetree-discuss, Rajeev KUMAR, linux-kernel, rtc-linux,
	a.zummo, spear-devel, viresh.linux, Rob Herring

On 3/26/2012 5:02 PM, Stefan Roese wrote:
>> > +	rtc@fc000000 {
>> > +		compatible = "st,spear-rtc";
> With Rob's comments in mind, wouldn't it be better to use a more specific 
> compatible property? Should we stick with "st,spear600-rtc"? Or use "st-
> spear300-rtc" as "oldest" SoC variant?

Can name it spear600-rtc then.

-- 
viresh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rtc/spear: Add Device Tree probing capability
@ 2012-03-26 11:39     ` Viresh Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Viresh Kumar @ 2012-03-26 11:39 UTC (permalink / raw)
  To: Stefan Roese
  Cc: a.zummo-BfzFCNDTiLLj+vYz1yj4TQ, Rajeev KUMAR,
	rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, spear-devel,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	viresh.linux-Re5JQEeQqe8AvxtiuMwx3w,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On 3/26/2012 5:02 PM, Stefan Roese wrote:
>> > +	rtc@fc000000 {
>> > +		compatible = "st,spear-rtc";
> With Rob's comments in mind, wouldn't it be better to use a more specific 
> compatible property? Should we stick with "st,spear600-rtc"? Or use "st-
> spear300-rtc" as "oldest" SoC variant?

Can name it spear600-rtc then.

-- 
viresh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rtc/spear: Add Device Tree probing capability
  2012-03-26 11:32 ` Stefan Roese
  2012-03-26 11:39     ` Viresh Kumar
@ 2012-03-26 12:36   ` Arnd Bergmann
  1 sibling, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2012-03-26 12:36 UTC (permalink / raw)
  To: Stefan Roese
  Cc: Viresh Kumar, akpm, devicetree-discuss, rajeev-dlh.kumar,
	linux-kernel, rtc-linux, a.zummo, spear-devel, viresh.linux,
	Rob Herring

On Monday 26 March 2012, Stefan Roese wrote:
> > diff --git a/Documentation/devicetree/bindings/rtc/spear-rtc.txt
> > b/Documentation/devicetree/bindings/rtc/spear-rtc.txt new file mode 100644
> > index 0000000..928410f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/spear-rtc.txt
> > @@ -0,0 +1,18 @@
> > +* SPEAr RTC
> > +
> > +Required properties:
> > +- compatible : "st,spear-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,spear-rtc";
> 
> With Rob's comments in mind, wouldn't it be better to use a more specific 
> compatible property? Should we stick with "st,spear600-rtc"? Or use "st-
> spear300-rtc" as "oldest" SoC variant?

I wouldn't mind if you list all three, or at least spear600 as the actual
chip and spear300 as the one that introduced the device. Of course, if the
device itself is licensed from some other vendor or was used in a prior product,
I would list that one.

	Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-26 12:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-26  9:54 [PATCH] rtc/spear: Add Device Tree probing capability Viresh Kumar
2012-03-26  9:54 ` Viresh Kumar
2012-03-26 11:32 ` Stefan Roese
2012-03-26 11:39   ` Viresh Kumar
2012-03-26 11:39     ` Viresh Kumar
2012-03-26 12:36   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.