From patchwork Mon Jun 3 09:30:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 17441 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B538B23916 for ; Mon, 3 Jun 2013 09:32:49 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf3544388wgh.9 for ; Mon, 03 Jun 2013 02:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=64y24uytHja3pX8MCWqeL6dk7D2AltHFO93TNwzIvK8=; b=WV94Fm2pnJp8DvsoAlZ+J2oUi5ZrVFEn9ccKSdSDsEa0BD9iuu4dKXfJN7g/xCbG+I 22RamufDqZoSClugWh2+fs/tP+W8ICYd4DD7a7iHHzzFtVgKuN9oEEam3jG1z54QRsOj 9QyB4tvHamrHu4W6iLqDhQAS9mVvI8Y1eYDGSqrOqrZVrgG5S6GsubgY7eVQeh7UtzGl v0+FpPteOnm/r9/MmO16sU19/29OSjTBqbr++pLLeBEhyCg4x1d7R5zaY2dypJV2oUfd Lb02SRogXkEESdLs9OSef7p1efcf/UtFiuASz5+b4jOn38MBo2EauJfZ1BBckh5IPYwc fyYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=64y24uytHja3pX8MCWqeL6dk7D2AltHFO93TNwzIvK8=; b=lICifIjwy3UunwmnZa6ky1AdVr/SvCQPkYSNDY0QLu6aqxjJFx97GLrHyD6xzC3Gte oJOs6+aTlhrRNaGtNw08aKS97hupkJRmLx8/feqYVcOGSd9jcVojKv/8vw54y+P+kTAh JRkP/6WOvyKCI74z8QQ/1+F72e69YEYEjeFwg/MtqkLDvEjBPS2n35f+umZXWxiUC5Kj Uv0Cx1Pf3WdZ3tFjljDEcY2OovpLlz0Trs1rVZrVlM3aQhMCoQlpkx5TWZOvgohz2dm2 pIuoWlokYaAKEsdao6szOAyghrIMqt0W/4tsWGBF3QaV+RJUJXCj1E0lF4tQjJi96M9V +OfA== X-Received: by 10.180.210.161 with SMTP id mv1mr4559254wic.1.1370251968971; Mon, 03 Jun 2013 02:32:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.83.6 with SMTP id m6ls792251wiy.23.canary; Mon, 03 Jun 2013 02:32:48 -0700 (PDT) X-Received: by 10.194.77.15 with SMTP id o15mr7574804wjw.27.1370251968750; Mon, 03 Jun 2013 02:32:48 -0700 (PDT) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [2607:f8b0:400c:c01::230]) by mx.google.com with ESMTPS id fe7si8818878wib.77.2013.06.03.02.32.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 02:32:48 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::230; Received: by mail-ve0-f176.google.com with SMTP id c13so2592220vea.21 for ; Mon, 03 Jun 2013 02:32:47 -0700 (PDT) X-Received: by 10.52.36.115 with SMTP id p19mr13970363vdj.8.1370251967588; Mon, 03 Jun 2013 02:32:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp71081vcb; Mon, 3 Jun 2013 02:32:46 -0700 (PDT) X-Received: by 10.68.139.33 with SMTP id qv1mr22908478pbb.93.1370251966618; Mon, 03 Jun 2013 02:32:46 -0700 (PDT) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [2607:f8b0:400e:c01::235]) by mx.google.com with ESMTPS id bd8si39682969pad.309.2013.06.03.02.32.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 02:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of haojian.zhuang@gmail.com designates 2607:f8b0:400e:c01::235 as permitted sender) client-ip=2607:f8b0:400e:c01::235; Received: by mail-pb0-f53.google.com with SMTP id un4so5374579pbc.40 for ; Mon, 03 Jun 2013 02:32:45 -0700 (PDT) X-Received: by 10.68.228.161 with SMTP id sj1mr23581578pbc.151.1370251965379; Mon, 03 Jun 2013 02:32:45 -0700 (PDT) Received: from localhost.localdomain ([27.115.121.40]) by mx.google.com with ESMTPSA id wi6sm58333510pbc.22.2013.06.03.02.32.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 02:32:44 -0700 (PDT) From: Haojian Zhuang To: tglx@linutronix.de, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, chao.xie@marvell.com, john.stultz@linaro.org, mturquette@linaro.org, eric.y.miao@gmail.com Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v3 11/11] ARCH: mmp: support clocksource in timer Date: Mon, 3 Jun 2013 17:30:45 +0800 Message-Id: <1370251845-31373-12-git-send-email-haojian.zhuang@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370251845-31373-1-git-send-email-haojian.zhuang@gmail.com> References: <1370251845-31373-1-git-send-email-haojian.zhuang@gmail.com> X-Gm-Message-State: ALoCoQljM+KMdC023CeQahRTAzdlD+xi/XsU0xuC6qqrQz0PPAi4as5zkGeNjTfg6p2wllZRgyCy X-Original-Sender: haojian.zhuang@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gmail.com Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Support clocksource in timer-mmp driver. Signed-off-by: Haojian Zhuang --- arch/arm/mach-mmp/mmp-dt.c | 4 +--- arch/arm/mach-mmp/mmp2-dt.c | 2 +- drivers/clocksource/Kconfig | 6 ++++++ drivers/clocksource/Makefile | 2 +- drivers/clocksource/timer-mmp.c | 16 +++------------- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-mmp/mmp-dt.c b/arch/arm/mach-mmp/mmp-dt.c index 2b8f1f6..ff4a70b 100644 --- a/arch/arm/mach-mmp/mmp-dt.c +++ b/arch/arm/mach-mmp/mmp-dt.c @@ -18,8 +18,6 @@ #include "common.h" -extern void __init mmp_dt_init_timer(void); - static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), @@ -63,7 +61,7 @@ static const char *mmp_dt_board_compat[] __initdata = { static void __init mmp_init_timer(void) { of_clk_init(NULL); - mmp_dt_init_timer(); + clocksource_of_init(); } DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") diff --git a/arch/arm/mach-mmp/mmp2-dt.c b/arch/arm/mach-mmp/mmp2-dt.c index 68a7642..9495105 100644 --- a/arch/arm/mach-mmp/mmp2-dt.c +++ b/arch/arm/mach-mmp/mmp2-dt.c @@ -40,7 +40,7 @@ static void __init mmp2_dt_init(void) static void __init mmp2_init_timer(void) { of_clk_init(NULL); - mmp_dt_init_timer(); + clocksource_of_init(); } static const char *mmp2_dt_board_compat[] __initdata = { diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index f151c6c..f429f68 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -72,6 +72,12 @@ config CLKSRC_METAG_GENERIC help This option enables support for the Meta per-thread timers. +config CLKSRC_MMP + def_bool y if ARCH_MMP + select CLKSRC_OF if OF + help + This option enables support for the MMP timer. + config CLKSRC_EXYNOS_MCT def_bool y if ARCH_EXYNOS help diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index f6aa3b6..d154705 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_SH_TIMER_TMU) += sh_tmu.o obj-$(CONFIG_EM_TIMER_STI) += em_sti.o obj-$(CONFIG_CLKBLD_I8253) += i8253.o obj-$(CONFIG_CLKSRC_MMIO) += mmio.o +obj-$(CONFIG_CLKSRC_MMP) += timer-mmp.o obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o @@ -17,7 +18,6 @@ obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o obj-$(CONFIG_ARCH_MARCO) += timer-marco.o -obj-$(CONFIG_ARCH_MMP) += timer-mmp.o obj-$(CONFIG_ARCH_MXS) += mxs_timer.o obj-$(CONFIG_ARCH_PRIMA2) += timer-prima2.o obj-$(CONFIG_SUN4I_TIMER) += sun4i_timer.o diff --git a/drivers/clocksource/timer-mmp.c b/drivers/clocksource/timer-mmp.c index 39b8968..7ae4f95 100644 --- a/drivers/clocksource/timer-mmp.c +++ b/drivers/clocksource/timer-mmp.c @@ -235,22 +235,12 @@ void __init timer_init(int irq, int mmp2_mode) MIN_DELTA, MAX_DELTA); } -#ifdef CONFIG_OF -static struct of_device_id mmp_timer_dt_ids[] = { - { .compatible = "mrvl,mmp-timer", }, - {} -}; - -void __init mmp_dt_init_timer(void) +static void __init mmp_dt_init_timer(struct device_node *np) { - struct device_node *np; struct clk *clk; - int irq, ret; + int irq; u32 rate = 0; - np = of_find_matching_node(NULL, mmp_timer_dt_ids); - if (!np) - return; if (!of_device_is_available(np)) return; if (of_property_read_u32(np, "clock-frequency", &rate)) { @@ -288,4 +278,4 @@ void __init mmp_dt_init_timer(void) out: clk_put(clk); } -#endif +CLOCKSOURCE_OF_DECLARE(mmp_timer, "mrvl,mmp-timer", mmp_dt_init_timer);