From patchwork Fri May 22 15:29:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 6465621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73F37C0020 for ; Fri, 22 May 2015 15:39:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3A3D200F3 for ; Fri, 22 May 2015 15:39:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB50B200E8 for ; Fri, 22 May 2015 15:38:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YvozJ-0001fV-B4; Fri, 22 May 2015 15:35:53 +0000 Received: from mail-pa0-f45.google.com ([209.85.220.45]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yvovg-0006NO-Mx for linux-arm-kernel@lists.infradead.org; Fri, 22 May 2015 15:32:09 +0000 Received: by padbw4 with SMTP id bw4so22454321pad.0 for ; Fri, 22 May 2015 08:31:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NNamZ8cePDwvWRbEofIN4MPmUZLx+ZANDSKsI51d5SE=; b=WGdHm35Y/NyVgWRh/MiOpK3Owg8fd5JbyKtE4A6BY4VXtn+AcptCaMbiJxvSG0pGT/ pN2y70Dl8cWjJGrbzbfc/OkA+ObdFG1X1KSXAVp+gKlbN81BJPOmXu9NkEH5MHPc4SRI yRKPdy3VRi4tXQEsG3OVEZ66NdNTr9XCdS5nGzWcjE7QdvN5cs4t/sjS8fKianm4vTYo 4akkvYn6+Sf//erpqiEFl6IRYXpR5/Vtdfdb0cXUAZpEr6GVYpxdrOflWTAFI6Mh+xpr Byb8GYjqTsz5KTFym57HwpD+xVwErUf8xtxTDk+TzSXYMUNzjzvQrEECujc8XuqCgasv 5uzA== X-Gm-Message-State: ALoCoQnqSGKJzzZf1N0Xd4HD18LFwXYK51eLgGXTwr3XWsC8IzvqlF5Ka2graxjBz8g1ZpO6fege X-Received: by 10.66.141.77 with SMTP id rm13mr16676976pab.14.1432308706558; Fri, 22 May 2015 08:31:46 -0700 (PDT) Received: from localhost.localdomain ([107.6.117.178]) by mx.google.com with ESMTPSA id as1sm2474485pbc.39.2015.05.22.08.31.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 May 2015 08:31:45 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 06/12] ARM: imx: set up .set_next_event hook via imx_gpt_data Date: Fri, 22 May 2015 23:29:53 +0800 Message-Id: <1432308599-28643-7-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432308599-28643-1-git-send-email-shawn.guo@linaro.org> References: <1432308599-28643-1-git-send-email-shawn.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150522_083208_834270_FB49E0A0 X-CRM114-Status: GOOD ( 11.39 ) X-Spam-Score: -0.7 (/) Cc: Shawn Guo , Daniel Lezcano , Arnd Bergmann , kernel@pengutronix.de, Shenwei Wang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set up .set_next_event hook via imx_gpt_data, so that we can save the use of timer_is_v2(). Signed-off-by: Shawn Guo --- arch/arm/mach-imx/time.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index 2fbc3022ce3f..ceba782a1f1d 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c @@ -97,6 +97,8 @@ struct imx_timer { struct imx_gpt_data { void (*gpt_setup_tctl)(struct imx_timer *imxtm); + int (*set_next_event)(unsigned long evt, + struct clock_event_device *ced); }; static void __iomem *timer_base; @@ -301,9 +303,7 @@ static struct clock_event_device clockevent_mxc = { static int __init mxc_clockevent_init(struct imx_timer *imxtm) { - if (timer_is_v2()) - clockevent_mxc.set_next_event = v2_set_next_event; - + clockevent_mxc.set_next_event = imxtm->gpt->set_next_event; clockevent_mxc.cpumask = cpumask_of(0); clockevents_config_and_register(&clockevent_mxc, clk_get_rate(imxtm->clk_per), @@ -353,18 +353,22 @@ static void imx6dl_gpt_setup_tctl(struct imx_timer *imxtm) static const struct imx_gpt_data imx1_gpt_data = { .gpt_setup_tctl = imx1_gpt_setup_tctl, + .set_next_event = mx1_2_set_next_event, }; static const struct imx_gpt_data imx21_gpt_data = { .gpt_setup_tctl = imx21_gpt_setup_tctl, + .set_next_event = mx1_2_set_next_event, }; static const struct imx_gpt_data imx31_gpt_data = { .gpt_setup_tctl = imx31_gpt_setup_tctl, + .set_next_event = v2_set_next_event, }; static const struct imx_gpt_data imx6dl_gpt_data = { .gpt_setup_tctl = imx6dl_gpt_setup_tctl, + .set_next_event = v2_set_next_event, }; static void __init _mxc_timer_init(struct imx_timer *imxtm)