From patchwork Fri May 18 16:48:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10411649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDCF9601F9 for ; Fri, 18 May 2018 17:03:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB20D28A11 for ; Fri, 18 May 2018 17:03:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF7B928A1C; Fri, 18 May 2018 17:03:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E1FD828A11 for ; Fri, 18 May 2018 17:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=F/qoG1XveyW6k3dmo7lGzxHoqEY3DZFCQjbpcEtwsgk=; b=ClhCHE33USLQWrw49ZPtXgX1tt TJU2r4WSED9hyvtuzZLwRjWI6sH70W/upa9F0uiudkkerR6dmiQ/aqb5x8vyhaCOC9sfGMgf2LCVR uI2ngDsf3rsIz6Ic10Ml4Kbx4/t6unYPBJT616W8riN6IRhaKH4q2BXpNbK/E5NVKCHgGwNXtiKUU 9F0iRBbHiq6+NmhESu2cZRDzadLklbPuFGLO3h5HRRONoZnrfs4wnCKY9yfnY8414nhg6yDeLY8No hKzE5gzgUrvfIIb+EEMUzh8pCxpTgetD1eFmXafl1SO904ru5jy0BvFTxL7pCMYkgQJ41xEFQU6M4 d6Y+ZbPA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJin5-00061Q-Rm; Fri, 18 May 2018 17:03:39 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJiiv-0000Z6-LK for linux-arm-kernel@bombadil.infradead.org; Fri, 18 May 2018 16:59:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; 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=17KJKVvD2XvGJJWRY8s8wysy4hH7bJSq3mU/kmm2N2s=; b=ktYnKeSciPROA8quJ4IPM9rEx UnJ+wgmbcY96GSbCgtYR2qTDoxSnIFNVbZahqRqk+2oQNjjx/k8vUhvtwM6y3FyqYp+7ZfDH52L6J nthI3pQejP24x6qnpCuIkwlqobYS2FQ7/FMnvXOGwocv1fVLGOCQ2LQrk9MeTjaqKSaRKHj5E9xz+ Jt61WeAESoTksfiWfNHa1918SM8kTCi40OfR21dIvCr+z6v6Ssm3KsYWMQcdhsKBDx4vON5GbliTv fK8UibVTDmtJWQG4IaG7UCtFnrdgd/m+Wj0R2rkvPrsITZk4PcpZ4GA8kwd94b4YIoDKSf4UPl1ey 9hSH1YaPQ==; Received: from vern.gendns.com ([206.190.152.46]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJiat-0001Ev-8a for linux-arm-kernel@lists.infradead.org; Fri, 18 May 2018 16:51:04 +0000 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=17KJKVvD2XvGJJWRY8s8wysy4hH7bJSq3mU/kmm2N2s=; b=q/tOCmNcvbqkPgx1FyVVkJNx0 teYfRyvvLATtteLa3cP+5G8U8vPMkqpX4Qwy/iwZ/y2vXXEccocjo7pCma45GQs/BcjaKISIT2jMi nm1lN56ac3NTcTx2eQ5G/t3G6h2AfN6O6W6K6KDalMXOOgMGm2kXULTNpnH8UxqKRO8djconAB7JM 2HlbTwXUoc2Szaet7xa2nV9K3OVR/TnxwY+BtW/nRgidaHg+UbxNT3KErbpbNPTbGIfeGwzoT4Sx1 Zkuf4m0kRphjiTcwIIJ0pj2GvA5tKGg5oJBe4A8OyhDfigjYTkep4RecsVqJuzF3bBB+Crg4VpXyd j01cUI9IA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:35704 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 1fJia3-00FrC3-R3; Fri, 18 May 2018 12:50:12 -0400 From: David Lechner To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v11 04/27] ARM: davinci: pass clock as parameter to davinci_timer_init() Date: Fri, 18 May 2018 11:48:06 -0500 Message-Id: <20180518164829.27052-5-david@lechnology.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518164829.27052-1-david@lechnology.com> References: <20180518164829.27052-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 - lists.infradead.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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180518_125103_421124_02B08952 X-CRM114-Status: GOOD ( 12.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , David Lechner , Kevin Hilman , Stephen Boyd , Michael Turquette , Sekhar Nori , linux-kernel@vger.kernel.org, Bartosz Golaszewski , Rob Herring , Adam Ford MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Reviewed-by: Sekhar Nori Signed-off-by: David Lechner --- v11 changes: - none v10 changes: - none 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 c32ca27ab343..280b753702f3 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -957,7 +957,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);