From patchwork Mon Mar 25 15:17:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2331801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 95AC73FD8C for ; Mon, 25 Mar 2013 15:23:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK9As-0004ol-0Y; Mon, 25 Mar 2013 15:19:02 +0000 Received: from mail-db8lp0186.outbound.messaging.microsoft.com ([213.199.154.186] helo=db8outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK98w-0004Bf-GF for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 15:17:05 +0000 Received: from mail6-db8-R.bigfish.com (10.174.8.251) by DB8EHSOBE042.bigfish.com (10.174.4.105) with Microsoft SMTP Server id 14.1.225.23; Mon, 25 Mar 2013 15:17:00 +0000 Received: from mail6-db8 (localhost [127.0.0.1]) by mail6-db8-R.bigfish.com (Postfix) with ESMTP id 15E44CC009D; Mon, 25 Mar 2013 15:17:00 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275dhz2dh87h2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail6-db8 (localhost.localdomain [127.0.0.1]) by mail6-db8 (MessageSwitch) id 1364224618346897_27816; Mon, 25 Mar 2013 15:16:58 +0000 (UTC) Received: from DB8EHSMHS021.bigfish.com (unknown [10.174.8.238]) by mail6-db8.bigfish.com (Postfix) with ESMTP id 4D4B8140045; Mon, 25 Mar 2013 15:16:58 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB8EHSMHS021.bigfish.com (10.174.4.31) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 25 Mar 2013 15:16:49 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.328.11; Mon, 25 Mar 2013 15:16:47 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.59]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r2PFGhFA010835; Mon, 25 Mar 2013 08:16:46 -0700 From: Shawn Guo To: Subject: [PATCH 1/6] ARM: mxs: use CLKSRC_OF helper to initialize timer Date: Mon, 25 Mar 2013 23:17:27 +0800 Message-ID: <1364224652-28332-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364224652-28332-1-git-send-email-shawn.guo@linaro.org> References: <1364224652-28332-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130325_111703_324651_D2D07061 X-CRM114-Status: GOOD ( 13.02 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [213.199.154.186 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Select CLKSRC_OF and use clocksource_of_init() to initialize timer, so that the call to mxs_timer_init() in clock driver can be removed. Signed-off-by: Shawn Guo --- arch/arm/Kconfig | 1 + arch/arm/mach-mxs/include/mach/common.h | 1 - arch/arm/mach-mxs/mach-mxs.c | 3 +++ arch/arm/mach-mxs/timer.c | 10 ++-------- drivers/clk/mxs/clk-imx23.c | 2 -- drivers/clk/mxs/clk-imx28.c | 2 -- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index eaae82a..d57fc3d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -474,6 +474,7 @@ config ARCH_MXS select ARCH_REQUIRE_GPIOLIB select CLKDEV_LOOKUP select CLKSRC_MMIO + select CLKSRC_OF select COMMON_CLK select GENERIC_CLOCKEVENTS select HAVE_CLK_PREPARE diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h index be5a9c9..e043c47 100644 --- a/arch/arm/mach-mxs/include/mach/common.h +++ b/arch/arm/mach-mxs/include/mach/common.h @@ -13,7 +13,6 @@ extern const u32 *mxs_get_ocotp(void); extern int mxs_reset_block(void __iomem *); -extern void mxs_timer_init(void); extern void mxs_restart(char, const char *); extern int mxs_saif_clkmux_select(unsigned int clkmux); diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 3218f1f..796c5dd 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -178,11 +179,13 @@ static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { static void __init imx23_timer_init(void) { mx23_clocks_init(); + clocksource_of_init(); } static void __init imx28_timer_init(void) { mx28_clocks_init(); + clocksource_of_init(); } enum mac_oui { diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c index 4210204..fe2903d 100644 --- a/arch/arm/mach-mxs/timer.c +++ b/arch/arm/mach-mxs/timer.c @@ -242,18 +242,11 @@ static int __init mxs_clocksource_init(struct clk *timer_clk) return 0; } -void __init mxs_timer_init(void) +static void __init mxs_timer_init(struct device_node *np) { - struct device_node *np; struct clk *timer_clk; int irq; - np = of_find_compatible_node(NULL, NULL, "fsl,timrot"); - if (!np) { - pr_err("%s: failed find timrot node\n", __func__); - return; - } - timer_clk = clk_get_sys("timrot", NULL); if (IS_ERR(timer_clk)) { pr_err("%s: failed to get clk\n", __func__); @@ -304,3 +297,4 @@ void __init mxs_timer_init(void) irq = irq_of_parse_and_map(np, 0); setup_irq(irq, &mxs_timer_irq); } +CLOCKSOURCE_OF_DECLARE(mxs, "fsl,timrot", mxs_timer_init) diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c index b5c06f9..52e0365 100644 --- a/drivers/clk/mxs/clk-imx23.c +++ b/drivers/clk/mxs/clk-imx23.c @@ -165,7 +165,5 @@ int __init mx23_clocks_init(void) for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) clk_prepare_enable(clks[clks_init_on[i]]); - mxs_timer_init(); - return 0; } diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c index 76ce6c6..03918e1 100644 --- a/drivers/clk/mxs/clk-imx28.c +++ b/drivers/clk/mxs/clk-imx28.c @@ -244,7 +244,5 @@ int __init mx28_clocks_init(void) for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) clk_prepare_enable(clks[clks_init_on[i]]); - mxs_timer_init(); - return 0; }