From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/5] rtc: omap: dt support
Date: Sun, 21 Oct 2012 21:51:27 +0200 [thread overview]
Message-ID: <5084523F.2070800@gmail.com> (raw)
In-Reply-To: <061c670b0a05570d7b83d8a8f105ee5b35583f7f.1350633036.git.afzal@ti.com>
On 19.10.2012 11:59, Afzal Mohammed wrote:
> enhance rtc-omap driver with DT capability
>
> Signed-off-by: Afzal Mohammed <afzal@ti.com>
> Acked-by: Sekhar Nori <nsekhar@ti.com>
> ---
>
> v4:
> Proper devicetree documentation
>
> v2:
> Use compatible as ti,da830-rtc instead of ti,am1808-rtc
>
> Documentation/devicetree/bindings/rtc/rtc-omap.txt | 17 +++++++++++++++++
> drivers/rtc/rtc-omap.c | 18 ++++++++++++++++++
> 2 files changed, 35 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/rtc/rtc-omap.txt
>
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
> new file mode 100644
> index 0000000..b47aa41
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
> @@ -0,0 +1,17 @@
> +TI Real Time Clock
> +
> +Required properties:
> +- compatible: "ti,da830-rtc"
> +- reg: Address range of rtc register set
> +- interrupts: rtc timer, alarm interrupts in order
> +- interrupt-parent: phandle for the interrupt controller
> +
> +Example:
> +
> +rtc at 1c23000 {
> + compatible = "ti,da830-rtc";
> + reg = <0x23000 0x1000>;
> + interrupts = <19
> + 19>;
> + interrupt-parent = <&intc>;
> +};
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index d948426..dff9ff4 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -20,6 +20,8 @@
> #include <linux/rtc.h>
> #include <linux/bcd.h>
> #include <linux/platform_device.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
>
> #include <asm/io.h>
>
> @@ -298,6 +300,8 @@ static struct rtc_class_ops omap_rtc_ops = {
> static int omap_rtc_alarm;
> static int omap_rtc_timer;
>
> +#define OMAP_RTC_DATA_DA830_IDX 1
> +
> static struct platform_device_id omap_rtc_devtype[] = {
> {
> .name = DRIVER_NAME,
> @@ -309,12 +313,25 @@ static struct platform_device_id omap_rtc_devtype[] = {
> };
> MODULE_DEVICE_TABLE(platform, omap_rtc_devtype);
>
> +static const struct of_device_id omap_rtc_of_match[] = {
> + { .compatible = "ti,da830-rtc",
> + .data = &omap_rtc_devtype[OMAP_RTC_DATA_DA830_IDX],
Wouldn't it make sense to list all the compatible models here? The
advantage of a compatible list is that we can name the models
explicitly, or maybe at least "davinci-rtc". Is there any reason for
this particular name?
Daniel
> + },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, omap_rtc_of_match);
> +
> static int __init omap_rtc_probe(struct platform_device *pdev)
> {
> struct resource *res, *mem;
> struct rtc_device *rtc;
> u8 reg, new_ctrl;
> const struct platform_device_id *id_entry;
> + const struct of_device_id *of_id;
> +
> + of_id = of_match_device(omap_rtc_of_match, &pdev->dev);
> + if (of_id)
> + pdev->id_entry = of_id->data;
>
> omap_rtc_timer = platform_get_irq(pdev, 0);
> if (omap_rtc_timer <= 0) {
> @@ -510,6 +527,7 @@ static struct platform_driver omap_rtc_driver = {
> .driver = {
> .name = DRIVER_NAME,
> .owner = THIS_MODULE,
> + .of_match_table = of_match_ptr(omap_rtc_of_match),
> },
> .id_table = omap_rtc_devtype,
> };
>
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Mack <zonque@gmail.com>
To: Afzal Mohammed <afzal@ti.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>, Sekhar Nori <nsekhar@ti.com>,
Kevin Hilman <khilman@ti.com>,
Russell King <linux@arm.linux.org.uk>,
Alessandro Zummo <a.zummo@towertech.it>,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
davinci-linux-open-source@linux.davincidsp.com,
linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com
Subject: Re: [PATCH v4 3/5] rtc: omap: dt support
Date: Sun, 21 Oct 2012 21:51:27 +0200 [thread overview]
Message-ID: <5084523F.2070800@gmail.com> (raw)
In-Reply-To: <061c670b0a05570d7b83d8a8f105ee5b35583f7f.1350633036.git.afzal@ti.com>
On 19.10.2012 11:59, Afzal Mohammed wrote:
> enhance rtc-omap driver with DT capability
>
> Signed-off-by: Afzal Mohammed <afzal@ti.com>
> Acked-by: Sekhar Nori <nsekhar@ti.com>
> ---
>
> v4:
> Proper devicetree documentation
>
> v2:
> Use compatible as ti,da830-rtc instead of ti,am1808-rtc
>
> Documentation/devicetree/bindings/rtc/rtc-omap.txt | 17 +++++++++++++++++
> drivers/rtc/rtc-omap.c | 18 ++++++++++++++++++
> 2 files changed, 35 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/rtc/rtc-omap.txt
>
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
> new file mode 100644
> index 0000000..b47aa41
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
> @@ -0,0 +1,17 @@
> +TI Real Time Clock
> +
> +Required properties:
> +- compatible: "ti,da830-rtc"
> +- reg: Address range of rtc register set
> +- interrupts: rtc timer, alarm interrupts in order
> +- interrupt-parent: phandle for the interrupt controller
> +
> +Example:
> +
> +rtc@1c23000 {
> + compatible = "ti,da830-rtc";
> + reg = <0x23000 0x1000>;
> + interrupts = <19
> + 19>;
> + interrupt-parent = <&intc>;
> +};
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index d948426..dff9ff4 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -20,6 +20,8 @@
> #include <linux/rtc.h>
> #include <linux/bcd.h>
> #include <linux/platform_device.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
>
> #include <asm/io.h>
>
> @@ -298,6 +300,8 @@ static struct rtc_class_ops omap_rtc_ops = {
> static int omap_rtc_alarm;
> static int omap_rtc_timer;
>
> +#define OMAP_RTC_DATA_DA830_IDX 1
> +
> static struct platform_device_id omap_rtc_devtype[] = {
> {
> .name = DRIVER_NAME,
> @@ -309,12 +313,25 @@ static struct platform_device_id omap_rtc_devtype[] = {
> };
> MODULE_DEVICE_TABLE(platform, omap_rtc_devtype);
>
> +static const struct of_device_id omap_rtc_of_match[] = {
> + { .compatible = "ti,da830-rtc",
> + .data = &omap_rtc_devtype[OMAP_RTC_DATA_DA830_IDX],
Wouldn't it make sense to list all the compatible models here? The
advantage of a compatible list is that we can name the models
explicitly, or maybe at least "davinci-rtc". Is there any reason for
this particular name?
Daniel
> + },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, omap_rtc_of_match);
> +
> static int __init omap_rtc_probe(struct platform_device *pdev)
> {
> struct resource *res, *mem;
> struct rtc_device *rtc;
> u8 reg, new_ctrl;
> const struct platform_device_id *id_entry;
> + const struct of_device_id *of_id;
> +
> + of_id = of_match_device(omap_rtc_of_match, &pdev->dev);
> + if (of_id)
> + pdev->id_entry = of_id->data;
>
> omap_rtc_timer = platform_get_irq(pdev, 0);
> if (omap_rtc_timer <= 0) {
> @@ -510,6 +527,7 @@ static struct platform_driver omap_rtc_driver = {
> .driver = {
> .name = DRIVER_NAME,
> .owner = THIS_MODULE,
> + .of_match_table = of_match_ptr(omap_rtc_of_match),
> },
> .id_table = omap_rtc_devtype,
> };
>
next prev parent reply other threads:[~2012-10-21 19:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-19 9:59 [PATCH v4 0/5] rtc: omap dt support (for am33xx) Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` [PATCH v4 1/5] rtc: omap: kicker mechanism support Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` [PATCH v4 2/5] ARM: davinci: remove rtc kicker release Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` [PATCH v4 3/5] rtc: omap: dt support Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-21 19:51 ` Daniel Mack [this message]
2012-10-21 19:51 ` Daniel Mack
2012-10-29 8:03 ` Afzal Mohammed
2012-10-29 8:03 ` Afzal Mohammed
2012-10-29 8:03 ` Afzal Mohammed
2012-10-19 9:59 ` [PATCH v4 4/5] rtc: omap: depend on am33xx Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` [PATCH v4 5/5] rtc: omap: Add runtime pm support Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
2012-10-19 9:59 ` Afzal Mohammed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5084523F.2070800@gmail.com \
--to=zonque@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.