]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: tegra: move timer.c to drivers/clocksource/
authorStephen Warren <swarren@nvidia.com>
Tue, 23 Oct 2012 17:52:53 +0000 (11:52 -0600)
committerStephen Warren <swarren@nvidia.com>
Mon, 28 Jan 2013 17:21:21 +0000 (10:21 -0700)
Move arch/arm/mach-tegra/timer.c to drivers/clocksource/tegra20_timer.c
so that the code is co-located with other clocksource drivers, and to
reduce the size of the mach-tegra directory.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/arm/Kconfig
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-dt-tegra20.c
arch/arm/mach-tegra/board-dt-tegra30.c
arch/arm/mach-tegra/board.h
drivers/clocksource/Makefile
drivers/clocksource/tegra20_timer.c [moved from arch/arm/mach-tegra/timer.c with 98% similarity]

index 67874b82a4edf318ae3718ae6137393140405586..eb9fc2f8acf10b2cd56a98430caf7246a9abc3a3 100644 (file)
@@ -642,6 +642,7 @@ config ARCH_TEGRA
        select ARCH_HAS_CPUFREQ
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
+       select CLKSRC_OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
index 0979e8bba78ae1c2d632ecd07f0092cce6f64a98..bd5d3120cb4bcc42504b6afb68dfcf9fef637ced 100644 (file)
@@ -2,7 +2,6 @@ obj-y                                   += common.o
 obj-y                                   += io.o
 obj-y                                   += irq.o
 obj-y                                   += clock.o
-obj-y                                   += timer.o
 obj-y                                  += fuse.o
 obj-y                                  += pmc.o
 obj-y                                  += flowctrl.o
index 3b9956aabf5ab5b7cb678a1e29b970263846a8b5..8e35aaea58459c695cb05679c63d513b46096e4f 100644 (file)
@@ -15,6 +15,7 @@
  *
  */
 
+#include <linux/clocksource.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
@@ -203,7 +204,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
        .init_early     = tegra20_init_early,
        .init_irq       = tegra_dt_init_irq,
        .handle_irq     = gic_handle_irq,
-       .init_time      = tegra_init_timer,
+       .init_time      = clocksource_of_init,
        .init_machine   = tegra_dt_init,
        .init_late      = tegra_dt_init_late,
        .restart        = tegra_assert_system_reset,
index 381b2f25f0b4f89ca191491121909e152e6278c9..a9ed15dcc3ede94aa5be0ecc45c485df0314552d 100644 (file)
@@ -23,6 +23,7 @@
  *
  */
 
+#include <linux/clocksource.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -113,7 +114,7 @@ DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
        .init_early     = tegra30_init_early,
        .init_irq       = tegra_dt_init_irq,
        .handle_irq     = gic_handle_irq,
-       .init_time      = tegra_init_timer,
+       .init_time      = clocksource_of_init,
        .init_machine   = tegra30_dt_init,
        .init_late      = tegra_init_late,
        .restart        = tegra_assert_system_reset,
index 744cdd246f6a26ccb00b52f7c16811548f3f585a..da8f5a3c424023b9754b99f1b4b0c647df01c879 100644 (file)
@@ -55,5 +55,4 @@ static inline int harmony_pcie_init(void) { return 0; }
 
 void __init tegra_paz00_wifikill_init(void);
 
-extern void tegra_init_timer(void);
 #endif
index a33f792402176f79a6c581eeed1e052b8c06d0da..b5cc50796a809e80f8623a77f0b22126d7bd8fea 100644 (file)
@@ -17,5 +17,6 @@ obj-$(CONFIG_CLKSRC_DBX500_PRCMU)     += clksrc-dbx500-prcmu.o
 obj-$(CONFIG_ARMADA_370_XP_TIMER)      += time-armada-370-xp.o
 obj-$(CONFIG_ARCH_BCM2835)     += bcm2835_timer.o
 obj-$(CONFIG_SUNXI_TIMER)      += sunxi_timer.o
+obj-$(CONFIG_ARCH_TEGRA)       += tegra20_timer.o
 
 obj-$(CONFIG_CLKSRC_ARM_GENERIC)       += arm_generic.o
similarity index 98%
rename from arch/arm/mach-tegra/timer.c
rename to drivers/clocksource/tegra20_timer.c
index b0036e519a1527c534d0208abbd9e6f524ca2008..3b2f94781df4808780b2ae44edeb2a14070550c8 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * arch/arch/mach-tegra/timer.c
- *
  * Copyright (C) 2010 Google, Inc.
  *
  * Author:
@@ -33,8 +31,6 @@
 #include <asm/smp_twd.h>
 #include <asm/sched_clock.h>
 
-#include "board.h"
-
 #define RTC_SECONDS            0x08
 #define RTC_SHADOW_SECONDS     0x0c
 #define RTC_MILLISECONDS       0x10
@@ -168,7 +164,7 @@ static const struct of_device_id rtc_match[] __initconst = {
        {}
 };
 
-void __init tegra_init_timer(void)
+static void __init tegra20_init_timer(void)
 {
        struct device_node *np;
        struct clk *clk;
@@ -272,6 +268,7 @@ void __init tegra_init_timer(void)
 #endif
        register_persistent_clock(NULL, tegra_read_persistent_clock);
 }
+CLOCKSOURCE_OF_DECLARE(tegra20, "nvidia,tegra20-timer", tegra20_init_timer);
 
 #ifdef CONFIG_PM
 static u32 usec_config;