From patchwork Sat Apr 28 16:02:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 155667 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D5796B6FDF for ; Sun, 29 Apr 2012 02:05:59 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SOA7q-00008x-Eo; Sat, 28 Apr 2012 16:03:58 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SOA7U-0008Ty-W3 for linux-arm-kernel@lists.infradead.org; Sat, 28 Apr 2012 16:03:37 +0000 Received: by mail-pb0-f49.google.com with SMTP id rq13so2309375pbb.36 for ; Sat, 28 Apr 2012 09:03:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=7g+1wk6IAZGpupO+yGXuzxCoe6JzdKDkQCu8xCYUV40=; b=iWGBoLntcOU8D3vvvfNc3yfIgsauQ2JYIypSO3XMOv4LiVWaK85oKM4R91ag76AmLp ws7eQ7NqEHz6i78iGaRNR65T+GB2+ypop1iA4oV5iau2bGfIrZqZQViIDD2UKhi/L52t wtlHxMfPa0lZVKkdm341+g4ZDLUxu2rfeqCwtXaU80JflP2lckWmPqJ/v2dY1RCxdMMn gMOg2vrK1uygqFh5t05FCt1SkO7Qbm+OF40x01iEbdxIA5pNctUe1YFYtYy1YzY3Czg8 wdLaiDRfcMpHp899txpbQZFFaV4UMPpZCI6f9GJW7QNwV8ZYV3HE1UYuVNmItNup5TK4 og2A== Received: by 10.68.225.227 with SMTP id rn3mr1188136pbc.22.1335629016724; Sat, 28 Apr 2012 09:03:36 -0700 (PDT) Received: from localhost.localdomain ([221.225.141.125]) by mx.google.com with ESMTPS id wf6sm10058927pbc.8.2012.04.28.09.03.30 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 Apr 2012 09:03:35 -0700 (PDT) From: Shawn Guo To: Arnd Bergmann , Olof Johansson Subject: [PATCH v2 4/8] ARM: mxs: request clock for timer Date: Sun, 29 Apr 2012 00:02:37 +0800 Message-Id: <1335628961-1340-5-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335628961-1340-1-git-send-email-shawn.guo@linaro.org> References: <1335628961-1340-1-git-send-email-shawn.guo@linaro.org> X-Gm-Message-State: ALoCoQlFNCGEvsBCe/siIreE2v1sjjFG39D/c2x7DhT03SzZY+Q4kMLBpruD/2+HvaaoOMyJuc1b X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Sascha Hauer , Shawn Guo , Mike Turquette , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org When mxs_timer_init() does not have a timer_clk passed in, it should try to request clock from clkdev system. Signed-off-by: Shawn Guo --- arch/arm/mach-mxs/timer.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c index 564a632..575e8fd 100644 --- a/arch/arm/mach-mxs/timer.c +++ b/arch/arm/mach-mxs/timer.c @@ -20,6 +20,7 @@ * MA 02110-1301, USA. */ +#include #include #include #include @@ -245,6 +246,14 @@ static int __init mxs_clocksource_init(struct clk *timer_clk) void __init mxs_timer_init(struct clk *timer_clk, int irq) { + if (!timer_clk) { + timer_clk = clk_get_sys("timrot", NULL); + if (IS_ERR(timer_clk)) { + pr_err("%s: failed to get clk\n", __func__); + return; + } + } + clk_prepare_enable(timer_clk); /*