From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Philippe Reynes <tremyfr@gmail.com>
Cc: a.zummo@towertech.it, shawn.guo@linaro.org,
kernel@pengutronix.de, linux@arm.linux.org.uk,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com
Subject: Re: [rtc-linux] [PATCH v4 4/7] rtc: mxc: add support of device tree
Date: Tue, 14 Jul 2015 23:52:41 +0200 [thread overview]
Message-ID: <20150714215241.GB24706@piout.net> (raw)
In-Reply-To: <1435965320-1478-5-git-send-email-tremyfr@gmail.com>
On 04/07/2015 at 01:15:17 +0200, Philippe Reynes wrote :
> Add device tree support for the mxc rtc driver.
>
> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
That patch should go after 5/7 to avoid a checkpatch warning.
> ---
> drivers/rtc/rtc-mxc.c | 19 ++++++++++++++++++-
> 1 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
> index 4ce7e21..4191a87 100644
> --- a/drivers/rtc/rtc-mxc.c
> +++ b/drivers/rtc/rtc-mxc.c
> @@ -16,6 +16,8 @@
> #include <linux/interrupt.h>
> #include <linux/platform_device.h>
> #include <linux/clk.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
>
> #define RTC_INPUT_CLK_32768HZ (0x00 << 5)
> #define RTC_INPUT_CLK_32000HZ (0x01 << 5)
> @@ -98,6 +100,15 @@ static const struct platform_device_id imx_rtc_devtype[] = {
> };
> MODULE_DEVICE_TABLE(platform, imx_rtc_devtype);
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id imx_rtc_dt_ids[] = {
> + { .compatible = "fsl,imx1-rtc", .data = (const void *)IMX1_RTC },
> + { .compatible = "fsl,imx21-rtc", .data = (const void *)IMX21_RTC },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, imx_rtc_dt_ids);
> +#endif
> +
> static inline int is_imx1_rtc(struct rtc_plat_data *data)
> {
> return data->devtype == IMX1_RTC;
> @@ -362,12 +373,17 @@ static int mxc_rtc_probe(struct platform_device *pdev)
> u32 reg;
> unsigned long rate;
> int ret;
> + const struct of_device_id *of_id;
>
> pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
> if (!pdata)
> return -ENOMEM;
>
> - pdata->devtype = pdev->id_entry->driver_data;
> + of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev);
> + if (of_id)
> + pdata->devtype = (enum imx_rtc_type)of_id->data;
> + else
> + pdata->devtype = pdev->id_entry->driver_data;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res);
> @@ -488,6 +504,7 @@ static SIMPLE_DEV_PM_OPS(mxc_rtc_pm_ops, mxc_rtc_suspend, mxc_rtc_resume);
> static struct platform_driver mxc_rtc_driver = {
> .driver = {
> .name = "mxc_rtc",
> + .of_match_table = of_match_ptr(imx_rtc_dt_ids),
> .pm = &mxc_rtc_pm_ops,
> },
> .id_table = imx_rtc_devtype,
> --
> 1.7.4.4
>
> --
> --
> You received this message because you are subscribed to "rtc-linux".
> Membership options at http://groups.google.com/group/rtc-linux .
> Please read http://groups.google.com/group/rtc-linux/web/checklist
> before submitting a driver.
> ---
> You received this message because you are subscribed to the Google Groups "rtc-linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-07-14 21:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-03 23:15 [rtc-linux] [PATCH v4 0/7] add device tree support for mxc rtc Philippe Reynes
2015-07-03 23:15 ` [rtc-linux] [PATCH v4 1/7] imx31: add a second rtc clock Philippe Reynes
2015-07-03 23:15 ` [rtc-linux] [PATCH v4 2/7] imx35: define two clocks for rtc Philippe Reynes
2015-07-03 23:15 ` [rtc-linux] [PATCH v4 3/7] rtc: mxc: use a second rtc clock Philippe Reynes
2015-07-14 21:49 ` Alexandre Belloni
2015-07-03 23:15 ` [rtc-linux] [PATCH v4 4/7] rtc: mxc: add support of device tree Philippe Reynes
2015-07-14 21:52 ` Alexandre Belloni [this message]
2015-07-03 23:15 ` [rtc-linux] [PATCH v4 5/7] dt-binding: document the binding for mxc rtc Philippe Reynes
2015-07-09 14:26 ` [rtc-linux] " Shawn Guo
2015-07-10 19:58 ` Rob Herring
2015-07-03 23:15 ` [rtc-linux] [PATCH v4 6/7] imx27: dt: add support of internal rtc Philippe Reynes
2015-07-09 14:32 ` [rtc-linux] " Shawn Guo
2015-07-03 23:15 ` [rtc-linux] [PATCH v4 7/7] apf27: dt: enable " Philippe Reynes
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=20150714215241.GB24706@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=a.zummo@towertech.it \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rtc-linux@googlegroups.com \
--cc=shawn.guo@linaro.org \
--cc=tremyfr@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox