From: Neil Zhang <zhangwm@marvell.com>
To: grant.likely@linaro.org, haojian.zhuang@gmail.com, arnd@arndb.de,
devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Neil Zhang <zhangwm@marvell.com>
Subject: [PATCH V3 2/3] clocksource: mmp: support CLOCKSOURCE OF DECLARE
Date: Tue, 9 Jul 2013 14:42:45 +0800 [thread overview]
Message-ID: <1373352166-10064-3-git-send-email-zhangwm@marvell.com> (raw)
In-Reply-To: <1373352166-10064-1-git-send-email-zhangwm@marvell.com>
support CLOCKSOURCE OF DECLARE for mmp timer.
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
---
arch/arm/mach-mmp/mmp-dt.c | 5 ++---
arch/arm/mach-mmp/mmp2-dt.c | 3 +--
arch/arm/mach-mmp/time.c | 15 ++-------------
3 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-mmp/mmp-dt.c b/arch/arm/mach-mmp/mmp-dt.c
index 62c5adb..87ab5ff 100644
--- a/arch/arm/mach-mmp/mmp-dt.c
+++ b/arch/arm/mach-mmp/mmp-dt.c
@@ -20,7 +20,6 @@
#include "common.h"
extern void __init mmp_dt_irq_init(void);
-extern void __init mmp_dt_init_timer(void);
static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("marvell,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
@@ -65,7 +64,7 @@ static const char *mmp_dt_board_compat[] __initdata = {
DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
.map_io = mmp_map_io,
.init_irq = mmp_dt_irq_init,
- .init_time = mmp_dt_init_timer,
+ .init_time = clocksource_of_init,
.init_machine = pxa168_dt_init,
.dt_compat = mmp_dt_board_compat,
MACHINE_END
@@ -73,7 +72,7 @@ MACHINE_END
DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)")
.map_io = mmp_map_io,
.init_irq = mmp_dt_irq_init,
- .init_time = mmp_dt_init_timer,
+ .init_time = clocksource_of_init,
.init_machine = pxa910_dt_init,
.dt_compat = mmp_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-mmp/mmp2-dt.c b/arch/arm/mach-mmp/mmp2-dt.c
index 6523ecf..0ce46f1 100644
--- a/arch/arm/mach-mmp/mmp2-dt.c
+++ b/arch/arm/mach-mmp/mmp2-dt.c
@@ -22,7 +22,6 @@
#include "common.h"
extern void __init mmp_dt_irq_init(void);
-extern void __init mmp_dt_init_timer(void);
static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("marvell,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL),
@@ -50,7 +49,7 @@ static const char *mmp2_dt_board_compat[] __initdata = {
DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)")
.map_io = mmp_map_io,
.init_irq = mmp_dt_irq_init,
- .init_time = mmp_dt_init_timer,
+ .init_time = clocksource_of_init,
.init_machine = mmp2_dt_init,
.dt_compat = mmp2_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 67e7d5c..8f5d612 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -207,22 +207,10 @@ void __init timer_init(int irq)
}
#ifdef CONFIG_OF
-static struct of_device_id mmp_timer_dt_ids[] = {
- { .compatible = "marvell,mmp-timer", },
- {}
-};
-
-void __init mmp_dt_init_timer(void)
+static void __init mmp_of_init_timer(struct device_node *np)
{
- struct device_node *np;
int irq, ret;
- np = of_find_matching_node(NULL, mmp_timer_dt_ids);
- if (!np) {
- ret = -ENODEV;
- goto out;
- }
-
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
ret = -EINVAL;
@@ -238,4 +226,5 @@ void __init mmp_dt_init_timer(void)
out:
pr_err("Failed to get timer from device tree with error:%d\n", ret);
}
+CLOCKSOURCE_OF_DECLARE(mmp_timer, "marvell,mmp-timer", mmp_of_init_timer);
#endif
--
1.7.4.1
next prev parent reply other threads:[~2013-07-09 6:42 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 6:42 [PATCH V3 0/3] bring up pxa988 with DT Neil Zhang
2013-07-09 6:42 ` [PATCH V3 1/3] dts: change Marvell prefix to 'marvell' Neil Zhang
[not found] ` <1373352166-10064-2-git-send-email-zhangwm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
2013-07-09 12:49 ` Jason Cooper
2013-07-10 7:25 ` Neil Zhang
2013-07-10 12:20 ` Jason Cooper
2013-07-10 14:41 ` Daniel Drake
2013-07-10 8:19 ` Haojian Zhuang
2013-07-10 12:24 ` Jason Cooper
2013-07-10 14:08 ` Haojian Zhuang
[not found] ` <CAN1soZzMvront1-jcBW6-uRKNs0OZNGnmiOjKGZSM28bViB_8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-10 21:50 ` Jason Cooper
2013-07-11 23:54 ` Haojian Zhuang
2013-07-12 15:10 ` Daniel Drake
2013-07-12 15:57 ` Jason Cooper
2013-07-12 16:05 ` Daniel Drake
2013-07-12 16:14 ` Jason Cooper
[not found] ` <CAMLZHHQGZvDssY-YxQ3ZW8FYhpG-H1-VbokOid33socRSPrMNw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-13 0:35 ` Haojian Zhuang
[not found] ` <CAN1soZzQz8PaHOwNf-Ec6G=ahhx_P8gaaX4fQnpX-Mqrepk_7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-13 14:30 ` Daniel Drake
[not found] ` <20130710215041.GR11908-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2013-07-13 19:56 ` Olof Johansson
2013-07-15 4:39 ` Jason Cooper
2013-07-10 20:50 ` Matt Sealey
2013-07-10 21:49 ` Jason Cooper
2013-07-11 11:20 ` Neil Zhang
2013-07-14 19:29 ` Arnd Bergmann
[not found] ` <201307142129.43271.arnd-r2nGTMty4D4@public.gmane.org>
2013-07-17 13:37 ` Neil Zhang
2013-07-09 6:42 ` Neil Zhang [this message]
2013-07-09 16:14 ` [PATCH V3 2/3] clocksource: mmp: support CLOCKSOURCE OF DECLARE Thomas Petazzoni
2013-07-09 21:16 ` Arnd Bergmann
2013-07-10 5:58 ` Haojian Zhuang
2013-07-11 11:23 ` Neil Zhang
2013-07-11 23:51 ` Haojian Zhuang
2013-07-09 6:42 ` [PATCH V3 3/3] ARM: mmp: bring up pxa988 with device tree support Neil Zhang
2013-07-09 22:05 ` Arnd Bergmann
2013-07-11 11:35 ` Neil Zhang
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=1373352166-10064-3-git-send-email-zhangwm@marvell.com \
--to=zhangwm@marvell.com \
--cc=arnd@arndb.de \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@linaro.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).