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: 48901 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 96E1C21411 for ; Fri, 22 May 2015 15:38:08 +0000 (UTC) Received: by lbbuh7 with SMTP id uh7sf6038263lbb.3 for ; Fri, 22 May 2015 08:38:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=ZbjIvV5AHNajuNLxyPZ5nBSO0UC3SfJhqqQLJQQpeHs=; b=eNjx05IKwiz0nK5xS8mRLoLEZHWdPxDmbqUTeZO1FG6C9jN/BFbxXLeI4/nqM/eBRp LFTo+lACLswo+nsZA/i1aCjyJXu0OAWeXha9Lp/rHQ6AGCRL1X+vhTIcCwIfbXmdheEq 9mWaHhle1HBtAigFpXenCjxhcPW3OSiAj0e7/T6eiyo/y/voWBhNMT2ILlUVXe0WlYFP QXMmoU1hS81MrFDsBYwyGy7ifT2mREbLa7q3WILAwqBzyF3SJHS/PJiY0b8Z0CbcbdXF 6gCBJEB++o0JXMiD3bx2f49j+5aI3opvyRvcYjgvYX9dZl9LYssJUygTFPVXMJkjHb/8 9zUQ== X-Gm-Message-State: ALoCoQlMeNljogV0kv7HpNDbBcHTz1k8+b7eheBM1wczGmdHFMxupwnzK20b+oCSgcYHu/UQgYdp X-Received: by 10.152.43.116 with SMTP id v20mr8296047lal.3.1432309087628; Fri, 22 May 2015 08:38:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.74 with SMTP id ju10ls532294lab.23.gmail; Fri, 22 May 2015 08:38:07 -0700 (PDT) X-Received: by 10.152.22.72 with SMTP id b8mr6885056laf.1.1432309087341; Fri, 22 May 2015 08:38:07 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id n4si1069163laj.18.2015.05.22.08.38.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 May 2015 08:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labbd9 with SMTP id bd9so15265768lab.2 for ; Fri, 22 May 2015 08:38:07 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr7023114lab.35.1432309087238; Fri, 22 May 2015 08:38:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1497312lbb; Fri, 22 May 2015 08:38:06 -0700 (PDT) X-Received: by 10.68.93.68 with SMTP id cs4mr16664510pbb.139.1432309085048; Fri, 22 May 2015 08:38:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id op8si3938105pac.123.2015.05.22.08.38.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 May 2015 08:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; 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-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 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.45 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.45 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shawn.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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)