diff options
author | Peter De Schrijver <pdeschrijver@nvidia.com> | 2013-11-18 10:11:38 -0500 |
---|---|---|
committer | Peter De Schrijver <pdeschrijver@nvidia.com> | 2013-11-26 11:46:53 -0500 |
commit | b29f9e926442c35bd42ebd283aaed0de2c4f1477 (patch) | |
tree | 478f053f15bf821bb82c7d8bc58ea1c861338082 /drivers/clk/tegra/clk-periph.c | |
parent | bc44275b8ea2df7c77658b08955ec545a37560ab (diff) |
clk: tegra: add TEGRA_PERIPH_NO_GATE
Tegra124 has a clock which consists of a mux and a fractional divider.
Add support for this.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/clk/tegra/clk-periph.c')
-rw-r--r-- | drivers/clk/tegra/clk-periph.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c index b5feccca2f1e..d62b396863c1 100644 --- a/drivers/clk/tegra/clk-periph.c +++ b/drivers/clk/tegra/clk-periph.c | |||
@@ -170,6 +170,14 @@ const struct clk_ops tegra_clk_periph_nodiv_ops = { | |||
170 | .disable = clk_periph_disable, | 170 | .disable = clk_periph_disable, |
171 | }; | 171 | }; |
172 | 172 | ||
173 | const struct clk_ops tegra_clk_periph_no_gate_ops = { | ||
174 | .get_parent = clk_periph_get_parent, | ||
175 | .set_parent = clk_periph_set_parent, | ||
176 | .recalc_rate = clk_periph_recalc_rate, | ||
177 | .round_rate = clk_periph_round_rate, | ||
178 | .set_rate = clk_periph_set_rate, | ||
179 | }; | ||
180 | |||
173 | static struct clk *_tegra_clk_register_periph(const char *name, | 181 | static struct clk *_tegra_clk_register_periph(const char *name, |
174 | const char **parent_names, int num_parents, | 182 | const char **parent_names, int num_parents, |
175 | struct tegra_clk_periph *periph, | 183 | struct tegra_clk_periph *periph, |
@@ -181,11 +189,15 @@ static struct clk *_tegra_clk_register_periph(const char *name, | |||
181 | struct tegra_clk_periph_regs *bank; | 189 | struct tegra_clk_periph_regs *bank; |
182 | bool div = !(periph->gate.flags & TEGRA_PERIPH_NO_DIV); | 190 | bool div = !(periph->gate.flags & TEGRA_PERIPH_NO_DIV); |
183 | 191 | ||
184 | flags |= periph->gate.flags & TEGRA_PERIPH_NO_DIV ? | 192 | if (periph->gate.flags & TEGRA_PERIPH_NO_DIV) { |
185 | CLK_SET_RATE_PARENT : 0; | 193 | flags |= CLK_SET_RATE_PARENT; |
194 | init.ops = &tegra_clk_periph_nodiv_ops; | ||
195 | } else if (periph->gate.flags & TEGRA_PERIPH_NO_GATE) | ||
196 | init.ops = &tegra_clk_periph_no_gate_ops; | ||
197 | else | ||
198 | init.ops = &tegra_clk_periph_ops; | ||
186 | 199 | ||
187 | init.name = name; | 200 | init.name = name; |
188 | init.ops = div ? &tegra_clk_periph_ops : &tegra_clk_periph_nodiv_ops; | ||
189 | init.flags = flags; | 201 | init.flags = flags; |
190 | init.parent_names = parent_names; | 202 | init.parent_names = parent_names; |
191 | init.num_parents = num_parents; | 203 | init.num_parents = num_parents; |