diff options
author | Prashant Gaikwad <pgaikwad@nvidia.com> | 2013-01-11 02:46:26 -0500 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-01-28 13:19:07 -0500 |
commit | 61fd290d213e25d5a119b8ca25644001ed9f8f2d (patch) | |
tree | 16d8d1da34b5970985145c14cd6b8a624486abba /drivers/clk/tegra/clk-periph.c | |
parent | b08e8c0ecc42afa3a2e1019851af741980dd5a6b (diff) |
ARM: tegra: migrate to new clock code
Migrate Tegra clock support to drivers/clk/tegra, this involves
moving:
1. definition of tegra_cpu_car_ops to clk.c
2. definition of reset functions to clk-peripheral.c
3. change parent of cpu clock.
4. Remove legacy clock initialization.
5. Initialize clocks using DT.
6. Remove all instance of mach/clk.h
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
[swarren: use to_clk_periph_gate().]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/clk/tegra/clk-periph.c')
-rw-r--r-- | drivers/clk/tegra/clk-periph.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c index 5978e81b175b..788486e6331a 100644 --- a/drivers/clk/tegra/clk-periph.c +++ b/drivers/clk/tegra/clk-periph.c | |||
@@ -110,6 +110,44 @@ static void clk_periph_disable(struct clk_hw *hw) | |||
110 | gate_ops->disable(gate_hw); | 110 | gate_ops->disable(gate_hw); |
111 | } | 111 | } |
112 | 112 | ||
113 | void tegra_periph_reset_deassert(struct clk *c) | ||
114 | { | ||
115 | struct clk_hw *hw = __clk_get_hw(c); | ||
116 | struct tegra_clk_periph *periph = to_clk_periph(hw); | ||
117 | struct tegra_clk_periph_gate *gate; | ||
118 | |||
119 | if (periph->magic != TEGRA_CLK_PERIPH_MAGIC) { | ||
120 | gate = to_clk_periph_gate(hw); | ||
121 | if (gate->magic != TEGRA_CLK_PERIPH_GATE_MAGIC) { | ||
122 | WARN_ON(1); | ||
123 | return; | ||
124 | } | ||
125 | } else { | ||
126 | gate = &periph->gate; | ||
127 | } | ||
128 | |||
129 | tegra_periph_reset(gate, 0); | ||
130 | } | ||
131 | |||
132 | void tegra_periph_reset_assert(struct clk *c) | ||
133 | { | ||
134 | struct clk_hw *hw = __clk_get_hw(c); | ||
135 | struct tegra_clk_periph *periph = to_clk_periph(hw); | ||
136 | struct tegra_clk_periph_gate *gate; | ||
137 | |||
138 | if (periph->magic != TEGRA_CLK_PERIPH_MAGIC) { | ||
139 | gate = to_clk_periph_gate(hw); | ||
140 | if (gate->magic != TEGRA_CLK_PERIPH_GATE_MAGIC) { | ||
141 | WARN_ON(1); | ||
142 | return; | ||
143 | } | ||
144 | } else { | ||
145 | gate = &periph->gate; | ||
146 | } | ||
147 | |||
148 | tegra_periph_reset(gate, 1); | ||
149 | } | ||
150 | |||
113 | const struct clk_ops tegra_clk_periph_ops = { | 151 | const struct clk_ops tegra_clk_periph_ops = { |
114 | .get_parent = clk_periph_get_parent, | 152 | .get_parent = clk_periph_get_parent, |
115 | .set_parent = clk_periph_set_parent, | 153 | .set_parent = clk_periph_set_parent, |