aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clk
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:27:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:27:22 -0500
commitbab588fcfb6335c767d811a8955979f5440328e0 (patch)
tree2a862ddf47a82be885a8e7945a17cc3ff7a658b9 /include/linux/clk
parent3298a3511f1e73255a8dc023efd909e569eea037 (diff)
parent9cb0d1babfcb1b4ac248c09425f7d5de1e771133 (diff)
Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC-specific updates from Arnd Bergmann: "This is a larger set of new functionality for the existing SoC families, including: - vt8500 gains support for new CPU cores, notably the Cortex-A9 based wm8850 - prima2 gains support for the "marco" SoC family, its SMP based cousin - tegra gains support for the new Tegra4 (Tegra114) family - socfpga now supports a newer version of the hardware including SMP - i.mx31 and bcm2835 are now using DT probing for their clocks - lots of updates for sh-mobile - OMAP updates for clocks, power management and USB - i.mx6q and tegra now support cpuidle - kirkwood now supports PCIe hot plugging - tegra clock support is updated - tegra USB PHY probing gets implemented diffently" * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (148 commits) ARM: prima2: remove duplicate v7_invalidate_l1 ARM: shmobile: r8a7779: Correct TMU clock support again ARM: prima2: fix __init section for cpu hotplug ARM: OMAP: Consolidate OMAP USB-HS platform data (part 3/3) ARM: OMAP: Consolidate OMAP USB-HS platform data (part 1/3) arm: socfpga: Add SMP support for actual socfpga harware arm: Add v7_invalidate_l1 to cache-v7.S arm: socfpga: Add entries to enable make dtbs socfpga arm: socfpga: Add new device tree source for actual socfpga HW ARM: tegra: sort Kconfig selects for Tegra114 ARM: tegra: enable ARCH_REQUIRE_GPIOLIB for Tegra114 ARM: tegra: Fix build error w/ ARCH_TEGRA_114_SOC w/o ARCH_TEGRA_3x_SOC ARM: tegra: Fix build error for gic update ARM: tegra: remove empty tegra_smp_init_cpus() ARM: shmobile: Register ARM architected timer ARM: MARCO: fix the build issue due to gic-vic-to-irqchip move ARM: shmobile: r8a7779: Correct TMU clock support ARM: mxs_defconfig: Select CONFIG_DEVTMPFS_MOUNT ARM: mxs: decrease mxs_clockevent_device.min_delta_ns to 2 clock cycles ARM: mxs: use apbx bus clock to drive the timers on timrotv2 ...
Diffstat (limited to 'include/linux/clk')
-rw-r--r--include/linux/clk/tegra.h127
1 files changed, 127 insertions, 0 deletions
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
new file mode 100644
index 000000000000..404d6f940872
--- /dev/null
+++ b/include/linux/clk/tegra.h
@@ -0,0 +1,127 @@
1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __LINUX_CLK_TEGRA_H_
18#define __LINUX_CLK_TEGRA_H_
19
20#include <linux/clk.h>
21
22/*
23 * Tegra CPU clock and reset control ops
24 *
25 * wait_for_reset:
26 * keep waiting until the CPU in reset state
27 * put_in_reset:
28 * put the CPU in reset state
29 * out_of_reset:
30 * release the CPU from reset state
31 * enable_clock:
32 * CPU clock un-gate
33 * disable_clock:
34 * CPU clock gate
35 * rail_off_ready:
36 * CPU is ready for rail off
37 * suspend:
38 * save the clock settings when CPU go into low-power state
39 * resume:
40 * restore the clock settings when CPU exit low-power state
41 */
42struct tegra_cpu_car_ops {
43 void (*wait_for_reset)(u32 cpu);
44 void (*put_in_reset)(u32 cpu);
45 void (*out_of_reset)(u32 cpu);
46 void (*enable_clock)(u32 cpu);
47 void (*disable_clock)(u32 cpu);
48#ifdef CONFIG_PM_SLEEP
49 bool (*rail_off_ready)(void);
50 void (*suspend)(void);
51 void (*resume)(void);
52#endif
53};
54
55extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
56
57static inline void tegra_wait_cpu_in_reset(u32 cpu)
58{
59 if (WARN_ON(!tegra_cpu_car_ops->wait_for_reset))
60 return;
61
62 tegra_cpu_car_ops->wait_for_reset(cpu);
63}
64
65static inline void tegra_put_cpu_in_reset(u32 cpu)
66{
67 if (WARN_ON(!tegra_cpu_car_ops->put_in_reset))
68 return;
69
70 tegra_cpu_car_ops->put_in_reset(cpu);
71}
72
73static inline void tegra_cpu_out_of_reset(u32 cpu)
74{
75 if (WARN_ON(!tegra_cpu_car_ops->out_of_reset))
76 return;
77
78 tegra_cpu_car_ops->out_of_reset(cpu);
79}
80
81static inline void tegra_enable_cpu_clock(u32 cpu)
82{
83 if (WARN_ON(!tegra_cpu_car_ops->enable_clock))
84 return;
85
86 tegra_cpu_car_ops->enable_clock(cpu);
87}
88
89static inline void tegra_disable_cpu_clock(u32 cpu)
90{
91 if (WARN_ON(!tegra_cpu_car_ops->disable_clock))
92 return;
93
94 tegra_cpu_car_ops->disable_clock(cpu);
95}
96
97#ifdef CONFIG_PM_SLEEP
98static inline bool tegra_cpu_rail_off_ready(void)
99{
100 if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready))
101 return false;
102
103 return tegra_cpu_car_ops->rail_off_ready();
104}
105
106static inline void tegra_cpu_clock_suspend(void)
107{
108 if (WARN_ON(!tegra_cpu_car_ops->suspend))
109 return;
110
111 tegra_cpu_car_ops->suspend();
112}
113
114static inline void tegra_cpu_clock_resume(void)
115{
116 if (WARN_ON(!tegra_cpu_car_ops->resume))
117 return;
118
119 tegra_cpu_car_ops->resume();
120}
121#endif
122
123void tegra_periph_reset_deassert(struct clk *c);
124void tegra_periph_reset_assert(struct clk *c);
125void tegra_clocks_init(void);
126
127#endif /* __LINUX_CLK_TEGRA_H_ */