Received: by 10.192.165.148 with SMTP id m20csp117703imm; Thu, 26 Apr 2018 17:19:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEKHRBGIDPaDSdzQoaTrbYua3NkGz6qvuLwh/HUeebewiNf9ibywuukDq99g+VO1A/5n+o X-Received: by 2002:a17:902:9303:: with SMTP id bc3-v6mr191512plb.18.1524788395403; Thu, 26 Apr 2018 17:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524788395; cv=none; d=google.com; s=arc-20160816; b=z72KkGCHOA83+yAYHKpPP5prOzgRER/wRncEZYxanB5SfFxotHcgtCFK2JTDxYAyZf ey2QWquO2iynC6ORb5ARgdQ4Ve4vqqeYJJdaqV+MZlt/enslr+TztKwgud59UNfEhcnJ WLRwpt1CYPkibNzeAefeiwXGqiXVi1fFxjB5pXvn/PoSlb4+pkb2159LSq4KP+k+C/HE hq+eG2rhnRAnN1Plc1tqfr4BPMbs06w7Yny/9+p6gg7razeAYV3LWucg+6w/fmxuXYfe d26eyCO9jjCZj6ReuEpNzmRcENlKsIs/i85GNR1n6xeaStyDr/iC7wJiKkyYJBOKdC1f A09A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=4SE2s6tECwOHaCLhH691Jdfz+OYj7agfNDtt76DlEzk=; b=YSC/Q3gDRrkJVAsyqCQ8HH52R0vfr+hv0pLOhyRWo3q1dQbG/Tei9iUqFjMPEQsafP ZcrXQEMQuiPdLlvpUGR9z/7evUrsGXXTYRkt+cMwZEk9Qi6gfzaVTxi+I/gU3roMwKvK QmjQ8J1Je6KP1Mh+Ldrmn0oJM2Gs6ljKuAvprGspijx9l8L+cNNg5DMc1F/NHwWJQCNc eKtjXKUD5O8pZa1NrVVYePrRdfrpOktYke6lobxTESpVq1vD9UwyuzI14nMAUtaMn9wg fXyfESh5MKoCnu0q7Ib79yR0OGwltlPj0bcdyYZC8M0kMCPxHYidmzGj3nAnEhBjxIRy EHzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=JhML64pD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si48362pgv.313.2018.04.26.17.19.39; Thu, 26 Apr 2018 17:19:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=JhML64pD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757197AbeD0ASd (ORCPT + 99 others); Thu, 26 Apr 2018 20:18:33 -0400 Received: from vern.gendns.com ([206.190.152.46]:46236 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752525AbeD0AS3 (ORCPT ); Thu, 26 Apr 2018 20:18:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4SE2s6tECwOHaCLhH691Jdfz+OYj7agfNDtt76DlEzk=; b=JhML64pDl0jo1sWLi9cxUTXY9 ON0/y01rGYedfK9CIxpZNb5iTG0+KpTkagjhItEMWGok6jrRfAIUJrVS+ArDmghv1/vdcXA8zk354 JBPmvfl1cUx6DK5yxFTDZcwoGfnqjuEC2tRSGTSZGZbNuuH0N5eP/Tz8KWs6ekBQIFQBT49SnltO7 vKyqQBDJ5PQcKZPaGLDDA86IouLJDKmAahTgxPki66UVtngb9Uk8tX2+1E9QdrSwpGOTssYW5k5w1 jqmNqKKrBZCXeOsbU4rTMsgCC2tna6+SXysTL/md8JIDP93q4bdtJlLrHs9lwBFFnoHHkE3Wd3nv5 MrYMg7XQQ==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:39016 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1fBr5n-000iph-U2; Thu, 26 Apr 2018 20:18:28 -0400 From: David Lechner To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Sekhar Nori , Kevin Hilman , Bartosz Golaszewski , Adam Ford , linux-kernel@vger.kernel.org, David Lechner Subject: [PATCH v9 04/27] ARM: davinci: pass clock as parameter to davinci_timer_init() Date: Thu, 26 Apr 2018 19:17:22 -0500 Message-Id: <20180427001745.4116-5-david@lechnology.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427001745.4116-1-david@lechnology.com> References: <20180427001745.4116-1-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This changes davinci_timer_init() so that we pass the clock as a parameter instead of using clk_get(). This is done in preparation for converting to the common clock framework. It removes the requirement that we have to have a clock with con_id of "timer0", which will be good for DT bindings since clock-names = "timer0" doesn't really make sense. Also, drop use of extern in header file since we are touching the definition. Signed-off-by: David Lechner --- v9 changes: - drop comment about using ref_clk v8 changes: - none v7 changes: - new in v7 arch/arm/mach-davinci/da830.c | 2 +- arch/arm/mach-davinci/da850.c | 2 +- arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- arch/arm/mach-davinci/include/mach/common.h | 3 ++- arch/arm/mach-davinci/time.c | 5 +---- 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 350d7673aa4d..0b17e5a22e5e 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -1224,5 +1224,5 @@ void __init da830_init(void) void __init da830_init_time(void) { davinci_clk_init(da830_clks); - davinci_timer_init(); + davinci_timer_init(&timerp64_0_clk); } diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 34117e614e08..1dbf01c4124b 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -1396,5 +1396,5 @@ void __init da850_init(void) void __init da850_init_time(void) { davinci_clk_init(da850_clks); - davinci_timer_init(); + davinci_timer_init(&timerp64_0_clk); } diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index f29480495c18..0da7516018ca 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -1047,7 +1047,7 @@ void __init dm355_init(void) void __init dm355_init_time(void) { davinci_clk_init(dm355_clks); - davinci_timer_init(); + davinci_timer_init(&timer0_clk); } int __init dm355_init_video(struct vpfe_config *vpfe_cfg, diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 1e3df9df1e10..871372a59da8 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -1172,7 +1172,7 @@ void __init dm365_init(void) void __init dm365_init_time(void) { davinci_clk_init(dm365_clks); - davinci_timer_init(); + davinci_timer_init(&timer0_clk); } static struct resource dm365_vpss_resources[] = { diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index a2e8586c8a6d..708df0ed8554 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -935,7 +935,7 @@ void __init dm644x_init(void) void __init dm644x_init_time(void) { davinci_clk_init(dm644x_clks); - davinci_timer_init(); + davinci_timer_init(&timer0_clk); } int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 109ab1fa0d2c..e1d6e92f434a 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -956,7 +956,7 @@ void __init dm646x_init_time(unsigned long ref_clk_rate, ref_clk.rate = ref_clk_rate; aux_clkin.rate = aux_clkin_rate; davinci_clk_init(dm646x_clks); - davinci_timer_init(); + davinci_timer_init(&timer0_clk); } static int __init dm646x_init_devices(void) diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index f0d5e858f158..5f45d0ac66a8 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h @@ -12,11 +12,12 @@ #ifndef __ARCH_ARM_MACH_DAVINCI_COMMON_H #define __ARCH_ARM_MACH_DAVINCI_COMMON_H +#include #include #include #include -extern void davinci_timer_init(void); +void davinci_timer_init(struct clk *clk); extern void davinci_irq_init(void); extern void __iomem *davinci_intc_base; diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 1bb991ad9c1e..486896f309c5 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c @@ -334,10 +334,8 @@ static struct clock_event_device clockevent_davinci = { .set_state_oneshot = davinci_set_oneshot, }; - -void __init davinci_timer_init(void) +void __init davinci_timer_init(struct clk *timer_clk) { - struct clk *timer_clk; struct davinci_soc_info *soc_info = &davinci_soc_info; unsigned int clockevent_id; unsigned int clocksource_id; @@ -373,7 +371,6 @@ void __init davinci_timer_init(void) } } - timer_clk = clk_get(NULL, "timer0"); BUG_ON(IS_ERR(timer_clk)); clk_prepare_enable(timer_clk); -- 2.17.0