ARM: tegra: move tegra_cpu_car.h to linux/clk/tegra.h
authorPrashant Gaikwad <pgaikwad@nvidia.com>
Fri, 11 Jan 2013 07:46:21 +0000 (13:16 +0530)
committerStephen Warren <swarren@nvidia.com>
Mon, 28 Jan 2013 18:19:06 +0000 (11:19 -0700)
tegra_cpu_car_ops struct is going to be accessed from drivers/clk/tegra.
Move the tegra_cpu_car_ops to include/linux/clk/tegra.h.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/arm/mach-tegra/clock.c
arch/arm/mach-tegra/cpuidle-tegra30.c
arch/arm/mach-tegra/hotplug.c
arch/arm/mach-tegra/platsmp.c
arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/tegra20_clocks.c
arch/arm/mach-tegra/tegra20_clocks_data.c
arch/arm/mach-tegra/tegra30_clocks.c
arch/arm/mach-tegra/tegra30_clocks_data.c
arch/arm/mach-tegra/tegra_cpu_car.h [deleted file]
include/linux/clk/tegra.h [new file with mode: 0644]

index 867bf8bf556159ffcb12584d6d1bb8788ab7b821..8c0ff061f8cfb85a34ab019f66a073313becc62e 100644 (file)
 #include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
+#include <linux/clk/tegra.h>
 
 #include "board.h"
 #include "clock.h"
-#include "tegra_cpu_car.h"
 
 /* Global data of Tegra CPU CAR ops */
 struct tegra_cpu_car_ops *tegra_cpu_car_ops;
index 82530bd9b8c223fdd0c15090a081513fe2bb2616..8b50cf4ddd6f04819e0c8a69bf4bf7eb9d28ddc5 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/cpuidle.h>
 #include <linux/cpu_pm.h>
 #include <linux/clockchips.h>
+#include <linux/clk/tegra.h>
 
 #include <asm/cpuidle.h>
 #include <asm/proc-fns.h>
@@ -32,7 +33,6 @@
 
 #include "pm.h"
 #include "sleep.h"
-#include "tegra_cpu_car.h"
 
 #ifdef CONFIG_PM_SLEEP
 static int tegra30_idle_lp2(struct cpuidle_device *dev,
index 6a27de4001ee6d700b8b05642d9676a72b8356dd..a599f6e36dea49768c6eb18d9550b3d04fb9c1db 100644 (file)
  */
 #include <linux/kernel.h>
 #include <linux/smp.h>
+#include <linux/clk/tegra.h>
 
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
 
 #include "sleep.h"
-#include "tegra_cpu_car.h"
 
 static void (*tegra_hotplug_shutdown)(void);
 
index 68670304d9bc3ec770892a93cfc61148b71a3254..3ec7fc487857af2d3fa56152982ccbe4c6f8d459 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/jiffies.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/clk/tegra.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/gic.h>
@@ -30,7 +31,6 @@
 #include "fuse.h"
 #include "flowctrl.h"
 #include "reset.h"
-#include "tegra_cpu_car.h"
 
 #include "common.h"
 #include "iomap.h"
index 498d70b33775b24512a1ed0ca5f11aa6f77feda2..abfe9b93cc0cc69bf7818dac8607c9c51455620c 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/cpu_pm.h>
 #include <linux/clk.h>
 #include <linux/err.h>
+#include <linux/clk/tegra.h>
 
 #include <asm/smp_plat.h>
 #include <asm/cacheflush.h>
@@ -36,7 +37,6 @@
 #include "reset.h"
 #include "flowctrl.h"
 #include "sleep.h"
-#include "tegra_cpu_car.h"
 
 #define TEGRA_POWER_CPU_PWRREQ_OE      (1 << 16)  /* CPU pwr req enable */
 
index 4eb6bc81a87b4dd3c89dadacd8c78ed5670d5e81..1a80ff65e5fcfed7524c906b5799d4efd2535f1d 100644 (file)
 #include <linux/io.h>
 #include <linux/clkdev.h>
 #include <linux/clk.h>
+#include <linux/clk/tegra.h>
 
 #include "clock.h"
 #include "fuse.h"
 #include "iomap.h"
 #include "tegra2_emc.h"
-#include "tegra_cpu_car.h"
 
 #define RST_DEVICES                    0x004
 #define RST_DEVICES_SET                        0x300
index a23a0734e352c81afc59a97a18ec2d3d6588b756..022cdaef7ca5e56d5b5a725eedaf193d3ecc8000 100644 (file)
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/clk/tegra.h>
 
 #include "clock.h"
 #include "fuse.h"
 #include "tegra2_emc.h"
 #include "tegra20_clocks.h"
-#include "tegra_cpu_car.h"
 
 /* Clock definitions */
 
index d7147779f8ea8d45aaf220af9fe4eceb5c356837..4330787fe5cbabce7d5174e0612cd900434dd9ac 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/clk.h>
 #include <linux/cpufreq.h>
 #include <linux/syscore_ops.h>
+#include <linux/clk/tegra.h>
 
 #include <asm/clkdev.h>
 
@@ -36,7 +37,6 @@
 #include "clock.h"
 #include "fuse.h"
 #include "iomap.h"
-#include "tegra_cpu_car.h"
 
 #define USE_PLL_LOCK_BITS 0
 
index 741d264d5ecb4e3b75a1f3129632ee95429b50a4..9bfaa490cff6c0b7159fce0981c2b3cf3052441d 100644 (file)
 #include <linux/io.h>
 #include <linux/clk.h>
 #include <linux/cpufreq.h>
+#include <linux/clk/tegra.h>
 
 #include "clock.h"
 #include "fuse.h"
 #include "tegra30_clocks.h"
-#include "tegra_cpu_car.h"
 
 #define DEFINE_CLK_TEGRA(_name, _rate, _ops, _flags,           \
                   _parent_names, _parents, _parent)            \
diff --git a/arch/arm/mach-tegra/tegra_cpu_car.h b/arch/arm/mach-tegra/tegra_cpu_car.h
deleted file mode 100644 (file)
index 9764d31..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __MACH_TEGRA_CPU_CAR_H
-#define __MACH_TEGRA_CPU_CAR_H
-
-/*
- * Tegra CPU clock and reset control ops
- *
- * wait_for_reset:
- *     keep waiting until the CPU in reset state
- * put_in_reset:
- *     put the CPU in reset state
- * out_of_reset:
- *     release the CPU from reset state
- * enable_clock:
- *     CPU clock un-gate
- * disable_clock:
- *     CPU clock gate
- * rail_off_ready:
- *     CPU is ready for rail off
- * suspend:
- *     save the clock settings when CPU go into low-power state
- * resume:
- *     restore the clock settings when CPU exit low-power state
- */
-struct tegra_cpu_car_ops {
-       void (*wait_for_reset)(u32 cpu);
-       void (*put_in_reset)(u32 cpu);
-       void (*out_of_reset)(u32 cpu);
-       void (*enable_clock)(u32 cpu);
-       void (*disable_clock)(u32 cpu);
-#ifdef CONFIG_PM_SLEEP
-       bool (*rail_off_ready)(void);
-       void (*suspend)(void);
-       void (*resume)(void);
-#endif
-};
-
-extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
-
-static inline void tegra_wait_cpu_in_reset(u32 cpu)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->wait_for_reset))
-               return;
-
-       tegra_cpu_car_ops->wait_for_reset(cpu);
-}
-
-static inline void tegra_put_cpu_in_reset(u32 cpu)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->put_in_reset))
-               return;
-
-       tegra_cpu_car_ops->put_in_reset(cpu);
-}
-
-static inline void tegra_cpu_out_of_reset(u32 cpu)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->out_of_reset))
-               return;
-
-       tegra_cpu_car_ops->out_of_reset(cpu);
-}
-
-static inline void tegra_enable_cpu_clock(u32 cpu)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->enable_clock))
-               return;
-
-       tegra_cpu_car_ops->enable_clock(cpu);
-}
-
-static inline void tegra_disable_cpu_clock(u32 cpu)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->disable_clock))
-               return;
-
-       tegra_cpu_car_ops->disable_clock(cpu);
-}
-
-#ifdef CONFIG_PM_SLEEP
-static inline bool tegra_cpu_rail_off_ready(void)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready))
-               return false;
-
-       return tegra_cpu_car_ops->rail_off_ready();
-}
-
-static inline void tegra_cpu_clock_suspend(void)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->suspend))
-               return;
-
-       tegra_cpu_car_ops->suspend();
-}
-
-static inline void tegra_cpu_clock_resume(void)
-{
-       if (WARN_ON(!tegra_cpu_car_ops->resume))
-               return;
-
-       tegra_cpu_car_ops->resume();
-}
-#endif
-
-void tegra20_cpu_car_ops_init(void);
-void tegra30_cpu_car_ops_init(void);
-
-#endif /* __MACH_TEGRA_CPU_CAR_H */
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
new file mode 100644 (file)
index 0000000..0977f2a
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __LINUX_CLK_TEGRA_H_
+#define __LINUX_CLK_TEGRA_H_
+
+/*
+ * Tegra CPU clock and reset control ops
+ *
+ * wait_for_reset:
+ *     keep waiting until the CPU in reset state
+ * put_in_reset:
+ *     put the CPU in reset state
+ * out_of_reset:
+ *     release the CPU from reset state
+ * enable_clock:
+ *     CPU clock un-gate
+ * disable_clock:
+ *     CPU clock gate
+ * rail_off_ready:
+ *     CPU is ready for rail off
+ * suspend:
+ *     save the clock settings when CPU go into low-power state
+ * resume:
+ *     restore the clock settings when CPU exit low-power state
+ */
+struct tegra_cpu_car_ops {
+       void (*wait_for_reset)(u32 cpu);
+       void (*put_in_reset)(u32 cpu);
+       void (*out_of_reset)(u32 cpu);
+       void (*enable_clock)(u32 cpu);
+       void (*disable_clock)(u32 cpu);
+#ifdef CONFIG_PM_SLEEP
+       bool (*rail_off_ready)(void);
+       void (*suspend)(void);
+       void (*resume)(void);
+#endif
+};
+
+extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
+
+static inline void tegra_wait_cpu_in_reset(u32 cpu)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->wait_for_reset))
+               return;
+
+       tegra_cpu_car_ops->wait_for_reset(cpu);
+}
+
+static inline void tegra_put_cpu_in_reset(u32 cpu)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->put_in_reset))
+               return;
+
+       tegra_cpu_car_ops->put_in_reset(cpu);
+}
+
+static inline void tegra_cpu_out_of_reset(u32 cpu)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->out_of_reset))
+               return;
+
+       tegra_cpu_car_ops->out_of_reset(cpu);
+}
+
+static inline void tegra_enable_cpu_clock(u32 cpu)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->enable_clock))
+               return;
+
+       tegra_cpu_car_ops->enable_clock(cpu);
+}
+
+static inline void tegra_disable_cpu_clock(u32 cpu)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->disable_clock))
+               return;
+
+       tegra_cpu_car_ops->disable_clock(cpu);
+}
+
+#ifdef CONFIG_PM_SLEEP
+static inline bool tegra_cpu_rail_off_ready(void)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready))
+               return false;
+
+       return tegra_cpu_car_ops->rail_off_ready();
+}
+
+static inline void tegra_cpu_clock_suspend(void)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->suspend))
+               return;
+
+       tegra_cpu_car_ops->suspend();
+}
+
+static inline void tegra_cpu_clock_resume(void)
+{
+       if (WARN_ON(!tegra_cpu_car_ops->resume))
+               return;
+
+       tegra_cpu_car_ops->resume();
+}
+#endif
+
+void tegra20_cpu_car_ops_init(void);
+void tegra30_cpu_car_ops_init(void);
+
+#endif /* __LINUX_CLK_TEGRA_H_ */