From patchwork Mon Mar 25 13:30:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 2331241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 74BBADF24C for ; Mon, 25 Mar 2013 13:35:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK7VM-0003XW-Vl; Mon, 25 Mar 2013 13:32:05 +0000 Received: from mail.free-electrons.com ([94.23.35.102]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK7U1-00039t-LO for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 13:30:47 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 26CCBBAE; Mon, 25 Mar 2013 14:30:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 8E93C7F9; Mon, 25 Mar 2013 14:30:40 +0100 (CET) From: Maxime Ripard To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/10] clocksource: sunxi: make use of CLKSRC_OF Date: Mon, 25 Mar 2013 14:30:26 +0100 Message-Id: <1364218233-29636-4-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364218233-29636-1-git-send-email-maxime.ripard@free-electrons.com> References: <1364218233-29636-1-git-send-email-maxime.ripard@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130325_093041_922583_CEC7FC8E X-CRM114-Status: GOOD ( 16.14 ) X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , Thomas Gleixner , linux-kernel@vger.kernel.org, John Stultz , sunny@allwinnertech.com, shuge@allwinnertech.com, Maxime Ripard , kevin@allwinnertech.com 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 Using CLKSRC_OF allows to remove the SoC specific sunxi_timer.h header, and instead of using a custom init function in the machine definition use the standard clocksource_of_init function. Signed-off-by: Maxime Ripard --- arch/arm/mach-sunxi/Kconfig | 1 + arch/arm/mach-sunxi/sunxi.c | 4 ++-- drivers/clocksource/sunxi_timer.c | 3 ++- include/linux/sunxi_timer.h | 24 ------------------------ 4 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 include/linux/sunxi_timer.h diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 8709a39..06c2894 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -1,6 +1,7 @@ config ARCH_SUNXI bool "Allwinner A1X SOCs" if ARCH_MULTI_V7 select CLKSRC_MMIO + select CLKSRC_OF select COMMON_CLK select GENERIC_CLOCKEVENTS select GENERIC_IRQ_CHIP diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c index 23afb73..2c01182 100644 --- a/arch/arm/mach-sunxi/sunxi.c +++ b/arch/arm/mach-sunxi/sunxi.c @@ -10,6 +10,7 @@ * warranty of any kind, whether express or implied. */ +#include #include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include #include @@ -100,6 +100,6 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)") .init_irq = sunxi_init_irq, .handle_irq = sunxi_handle_irq, .restart = sunxi_restart, - .init_time = &sunxi_timer_init, + .init_time = clocksource_of_init, .dt_compat = sunxi_board_dt_compat, MACHINE_END diff --git a/drivers/clocksource/sunxi_timer.c b/drivers/clocksource/sunxi_timer.c index 7a3ea23..0b46b7f 100644 --- a/drivers/clocksource/sunxi_timer.c +++ b/drivers/clocksource/sunxi_timer.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #define TIMER_IRQ_EN_REG 0x00 @@ -158,3 +157,5 @@ void __init sunxi_timer_init(void) clockevents_config_and_register(&sunxi_clockevent, rate / TIMER_SCAL, 0x1, 0xff); } +CLOCKSOURCE_OF_DECLARE(sunxi, "allwinner,sun4i-timer", + sunxi_timer_init); diff --git a/include/linux/sunxi_timer.h b/include/linux/sunxi_timer.h deleted file mode 100644 index 1808178..0000000 --- a/include/linux/sunxi_timer.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012 Maxime Ripard - * - * Maxime Ripard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __SUNXI_TIMER_H -#define __SUNXI_TIMER_H - -#include - -void sunxi_timer_init(void); - -#endif