From patchwork Mon Sep 23 07:54:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 2926411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8154A9F96D for ; Mon, 23 Sep 2013 08:03:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DDCE20527 for ; Mon, 23 Sep 2013 08:03:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B77A22045B for ; Mon, 23 Sep 2013 08:03:40 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VO17F-0003vz-LA; Mon, 23 Sep 2013 08:03:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VO17D-0006fZ-56; Mon, 23 Sep 2013 08:03:31 +0000 Received: from mail-bk0-x231.google.com ([2a00:1450:4008:c01::231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VO17A-0006eW-VU; Mon, 23 Sep 2013 08:03:29 +0000 Received: by mail-bk0-f49.google.com with SMTP id r7so1009272bkg.36 for ; Mon, 23 Sep 2013 01:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mx/VQbRUH5bDMXzZuSnRjOyg5QLo4rMW0kQ8ygehH3w=; b=qDWKz1dx2ulrtlulwvCMpbV6qlFmrJqqwzJoIUSewXcFWaPbKEuUTmBQOUO7ANsLnb UcZjHN9h5F5Wi3AYhQk134Lyqbq6v73hXN90+3c0t+vMW0FzstkX5LchmWj3eBtP8Cqv lYybFvE1bwXJBsXSbRavBbQcIxjYek5ecNlbKNabQRtaWWaeNwhcyR1SnNbWb9/dM1Hn 01pi2o8IlBKMuSEkPxPdeDTydEkmNjR2e/MtkYEapkgimWCtn9RB9cuw0iczaHyGmrye ZABn81sbq0e4iw2ZiJSHfty1VgNbJQlydXynw1DLWGFgyx3bycaWInHIba8Ctl1ad1Jv 387Q== X-Received: by 10.205.78.5 with SMTP id zk5mr16721829bkb.25.1379922900524; Mon, 23 Sep 2013 00:55:00 -0700 (PDT) Received: from topkick.lan (dslc-082-083-247-252.pools.arcor-ip.net. [82.83.247.252]) by mx.google.com with ESMTPSA id z6sm8146639bkn.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Sep 2013 00:54:59 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH v2 09/26] ARM: call of_clk_init from default time_init handler Date: Mon, 23 Sep 2013 09:54:30 +0200 Message-Id: <1379922870-2325-1-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1379526839-14798-10-git-send-email-sebastian.hesselbarth@gmail.com> References: <1379526839-14798-10-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130923_040329_184061_CB3F91F4 X-CRM114-Status: GOOD ( 14.28 ) X-Spam-Score: 1.4 (+) Cc: linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@stlinux.com, Arnd Bergmann , linux-kernel@vger.kernel.org, STEricsson , linux-rpi-kernel@lists.infradead.org, Olof Johansson , Russell King , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-3.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Most DT ARM machs require common clock providers initialized before timers. Currently, arch/arm machs use .init_time to call of_clk_init right before clocksource_of_init. This prevents to remove that callback and use the default one instead. This patch adds a call to of_clk_init() to the default .init_time callback for COMMON_CLK enabled machs to allow to remove custom callbacks where applicable. While at it, also reorder includes alphabetically. Signed-off-by: Sebastian Hesselbarth --- Changelog: v1->v2: - protect call to of_clk_init which is only available for COMMON_CLK to not break !COMMON_CLK machs. (Reported by Olof Johanssen) RFCv2->v1: - only call of_clk_init(NULL) when no custom .init_time is set (Suggested by Soeren Brinkmann) RFCv1->RFCv2: - reorder includes alphabetically Cc: Olof Johansson Cc: Arnd Bergmann Cc: Russell King Cc: STEricsson Cc: linux-tegra@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: kernel@stlinux.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/kernel/time.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 98aee32..829a96d 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -11,25 +11,26 @@ * This file contains the ARM-specific time handling details: * reading the RTC at bootup, etc... */ +#include +#include +#include #include -#include -#include -#include #include +#include +#include +#include +#include #include +#include #include +#include #include -#include -#include #include -#include -#include -#include -#include -#include #include #include +#include +#include #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \ defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) @@ -116,8 +117,12 @@ int __init register_persistent_clock(clock_access_fn read_boot, void __init time_init(void) { - if (machine_desc->init_time) + if (machine_desc->init_time) { machine_desc->init_time(); - else + } else { +#ifdef CONFIG_COMMON_CLK + of_clk_init(NULL); +#endif clocksource_of_init(); + } }