From patchwork Sat Apr 21 15:57:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 154217 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 3A751B6F9A for ; Sun, 22 Apr 2012 02:01:39 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SLciH-0008Lg-UI; Sat, 21 Apr 2012 15:59:05 +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 1SLcho-0008Ef-94 for linux-arm-kernel@lists.infradead.org; Sat, 21 Apr 2012 15:58:40 +0000 Received: by mail-pb0-f49.google.com with SMTP id un4so2425118pbc.36 for ; Sat, 21 Apr 2012 08:58: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=TeaIiVAUg5x+GZ8dsXhfoWL2hfGbJliBz4vMkHcuQvBRPqX17UFqnMxASlXB6ZulvD oLbYJvPKG5IaxkO+AbZ5cetIXX3oS+s095mfIVnY7qjVQgzoxIyQWWp8r/F7equaMC0M 22uLHn0H02+8N7jc/ooM2J5aJk9h1glCUpYKZgwW5A5fQpAPOjsrzCy7jZm5AinSndib 1u52fGdK2yYJGkZxx8Ja2RzAaTMuAOJqq0j/QBTHamIkk+osV3kyOx3s76U0TGOHV2MB T385gd27SrfjDs4By4sOglygfJ84iYtn62H121etUEZm0lxP92Cs+NDI70qs89eKpcgc mwBw== Received: by 10.68.233.99 with SMTP id tv3mr3373822pbc.11.1335023915941; Sat, 21 Apr 2012 08:58:35 -0700 (PDT) Received: from localhost.localdomain ([114.216.145.110]) by mx.google.com with ESMTPS id qo2sm8773492pbb.15.2012.04.21.08.58.29 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Apr 2012 08:58:34 -0700 (PDT) From: Shawn Guo To: Mike Turquette Subject: [PATCH 4/8] ARM: mxs: request clock for timer Date: Sat, 21 Apr 2012 23:57:16 +0800 Message-Id: <1335023840-1394-5-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335023840-1394-1-git-send-email-shawn.guo@linaro.org> References: <1335023840-1394-1-git-send-email-shawn.guo@linaro.org> X-Gm-Message-State: ALoCoQlj5avwsfruf+4WWo7aVfBXRaxjKNemxJNBLFeeEd+2yxy+Sseq0mpahN6KN984sis63r07 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 , linux-arm-kernel@lists.infradead.org, Arnd Bergmann 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); /*