From patchwork Tue Oct 6 17:01:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 54548 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id C6FC522FC5 for ; Tue, 6 Oct 2015 17:04:01 +0000 (UTC) Received: by lacwq3 with SMTP id wq3sf1502807lac.3 for ; Tue, 06 Oct 2015 10:04:00 -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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=NSKDw2k561l8VufWEmdBAOdHhrlqw1V3dOivvQ8T+To=; b=FYt4qmXsABZM/oWidoPM3B4qHeN+PPeo8HxbUXCZHSA31/JBRl7wfO9Wt2BY8aXyQl 30cj3Es3UpWMEGp3jWPKDRypF1VxwfM5Q9pXJPNwGNhjcwvgzHPWun5X/0VpNI9FW1+W BSBcIS7spaBqRbuXUc5hQyb93cfUNHySuitS/646tMCc95UoD0tBs95si2KxxEw8mx+Q szOtpDwI84ddpN783Zb12PIhNYzMLIcfI7zXUullyGVuywct+VhMFGMtTZ+U/Kxu16qT KVtGcspCH//x5EXXeAJtMl12LfOjwM29VDZEWGufQDA8Y0mkcKvFkz8WV/qqBd1FomOq 2ZwA== X-Gm-Message-State: ALoCoQl8zkHjK2s6p38n28r9c/GaKm90WUQwJEFfHHneE+6nXLqc6qlT9V7IsYc/PNZ1qpKh/oiL X-Received: by 10.112.138.4 with SMTP id qm4mr5406124lbb.6.1444151040778; Tue, 06 Oct 2015 10:04:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.150.148 with SMTP id y142ls641455lfd.59.gmail; Tue, 06 Oct 2015 10:04:00 -0700 (PDT) X-Received: by 10.112.163.131 with SMTP id yi3mr15217873lbb.36.1444151040575; Tue, 06 Oct 2015 10:04:00 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id k81si21644255lfi.90.2015.10.06.10.04.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2015 10:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbwt4 with SMTP id wt4so42490022lbb.1 for ; Tue, 06 Oct 2015 10:04:00 -0700 (PDT) X-Received: by 10.112.146.104 with SMTP id tb8mr15539737lbb.35.1444151040396; Tue, 06 Oct 2015 10:04:00 -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.59.35 with SMTP id w3csp1964598lbq; Tue, 6 Oct 2015 10:03:58 -0700 (PDT) X-Received: by 10.66.232.40 with SMTP id tl8mr46864912pac.45.1444151038035; Tue, 06 Oct 2015 10:03:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si50268315pap.61.2015.10.06.10.03.57; Tue, 06 Oct 2015 10:03:58 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752886AbbJFRCw (ORCPT + 30 others); Tue, 6 Oct 2015 13:02:52 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56111 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752806AbbJFRCt (ORCPT ); Tue, 6 Oct 2015 13:02:49 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t96H2DIQ013556; Tue, 6 Oct 2015 12:02:13 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t96H2D7A002415; Tue, 6 Oct 2015 12:02:13 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Tue, 6 Oct 2015 12:02:14 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t96H2CPo006291; Tue, 6 Oct 2015 12:02:13 -0500 From: Felipe Balbi To: Tony Lindgren CC: Linux OMAP Mailing List , Linux ARM Kernel Mailing List , , , Linux Kernel Mailing List , Felipe Balbi Subject: [PATCH 01/11] arm: omap2: timer: get rid of obfuscating macros Date: Tue, 6 Oct 2015 12:01:57 -0500 Message-ID: <1444150927-14771-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1444150927-14771-1-git-send-email-balbi@ti.com> References: <1444150927-14771-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , those macros just make it a lot more difficult to grep around and actually find similarities. In this patch, we will simply remove them and replace with actual functions and later commits will come to further clean this up. Signed-off-by: Felipe Balbi --- arch/arm/mach-omap2/timer.c | 70 ++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 548d922cb107..23e58ea6a171 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -592,53 +592,69 @@ static inline void __init realtime_counter_init(void) {} #endif -#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ - clksrc_nr, clksrc_src, clksrc_prop) \ -void __init omap##name##_gptimer_timer_init(void) \ -{ \ - omap_clk_init(); \ - omap_dmtimer_init(); \ - omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ - omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \ - clksrc_prop); \ +static void __init __omap_gptimer_init(int clkev_nr, const char *clkev_src, + const char *clkev_prop, int clksrc_nr, const char *clksrc_src, + const char *clksrc_prop) +{ + omap_clk_init(); + omap_dmtimer_init(); + omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop); + omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, clksrc_prop); } -#define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ - clksrc_nr, clksrc_src, clksrc_prop) \ -void __init omap##name##_sync32k_timer_init(void) \ -{ \ - omap_clk_init(); \ - omap_dmtimer_init(); \ - omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ - /* Enable the use of clocksource="gp_timer" kernel parameter */ \ - if (use_gptimer_clksrc) \ - omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \ - clksrc_prop); \ - else \ - omap2_sync32k_clocksource_init(); \ +static void __init __omap_sync32k_timer_init(int clkev_nr, const char *clkev_src, + const char *clkev_prop, int clksrc_nr, const char *clksrc_src, + const char *clksrc_prop) +{ + omap_clk_init(); + omap_dmtimer_init(); + omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop); + + /* Enable the use of clocksource="gp_timer" kernel parameter */ + if (use_gptimer_clksrc) + omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, + clksrc_prop); + else + omap2_sync32k_clocksource_init(); } #ifdef CONFIG_ARCH_OMAP2 -OMAP_SYS_32K_TIMER_INIT(2, 1, "timer_32k_ck", "ti,timer-alwon", +void __init omap2_sync32k_timer_init(void) +{ + __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon", 2, "timer_sys_ck", NULL); +} #endif /* CONFIG_ARCH_OMAP2 */ #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX) -OMAP_SYS_32K_TIMER_INIT(3, 1, "timer_32k_ck", "ti,timer-alwon", +void __init omap3_sync32k_timer_init(void) +{ + __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon", 2, "timer_sys_ck", NULL); -OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure", +} + +void __init omap3_secure_sync32k_timer_init(void) +{ + __omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure", 2, "timer_sys_ck", NULL); +} #endif /* CONFIG_ARCH_OMAP3 */ #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) -OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL, +void __init omap3_gptimer_timer_init(void) +{ + __omap_gptimer_init(2, "timer_sys_ck", NULL, 1, "timer_sys_ck", "ti,timer-alwon"); +} #endif #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) -static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon", +static void __init omap4_sync32k_timer_init(void) +{ + __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon", 2, "sys_clkin_ck", NULL); +} void __init omap4_local_timer_init(void) {