Skip to contentSkip to conversation

MXS: Add DT binding support into stmp3xxx-rtc

PATCH New Marek Vasut 3 participants 4 messages May 27, 2012 – Jun 8, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MXS: Add DT binding support into stmp3xxx-rtc

Add simple binding for the stmp3xxx-rtc.

Cc Alessandro Zummo <[email protected]>
Cc devicetree-discuss at lists.ozlabs.org
Cc Grant Likely <[email protected]>
Cc Rob Herring <[email protected]>
Cc rtc-linux at googlegroups.com
Cc Shawn Guo <[email protected]>
---
 .../devicetree/bindings/rtc/stmp3xxx-rtc.txt       |   20 ++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi                       |    1 +
 drivers/rtc/rtc-stmp3xxx.c                         |    8 ++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +20 -0
new file mode 100644
index 0000000..a49dd52
@@ -0,0 +1,20 @@
+* STMP3xxx/i.MX28 Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
+    * "fsl,stmp3xxx-rtc"
+    * "fsl,imx28-rtc"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: Two interrupt numbers to the cpu should be specified. First
+  interrupt number is the rtc rick interupt and second interrupt number
+  is the rtc alarm interrupt. The number of cells representing a interrupt
+  depends on the parent interrupt controller.
+
+Example:
+
+	rtc at 80056000 {
+		compatible = "fsl,imx28-rtc";
+		reg = <0x80056000 2000>;
+		interrupts = <28 29>;
+	};
arch/arm/boot/dts/imx28.dtsi +1 -0
index d470276..119f183 100644
@@ -370,6 +370,7 @@
 			};
 
 			rtc at 80056000 {
+				compatible = "fsl,imx28-rtc";
 				reg = <0x80056000 2000>;
 				interrupts = <28 29>;
 				status = "disabled";
drivers/rtc/rtc-stmp3xxx.c +8 -0
index 1028786..dea9764 100644
@@ -25,6 +25,7 @@
 #include <linux/interrupt.h>
 #include <linux/rtc.h>
 #include <linux/slab.h>
+#include <linux/of_device.h>
 
 #include <mach/common.h>
 
@@ -265,6 +266,12 @@ static int stmp3xxx_rtc_resume(struct platform_device *dev)
 #define stmp3xxx_rtc_resume	NULL
 #endif
 
+static const struct of_device_id rtc_dt_ids[] = {
+	{ .compatible = "fsl,stmp3xxx-rtc", },
+	{ .compatible = "fsl,imx28-rtc", },
+	{ /* sentinel */ }
+};
+
 static struct platform_driver stmp3xxx_rtcdrv = {
 	.probe		= stmp3xxx_rtc_probe,
 	.remove		= stmp3xxx_rtc_remove,
@@ -273,6 +280,7 @@ static struct platform_driver stmp3xxx_rtcdrv = {
 	.driver		= {
 		.name	= "stmp3xxx-rtc",
 		.owner	= THIS_MODULE,
+		.of_match_table = rtc_dt_ids,
 	},
 };
 
Signature · 1 line
1.7.10
#1 lore raw

PATCH 1/1 MXS: Add DT binding support into stmp3xxx-rtc

Quoted 22 lines · Marek Vasut

Add simple binding for the stmp3xxx-rtc.

Cc Alessandro Zummo <[email protected]>
Cc devicetree-discuss at lists.ozlabs.org
Cc Grant Likely <[email protected]>
Cc Rob Herring <[email protected]>
Cc rtc-linux at googlegroups.com
Cc Shawn Guo <[email protected]>
---
 .../devicetree/bindings/rtc/stmp3xxx-rtc.txt       |   20 ++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi                       |    1 +
 drivers/rtc/rtc-stmp3xxx.c                         |    8 ++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +0 -0
new file mode 100644
index 0000000..a49dd52

Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +10 -0
@@ -0,0 +1,20 @@
+* STMP3xxx/i.MX28 Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
+    * "fsl,stmp3xxx-rtc"
+    * "fsl,imx28-rtc"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: Two interrupt numbers to the cpu should be specified. First
+  interrupt number is the rtc rick interupt and second interrupt number

s/rick/tick?

Quoted 35 lines
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +10 -0
+  is the rtc alarm interrupt. The number of cells representing a interrupt
+  depends on the parent interrupt controller.
+
+Example:
+
+	rtc at 80056000 {
+		compatible = "fsl,imx28-rtc";
+		reg = <0x80056000 2000>;
+		interrupts = <28 29>;
+	};
arch/arm/boot/dts/imx28.dtsi +1 -0
index d470276..119f183 100644
@@ -370,6 +370,7 @@
 			};
 
 			rtc at 80056000 {
+				compatible = "fsl,imx28-rtc";
 				reg = <0x80056000 2000>;
 				interrupts = <28 29>;
 				status = "disabled";
drivers/rtc/rtc-stmp3xxx.c +1 -0
index 1028786..dea9764 100644
@@ -25,6 +25,7 @@
 #include <linux/interrupt.h>
 #include <linux/rtc.h>
 #include <linux/slab.h>
+#include <linux/of_device.h>
 
 #include <mach/common.h>
 

drivers/rtc/rtc-stmp3xxx.c static int stmp3xxx_rtc_resume(struct platform_device *dev) · line 271

Quoted 6 lines
drivers/rtc/rtc-stmp3xxx.c +3 -0
@@ -265,6 +266,12 @@ static int stmp3xxx_rtc_resume(struct platform_device *dev)
 #define stmp3xxx_rtc_resume	NULL
 #endif
 
+static const struct of_device_id rtc_dt_ids[] = {
+	{ .compatible = "fsl,stmp3xxx-rtc", },
+	{ .compatible = "fsl,imx28-rtc", },

If we do not have any tweaking in the driver between stmp3xxx-rtc and imx28-rtc, that means imx28-rtc is compatible with stmp3xxx-rtc. That said, we only need stmp3xxx-rtc in this of_device_id table, and having the following line in imx28 dts will just work for imx28.

	compatible = "fsl,imx28-rtc", "stmp3xxx-rtc";

Regards,
Shawn

Quoted 17 lines
drivers/rtc/rtc-stmp3xxx.c +4 -0
+	{ /* sentinel */ }
+};
+
 static struct platform_driver stmp3xxx_rtcdrv = {
 	.probe		= stmp3xxx_rtc_probe,
 	.remove		= stmp3xxx_rtc_remove,
@@ -273,6 +280,7 @@ static struct platform_driver stmp3xxx_rtcdrv = {
 	.driver		= {
 		.name	= "stmp3xxx-rtc",
 		.owner	= THIS_MODULE,
+		.of_match_table = rtc_dt_ids,
 	},
 };
 
Signature · 1 line
1.7.10
#2 lore raw

PATCH 1/1 MXS: Add DT binding support into stmp3xxx-rtc

Hi,

Quoted 27 lines · Shawn Guo
Quoted 26 lines · Marek Vasut

Add simple binding for the stmp3xxx-rtc.

Cc Alessandro Zummo <[email protected]>
Cc devicetree-discuss at lists.ozlabs.org
Cc Grant Likely <[email protected]>
Cc Rob Herring <[email protected]>
Cc rtc-linux at googlegroups.com
Cc Shawn Guo <[email protected]>
---
 .../devicetree/bindings/rtc/stmp3xxx-rtc.txt       |   20 ++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi                       |    1 +
 drivers/rtc/rtc-stmp3xxx.c                         |    8 ++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +4 -0
new file mode 100644
index 0000000..a49dd52
@@ -0,0 +1,20 @@
+* STMP3xxx/i.MX28 Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
Quoted 9 lines

Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt line 10

Quoted 6 lines
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +6 -0
+    * "fsl,stmp3xxx-rtc"
+    * "fsl,imx28-rtc"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: Two interrupt numbers to the cpu should be specified. First
+  interrupt number is the rtc rick interupt and second interrupt number

s/rick/tick?

s/interupt/interrupt/

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
#3 lore raw

PATCH 1/1 MXS: Add DT binding support into stmp3xxx-rtc

Dear Lothar Wa?mann,

Quoted 44 lines

Hi,

Quoted 32 lines · Shawn Guo
Quoted 31 lines · Marek Vasut

Add simple binding for the stmp3xxx-rtc.

Cc Alessandro Zummo <[email protected]>
Cc devicetree-discuss at lists.ozlabs.org
Cc Grant Likely <[email protected]>
Cc Rob Herring <[email protected]>
Cc rtc-linux at googlegroups.com
Cc Shawn Guo <[email protected]>

---

 .../devicetree/bindings/rtc/stmp3xxx-rtc.txt       |   20
 ++++++++++++++++++++ arch/arm/boot/dts/imx28.dtsi                    
   |    1 +
 drivers/rtc/rtc-stmp3xxx.c                         |    8 ++++++++
 3 files changed, 29 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file mode 100644
index 0000000..a49dd52

Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +5 -0
@@ -0,0 +1,20 @@
+* STMP3xxx/i.MX28 Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
+    * "fsl,stmp3xxx-rtc"
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file +2 -0
+    * "fsl,imx28-rtc"
+- reg: physical base address of the controller and length of memory

mapped + region.

+- interrupts: Two interrupt numbers to the cpu should be specified.
First +  interrupt number is the rtc rick interupt and second

interrupt number

s/rick/tick?

Quoted 1 line

s/interupt/interrupt/

Heh, looks like I spik engrisch not ... :-)

Best regards,
Marek Vasut