* [PATCH] rtc: rtc-s3c: Add device tree support
@ 2011-09-03 15:49 ` Thomas Abraham
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Abraham @ 2011-09-03 15:49 UTC (permalink / raw)
To: rtc-linux
Cc: devicetree-discuss, grant.likely, linux-arm-kernel,
linux-samsung-soc, kgene.kim, ben-linux
Add device tree based discovery support for Samsung's rtc controller.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 20 ++++++++++++++++++++
drivers/rtc/rtc-s3c.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 1 deletions(-)
create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
new file mode 100644
index 0000000..90ec45f
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
@@ -0,0 +1,20 @@
+* Samsung's S3C Real Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
+ * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc.
+ * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 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 alarm interupt and second interrupt number
+ is the rtc tick interrupt. The number of cells representing a interrupt
+ depends on the parent interrupt controller.
+
+Example:
+
+ rtc@10070000 {
+ compatible = "samsung,s3c6410-rtc";
+ reg = <0x10070000 0x100>;
+ interrupts = <44 0 45 0>;
+ };
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 4e7c04e..29f928c 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -25,6 +25,7 @@
#include <linux/clk.h>
#include <linux/log2.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <mach/hardware.h>
#include <asm/uaccess.h>
@@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
goto err_nortc;
}
- s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
+#ifdef CONFIG_OF
+ if (pdev->dev.of_node)
+ s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
+ "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
+ else
+#endif
+ s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
/* Check RTC Time */
@@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
#define s3c_rtc_resume NULL
#endif
+#ifdef CONFIG_OF
+static const struct of_device_id s3c_rtc_dt_match[] = {
+ { .compatible = "samsung,s3c2410-rtc" },
+ { .compatible = "samsung,s3c6410-rtc" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
+#else
+#define s3c_rtc_dt_match NULL
+#endif
+
static struct platform_device_id s3c_rtc_driver_ids[] = {
{
.name = "s3c2410-rtc",
@@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
.driver = {
.name = "s3c-rtc",
.owner = THIS_MODULE,
+ .of_match_table = s3c_rtc_dt_match,
},
};
--
1.6.6.rc2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] rtc: rtc-s3c: Add device tree support
@ 2011-09-03 15:49 ` Thomas Abraham
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Abraham @ 2011-09-03 15:49 UTC (permalink / raw)
To: linux-arm-kernel
Add device tree based discovery support for Samsung's rtc controller.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 20 ++++++++++++++++++++
drivers/rtc/rtc-s3c.c | 21 ++++++++++++++++++++-
2 files changed, 40 insertions(+), 1 deletions(-)
create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
new file mode 100644
index 0000000..90ec45f
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
@@ -0,0 +1,20 @@
+* Samsung's S3C Real Time Clock controller
+
+Required properties:
+- compatible: should be one of the following.
+ * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc.
+ * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 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 alarm interupt and second interrupt number
+ is the rtc tick interrupt. The number of cells representing a interrupt
+ depends on the parent interrupt controller.
+
+Example:
+
+ rtc at 10070000 {
+ compatible = "samsung,s3c6410-rtc";
+ reg = <0x10070000 0x100>;
+ interrupts = <44 0 45 0>;
+ };
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 4e7c04e..29f928c 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -25,6 +25,7 @@
#include <linux/clk.h>
#include <linux/log2.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <mach/hardware.h>
#include <asm/uaccess.h>
@@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
goto err_nortc;
}
- s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
+#ifdef CONFIG_OF
+ if (pdev->dev.of_node)
+ s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
+ "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
+ else
+#endif
+ s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
/* Check RTC Time */
@@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
#define s3c_rtc_resume NULL
#endif
+#ifdef CONFIG_OF
+static const struct of_device_id s3c_rtc_dt_match[] = {
+ { .compatible = "samsung,s3c2410-rtc" },
+ { .compatible = "samsung,s3c6410-rtc" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
+#else
+#define s3c_rtc_dt_match NULL
+#endif
+
static struct platform_device_id s3c_rtc_driver_ids[] = {
{
.name = "s3c2410-rtc",
@@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
.driver = {
.name = "s3c-rtc",
.owner = THIS_MODULE,
+ .of_match_table = s3c_rtc_dt_match,
},
};
--
1.6.6.rc2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] rtc: rtc-s3c: Add device tree support
2011-09-03 15:49 ` Thomas Abraham
@ 2011-10-11 7:05 ` Thomas Abraham
-1 siblings, 0 replies; 10+ messages in thread
From: Thomas Abraham @ 2011-10-11 7:05 UTC (permalink / raw)
To: rtc-linux
Cc: devicetree-discuss, grant.likely, linux-arm-kernel,
linux-samsung-soc, kgene.kim, ben-linux
On 3 September 2011 21:19, Thomas Abraham <thomas.abraham@linaro.org> wrote:
> Add device tree based discovery support for Samsung's rtc controller.
>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 20 ++++++++++++++++++++
> drivers/rtc/rtc-s3c.c | 21 ++++++++++++++++++++-
> 2 files changed, 40 insertions(+), 1 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
Ping. Any comments for this patch? If this looks fine, can this be
considered for 3.2 merge via the Samsung kernel tree.
Thanks,
Thomas.
>
> diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> new file mode 100644
> index 0000000..90ec45f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> @@ -0,0 +1,20 @@
> +* Samsung's S3C Real Time Clock controller
> +
> +Required properties:
> +- compatible: should be one of the following.
> + * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc.
> + * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 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 alarm interupt and second interrupt number
> + is the rtc tick interrupt. The number of cells representing a interrupt
> + depends on the parent interrupt controller.
> +
> +Example:
> +
> + rtc@10070000 {
> + compatible = "samsung,s3c6410-rtc";
> + reg = <0x10070000 0x100>;
> + interrupts = <44 0 45 0>;
> + };
> diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> index 4e7c04e..29f928c 100644
> --- a/drivers/rtc/rtc-s3c.c
> +++ b/drivers/rtc/rtc-s3c.c
> @@ -25,6 +25,7 @@
> #include <linux/clk.h>
> #include <linux/log2.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
>
> #include <mach/hardware.h>
> #include <asm/uaccess.h>
> @@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
> goto err_nortc;
> }
>
> - s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> +#ifdef CONFIG_OF
> + if (pdev->dev.of_node)
> + s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
> + "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
> + else
> +#endif
> + s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
>
> /* Check RTC Time */
>
> @@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
> #define s3c_rtc_resume NULL
> #endif
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id s3c_rtc_dt_match[] = {
> + { .compatible = "samsung,s3c2410-rtc" },
> + { .compatible = "samsung,s3c6410-rtc" },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
> +#else
> +#define s3c_rtc_dt_match NULL
> +#endif
> +
> static struct platform_device_id s3c_rtc_driver_ids[] = {
> {
> .name = "s3c2410-rtc",
> @@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
> .driver = {
> .name = "s3c-rtc",
> .owner = THIS_MODULE,
> + .of_match_table = s3c_rtc_dt_match,
> },
> };
>
> --
> 1.6.6.rc2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] rtc: rtc-s3c: Add device tree support
@ 2011-10-11 7:05 ` Thomas Abraham
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Abraham @ 2011-10-11 7:05 UTC (permalink / raw)
To: linux-arm-kernel
On 3 September 2011 21:19, Thomas Abraham <thomas.abraham@linaro.org> wrote:
> Add device tree based discovery support for Samsung's rtc controller.
>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> ?Documentation/devicetree/bindings/rtc/s3c-rtc.txt | ? 20 ++++++++++++++++++++
> ?drivers/rtc/rtc-s3c.c ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? 21 ++++++++++++++++++++-
> ?2 files changed, 40 insertions(+), 1 deletions(-)
> ?create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
Ping. Any comments for this patch? If this looks fine, can this be
considered for 3.2 merge via the Samsung kernel tree.
Thanks,
Thomas.
>
> diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> new file mode 100644
> index 0000000..90ec45f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> @@ -0,0 +1,20 @@
> +* Samsung's S3C Real Time Clock controller
> +
> +Required properties:
> +- compatible: should be one of the following.
> + ? ?* "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc.
> + ? ?* "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 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 alarm interupt and second interrupt number
> + ?is the rtc tick interrupt. The number of cells representing a interrupt
> + ?depends on the parent interrupt controller.
> +
> +Example:
> +
> + ? ? ? rtc at 10070000 {
> + ? ? ? ? ? ? ? compatible = "samsung,s3c6410-rtc";
> + ? ? ? ? ? ? ? reg = <0x10070000 0x100>;
> + ? ? ? ? ? ? ? interrupts = <44 0 45 0>;
> + ? ? ? };
> diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> index 4e7c04e..29f928c 100644
> --- a/drivers/rtc/rtc-s3c.c
> +++ b/drivers/rtc/rtc-s3c.c
> @@ -25,6 +25,7 @@
> ?#include <linux/clk.h>
> ?#include <linux/log2.h>
> ?#include <linux/slab.h>
> +#include <linux/of.h>
>
> ?#include <mach/hardware.h>
> ?#include <asm/uaccess.h>
> @@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
> ? ? ? ? ? ? ? ?goto err_nortc;
> ? ? ? ?}
>
> - ? ? ? s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> +#ifdef CONFIG_OF
> + ? ? ? if (pdev->dev.of_node)
> + ? ? ? ? ? ? ? s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
> + ? ? ? ? ? ? ? ? ? ? ? "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
> + ? ? ? else
> +#endif
> + ? ? ? ? ? ? ? s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
>
> ? ? ? ?/* Check RTC Time */
>
> @@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
> ?#define s3c_rtc_resume ?NULL
> ?#endif
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id s3c_rtc_dt_match[] = {
> + ? ? ? { .compatible = "samsung,s3c2410-rtc" },
> + ? ? ? { .compatible = "samsung,s3c6410-rtc" },
> + ? ? ? {},
> +};
> +MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
> +#else
> +#define s3c_rtc_dt_match NULL
> +#endif
> +
> ?static struct platform_device_id s3c_rtc_driver_ids[] = {
> ? ? ? ?{
> ? ? ? ? ? ? ? ?.name ? ? ? ? ? = "s3c2410-rtc",
> @@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
> ? ? ? ?.driver ? ? ? ? = {
> ? ? ? ? ? ? ? ?.name ? = "s3c-rtc",
> ? ? ? ? ? ? ? ?.owner ?= THIS_MODULE,
> + ? ? ? ? ? ? ? .of_match_table = s3c_rtc_dt_match,
> ? ? ? ?},
> ?};
>
> --
> 1.6.6.rc2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH] rtc: rtc-s3c: Add device tree support
2011-10-11 7:05 ` Thomas Abraham
@ 2011-10-11 10:48 ` Kukjin Kim
-1 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2011-10-11 10:48 UTC (permalink / raw)
To: 'Thomas Abraham', rtc-linux
Cc: devicetree-discuss, grant.likely, linux-arm-kernel,
linux-samsung-soc, ben-linux, a.zummo
Thomas Abraham wrote:
>
> On 3 September 2011 21:19, Thomas Abraham <thomas.abraham@linaro.org>
> wrote:
> > Add device tree based discovery support for Samsung's rtc controller.
> >
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> > ---
> > Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 20
> ++++++++++++++++++++
> > drivers/rtc/rtc-s3c.c | 21
> ++++++++++++++++++++-
> > 2 files changed, 40 insertions(+), 1 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
>
> Ping. Any comments for this patch? If this looks fine, can this be
> considered for 3.2 merge via the Samsung kernel tree.
>
(Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)
I'm ok with this, so if this can be got the ack from Grant and Alessandro,
will take this.
> >
> > diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > new file mode 100644
> > index 0000000..90ec45f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > @@ -0,0 +1,20 @@
> > +* Samsung's S3C Real Time Clock controller
> > +
> > +Required properties:
> > +- compatible: should be one of the following.
> > + * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410
rtc.
> > + * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410
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 alarm interupt and second interrupt
number
> > + is the rtc tick interrupt. The number of cells representing a
interrupt
> > + depends on the parent interrupt controller.
> > +
> > +Example:
> > +
> > + rtc@10070000 {
> > + compatible = "samsung,s3c6410-rtc";
> > + reg = <0x10070000 0x100>;
> > + interrupts = <44 0 45 0>;
> > + };
> > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> > index 4e7c04e..29f928c 100644
> > --- a/drivers/rtc/rtc-s3c.c
> > +++ b/drivers/rtc/rtc-s3c.c
> > @@ -25,6 +25,7 @@
> > #include <linux/clk.h>
> > #include <linux/log2.h>
> > #include <linux/slab.h>
> > +#include <linux/of.h>
> >
> > #include <mach/hardware.h>
> > #include <asm/uaccess.h>
> > @@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct
> platform_device *pdev)
> > goto err_nortc;
> > }
> >
> > - s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> > +#ifdef CONFIG_OF
> > + if (pdev->dev.of_node)
> > + s3c_rtc_cpu_type = of_device_is_compatible(pdev-
> >dev.of_node,
> > + "samsung,s3c6410-rtc") ? TYPE_S3C64XX :
> TYPE_S3C2410;
> > + else
> > +#endif
> > + s3c_rtc_cpu_type =
platform_get_device_id(pdev)->driver_data;
> >
> > /* Check RTC Time */
> >
> > @@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device
*pdev)
> > #define s3c_rtc_resume NULL
> > #endif
> >
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id s3c_rtc_dt_match[] = {
> > + { .compatible = "samsung,s3c2410-rtc" },
^^^^^^^
> > + { .compatible = "samsung,s3c6410-rtc" },
^^^^^^^
> > + {},
^^^^^^^
should be Tab?
> > +};
> > +MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
> > +#else
> > +#define s3c_rtc_dt_match NULL
> > +#endif
> > +
> > static struct platform_device_id s3c_rtc_driver_ids[] = {
> > {
> > .name = "s3c2410-rtc",
> > @@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
> > .driver = {
> > .name = "s3c-rtc",
> > .owner = THIS_MODULE,
> > + .of_match_table = s3c_rtc_dt_match,
^^^^^^^^^^^^^^^
Same as above...
But I know, Thomas' original patch has no problem...probably when ping,
happened above.
> > },
> > };
> >
> > --
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] rtc: rtc-s3c: Add device tree support
@ 2011-10-11 10:48 ` Kukjin Kim
0 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2011-10-11 10:48 UTC (permalink / raw)
To: linux-arm-kernel
Thomas Abraham wrote:
>
> On 3 September 2011 21:19, Thomas Abraham <thomas.abraham@linaro.org>
> wrote:
> > Add device tree based discovery support for Samsung's rtc controller.
> >
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> > ---
> > ?Documentation/devicetree/bindings/rtc/s3c-rtc.txt | ? 20
> ++++++++++++++++++++
> > ?drivers/rtc/rtc-s3c.c ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? 21
> ++++++++++++++++++++-
> > ?2 files changed, 40 insertions(+), 1 deletions(-)
> > ?create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
>
> Ping. Any comments for this patch? If this looks fine, can this be
> considered for 3.2 merge via the Samsung kernel tree.
>
(Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)
I'm ok with this, so if this can be got the ack from Grant and Alessandro,
will take this.
> >
> > diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > new file mode 100644
> > index 0000000..90ec45f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > @@ -0,0 +1,20 @@
> > +* Samsung's S3C Real Time Clock controller
> > +
> > +Required properties:
> > +- compatible: should be one of the following.
> > + ? ?* "samsung,s3c2410-rtc" - for controllers compatible with s3c2410
rtc.
> > + ? ?* "samsung,s3c6410-rtc" - for controllers compatible with s3c6410
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 alarm interupt and second interrupt
number
> > + ?is the rtc tick interrupt. The number of cells representing a
interrupt
> > + ?depends on the parent interrupt controller.
> > +
> > +Example:
> > +
> > + ? ? ? rtc at 10070000 {
> > + ? ? ? ? ? ? ? compatible = "samsung,s3c6410-rtc";
> > + ? ? ? ? ? ? ? reg = <0x10070000 0x100>;
> > + ? ? ? ? ? ? ? interrupts = <44 0 45 0>;
> > + ? ? ? };
> > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> > index 4e7c04e..29f928c 100644
> > --- a/drivers/rtc/rtc-s3c.c
> > +++ b/drivers/rtc/rtc-s3c.c
> > @@ -25,6 +25,7 @@
> > ?#include <linux/clk.h>
> > ?#include <linux/log2.h>
> > ?#include <linux/slab.h>
> > +#include <linux/of.h>
> >
> > ?#include <mach/hardware.h>
> > ?#include <asm/uaccess.h>
> > @@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct
> platform_device *pdev)
> > ? ? ? ? ? ? ? ?goto err_nortc;
> > ? ? ? ?}
> >
> > - ? ? ? s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> > +#ifdef CONFIG_OF
> > + ? ? ? if (pdev->dev.of_node)
> > + ? ? ? ? ? ? ? s3c_rtc_cpu_type = of_device_is_compatible(pdev-
> >dev.of_node,
> > + ? ? ? ? ? ? ? ? ? ? ? "samsung,s3c6410-rtc") ? TYPE_S3C64XX :
> TYPE_S3C2410;
> > + ? ? ? else
> > +#endif
> > + ? ? ? ? ? ? ? s3c_rtc_cpu_type =
platform_get_device_id(pdev)->driver_data;
> >
> > ? ? ? ?/* Check RTC Time */
> >
> > @@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device
*pdev)
> > ?#define s3c_rtc_resume ?NULL
> > ?#endif
> >
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id s3c_rtc_dt_match[] = {
> > + { .compatible = "samsung,s3c2410-rtc" },
^^^^^^^
> > + { .compatible = "samsung,s3c6410-rtc" },
^^^^^^^
> > + {},
^^^^^^^
should be Tab?
> > +};
> > +MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
> > +#else
> > +#define s3c_rtc_dt_match NULL
> > +#endif
> > +
> > ?static struct platform_device_id s3c_rtc_driver_ids[] = {
> > ? ? ? ?{
> > ? ? ? ? ? ? ? ?.name ? ? ? ? ? = "s3c2410-rtc",
> > @@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
> > ? ? ? ?.driver ? ? ? ? = {
> > ? ? ? ? ? ? ? ?.name ? = "s3c-rtc",
> > ? ? ? ? ? ? ? ?.owner ?= THIS_MODULE,
> > + .of_match_table = s3c_rtc_dt_match,
^^^^^^^^^^^^^^^
Same as above...
But I know, Thomas' original patch has no problem...probably when ping,
happened above.
> > ? ? ? ?},
> > ?};
> >
> > --
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rtc: rtc-s3c: Add device tree support
2011-10-11 10:48 ` Kukjin Kim
@ 2011-10-13 19:34 ` Grant Likely
-1 siblings, 0 replies; 10+ messages in thread
From: Grant Likely @ 2011-10-13 19:34 UTC (permalink / raw)
To: Kukjin Kim
Cc: 'Thomas Abraham',
rtc-linux, devicetree-discuss, linux-arm-kernel,
linux-samsung-soc, ben-linux, a.zummo
On Tue, Oct 11, 2011 at 07:48:07PM +0900, Kukjin Kim wrote:
> Thomas Abraham wrote:
> >
> > On 3 September 2011 21:19, Thomas Abraham <thomas.abraham@linaro.org>
> > wrote:
> > > Add device tree based discovery support for Samsung's rtc controller.
> > >
> > > Cc: Ben Dooks <ben-linux@fluff.org>
> > > Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> > > ---
> > > Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 20
> > ++++++++++++++++++++
> > > drivers/rtc/rtc-s3c.c | 21
> > ++++++++++++++++++++-
> > > 2 files changed, 40 insertions(+), 1 deletions(-)
> > > create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> >
> > Ping. Any comments for this patch? If this looks fine, can this be
> > considered for 3.2 merge via the Samsung kernel tree.
> >
> (Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)
>
> I'm ok with this, so if this can be got the ack from Grant and Alessandro,
> will take this.
Acked-by: Grant Likely <grant.likely@secretlab.ca>
>
> > >
> > > diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > > new file mode 100644
> > > index 0000000..90ec45f
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > > @@ -0,0 +1,20 @@
> > > +* Samsung's S3C Real Time Clock controller
> > > +
> > > +Required properties:
> > > +- compatible: should be one of the following.
> > > + * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410
> rtc.
> > > + * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410
> 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 alarm interupt and second interrupt
> number
> > > + is the rtc tick interrupt. The number of cells representing a
> interrupt
> > > + depends on the parent interrupt controller.
> > > +
> > > +Example:
> > > +
> > > + rtc@10070000 {
> > > + compatible = "samsung,s3c6410-rtc";
> > > + reg = <0x10070000 0x100>;
> > > + interrupts = <44 0 45 0>;
> > > + };
> > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> > > index 4e7c04e..29f928c 100644
> > > --- a/drivers/rtc/rtc-s3c.c
> > > +++ b/drivers/rtc/rtc-s3c.c
> > > @@ -25,6 +25,7 @@
> > > #include <linux/clk.h>
> > > #include <linux/log2.h>
> > > #include <linux/slab.h>
> > > +#include <linux/of.h>
> > >
> > > #include <mach/hardware.h>
> > > #include <asm/uaccess.h>
> > > @@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct
> > platform_device *pdev)
> > > goto err_nortc;
> > > }
> > >
> > > - s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> > > +#ifdef CONFIG_OF
> > > + if (pdev->dev.of_node)
> > > + s3c_rtc_cpu_type = of_device_is_compatible(pdev-
> > >dev.of_node,
> > > + "samsung,s3c6410-rtc") ? TYPE_S3C64XX :
> > TYPE_S3C2410;
> > > + else
> > > +#endif
> > > + s3c_rtc_cpu_type =
> platform_get_device_id(pdev)->driver_data;
> > >
> > > /* Check RTC Time */
> > >
> > > @@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device
> *pdev)
> > > #define s3c_rtc_resume NULL
> > > #endif
> > >
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id s3c_rtc_dt_match[] = {
> > > + { .compatible = "samsung,s3c2410-rtc" },
> ^^^^^^^
> > > + { .compatible = "samsung,s3c6410-rtc" },
> ^^^^^^^
> > > + {},
> ^^^^^^^
> should be Tab?
>
> > > +};
> > > +MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
> > > +#else
> > > +#define s3c_rtc_dt_match NULL
> > > +#endif
> > > +
> > > static struct platform_device_id s3c_rtc_driver_ids[] = {
> > > {
> > > .name = "s3c2410-rtc",
> > > @@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
> > > .driver = {
> > > .name = "s3c-rtc",
> > > .owner = THIS_MODULE,
> > > + .of_match_table = s3c_rtc_dt_match,
> ^^^^^^^^^^^^^^^
> Same as above...
>
> But I know, Thomas' original patch has no problem...probably when ping,
> happened above.
>
> > > },
> > > };
> > >
> > > --
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] rtc: rtc-s3c: Add device tree support
@ 2011-10-13 19:34 ` Grant Likely
0 siblings, 0 replies; 10+ messages in thread
From: Grant Likely @ 2011-10-13 19:34 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 11, 2011 at 07:48:07PM +0900, Kukjin Kim wrote:
> Thomas Abraham wrote:
> >
> > On 3 September 2011 21:19, Thomas Abraham <thomas.abraham@linaro.org>
> > wrote:
> > > Add device tree based discovery support for Samsung's rtc controller.
> > >
> > > Cc: Ben Dooks <ben-linux@fluff.org>
> > > Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> > > ---
> > > ?Documentation/devicetree/bindings/rtc/s3c-rtc.txt | ? 20
> > ++++++++++++++++++++
> > > ?drivers/rtc/rtc-s3c.c ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? 21
> > ++++++++++++++++++++-
> > > ?2 files changed, 40 insertions(+), 1 deletions(-)
> > > ?create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> >
> > Ping. Any comments for this patch? If this looks fine, can this be
> > considered for 3.2 merge via the Samsung kernel tree.
> >
> (Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)
>
> I'm ok with this, so if this can be got the ack from Grant and Alessandro,
> will take this.
Acked-by: Grant Likely <grant.likely@secretlab.ca>
>
> > >
> > > diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > > new file mode 100644
> > > index 0000000..90ec45f
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt
> > > @@ -0,0 +1,20 @@
> > > +* Samsung's S3C Real Time Clock controller
> > > +
> > > +Required properties:
> > > +- compatible: should be one of the following.
> > > + ? ?* "samsung,s3c2410-rtc" - for controllers compatible with s3c2410
> rtc.
> > > + ? ?* "samsung,s3c6410-rtc" - for controllers compatible with s3c6410
> 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 alarm interupt and second interrupt
> number
> > > + ?is the rtc tick interrupt. The number of cells representing a
> interrupt
> > > + ?depends on the parent interrupt controller.
> > > +
> > > +Example:
> > > +
> > > + ? ? ? rtc at 10070000 {
> > > + ? ? ? ? ? ? ? compatible = "samsung,s3c6410-rtc";
> > > + ? ? ? ? ? ? ? reg = <0x10070000 0x100>;
> > > + ? ? ? ? ? ? ? interrupts = <44 0 45 0>;
> > > + ? ? ? };
> > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> > > index 4e7c04e..29f928c 100644
> > > --- a/drivers/rtc/rtc-s3c.c
> > > +++ b/drivers/rtc/rtc-s3c.c
> > > @@ -25,6 +25,7 @@
> > > ?#include <linux/clk.h>
> > > ?#include <linux/log2.h>
> > > ?#include <linux/slab.h>
> > > +#include <linux/of.h>
> > >
> > > ?#include <mach/hardware.h>
> > > ?#include <asm/uaccess.h>
> > > @@ -481,7 +482,13 @@ static int __devinit s3c_rtc_probe(struct
> > platform_device *pdev)
> > > ? ? ? ? ? ? ? ?goto err_nortc;
> > > ? ? ? ?}
> > >
> > > - ? ? ? s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> > > +#ifdef CONFIG_OF
> > > + ? ? ? if (pdev->dev.of_node)
> > > + ? ? ? ? ? ? ? s3c_rtc_cpu_type = of_device_is_compatible(pdev-
> > >dev.of_node,
> > > + ? ? ? ? ? ? ? ? ? ? ? "samsung,s3c6410-rtc") ? TYPE_S3C64XX :
> > TYPE_S3C2410;
> > > + ? ? ? else
> > > +#endif
> > > + ? ? ? ? ? ? ? s3c_rtc_cpu_type =
> platform_get_device_id(pdev)->driver_data;
> > >
> > > ? ? ? ?/* Check RTC Time */
> > >
> > > @@ -603,6 +610,17 @@ static int s3c_rtc_resume(struct platform_device
> *pdev)
> > > ?#define s3c_rtc_resume ?NULL
> > > ?#endif
> > >
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id s3c_rtc_dt_match[] = {
> > > + { .compatible = "samsung,s3c2410-rtc" },
> ^^^^^^^
> > > + { .compatible = "samsung,s3c6410-rtc" },
> ^^^^^^^
> > > + {},
> ^^^^^^^
> should be Tab?
>
> > > +};
> > > +MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
> > > +#else
> > > +#define s3c_rtc_dt_match NULL
> > > +#endif
> > > +
> > > ?static struct platform_device_id s3c_rtc_driver_ids[] = {
> > > ? ? ? ?{
> > > ? ? ? ? ? ? ? ?.name ? ? ? ? ? = "s3c2410-rtc",
> > > @@ -625,6 +643,7 @@ static struct platform_driver s3c_rtc_driver = {
> > > ? ? ? ?.driver ? ? ? ? = {
> > > ? ? ? ? ? ? ? ?.name ? = "s3c-rtc",
> > > ? ? ? ? ? ? ? ?.owner ?= THIS_MODULE,
> > > + .of_match_table = s3c_rtc_dt_match,
> ^^^^^^^^^^^^^^^
> Same as above...
>
> But I know, Thomas' original patch has no problem...probably when ping,
> happened above.
>
> > > ? ? ? ?},
> > > ?};
> > >
> > > --
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rtc: rtc-s3c: Add device tree support
2011-10-13 19:34 ` Grant Likely
@ 2011-10-24 12:54 ` Kukjin Kim
-1 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2011-10-24 12:54 UTC (permalink / raw)
To: Grant Likely
Cc: Kukjin Kim, 'Thomas Abraham',
rtc-linux, devicetree-discuss, linux-arm-kernel,
linux-samsung-soc, ben-linux, a.zummo
On 10/13/11 21:34, Grant Likely wrote:
> On Tue, Oct 11, 2011 at 07:48:07PM +0900, Kukjin Kim wrote:
>> Thomas Abraham wrote:
>>>
>>> On 3 September 2011 21:19, Thomas Abraham<thomas.abraham@linaro.org>
>>> wrote:
>>>> Add device tree based discovery support for Samsung's rtc controller.
>>>>
>>>> Cc: Ben Dooks<ben-linux@fluff.org>
>>>> Signed-off-by: Thomas Abraham<thomas.abraham@linaro.org>
>>>> ---
>>>> Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 20
>>> ++++++++++++++++++++
>>>> drivers/rtc/rtc-s3c.c | 21
>>> ++++++++++++++++++++-
>>>> 2 files changed, 40 insertions(+), 1 deletions(-)
>>>> create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
>>>
>>> Ping. Any comments for this patch? If this looks fine, can this be
>>> considered for 3.2 merge via the Samsung kernel tree.
>>>
>> (Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)
>>
>> I'm ok with this, so if this can be got the ack from Grant and Alessandro,
>> will take this.
>
> Acked-by: Grant Likely<grant.likely@secretlab.ca>
Hi Alessandro,
Applied this in Samsung tree for supporting device tree for upcoming 3.2
merge window.
If any problems, please let me know before sending to upstream.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] rtc: rtc-s3c: Add device tree support
@ 2011-10-24 12:54 ` Kukjin Kim
0 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2011-10-24 12:54 UTC (permalink / raw)
To: linux-arm-kernel
On 10/13/11 21:34, Grant Likely wrote:
> On Tue, Oct 11, 2011 at 07:48:07PM +0900, Kukjin Kim wrote:
>> Thomas Abraham wrote:
>>>
>>> On 3 September 2011 21:19, Thomas Abraham<thomas.abraham@linaro.org>
>>> wrote:
>>>> Add device tree based discovery support for Samsung's rtc controller.
>>>>
>>>> Cc: Ben Dooks<ben-linux@fluff.org>
>>>> Signed-off-by: Thomas Abraham<thomas.abraham@linaro.org>
>>>> ---
>>>> Documentation/devicetree/bindings/rtc/s3c-rtc.txt | 20
>>> ++++++++++++++++++++
>>>> drivers/rtc/rtc-s3c.c | 21
>>> ++++++++++++++++++++-
>>>> 2 files changed, 40 insertions(+), 1 deletions(-)
>>>> create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt
>>>
>>> Ping. Any comments for this patch? If this looks fine, can this be
>>> considered for 3.2 merge via the Samsung kernel tree.
>>>
>> (Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)
>>
>> I'm ok with this, so if this can be got the ack from Grant and Alessandro,
>> will take this.
>
> Acked-by: Grant Likely<grant.likely@secretlab.ca>
Hi Alessandro,
Applied this in Samsung tree for supporting device tree for upcoming 3.2
merge window.
If any problems, please let me know before sending to upstream.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-10-24 12:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-03 15:49 [PATCH] rtc: rtc-s3c: Add device tree support Thomas Abraham
2011-09-03 15:49 ` Thomas Abraham
2011-10-11 7:05 ` Thomas Abraham
2011-10-11 7:05 ` Thomas Abraham
2011-10-11 10:48 ` Kukjin Kim
2011-10-11 10:48 ` Kukjin Kim
2011-10-13 19:34 ` Grant Likely
2011-10-13 19:34 ` Grant Likely
2011-10-24 12:54 ` Kukjin Kim
2011-10-24 12:54 ` Kukjin Kim
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.