diff options
author | Mike Turquette <mturquette@linaro.org> | 2014-06-10 19:53:25 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-06-10 19:53:25 -0400 |
commit | 3f6eec9969d24f91a3909d51e86e007ca5efd4c4 (patch) | |
tree | bff0f51bab78b18d52cfd57ad7cd8b78ac6a882c /arch/arm/mach-omap2 | |
parent | 963649d735c8b6eb0f97e82c54f02426ff3f1f45 (diff) | |
parent | 7e148070001ae82df08966199580a29b934e3bf3 (diff) |
Merge branch 'for-v3.16/ti-clk-drv' of github.com:t-kristo/linux-pm into clk-next
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 53 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.h | 13 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock2xxx.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dpll3xxx.c | 9 |
4 files changed, 62 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index b935ed2922d8..85e0b0c06718 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | |||
@@ -208,3 +208,56 @@ void omap2xxx_clkt_vps_late_init(void) | |||
208 | clk_put(c); | 208 | clk_put(c); |
209 | } | 209 | } |
210 | } | 210 | } |
211 | |||
212 | #ifdef CONFIG_OF | ||
213 | #include <linux/clk-provider.h> | ||
214 | #include <linux/clkdev.h> | ||
215 | |||
216 | static const struct clk_ops virt_prcm_set_ops = { | ||
217 | .recalc_rate = &omap2_table_mpu_recalc, | ||
218 | .set_rate = &omap2_select_table_rate, | ||
219 | .round_rate = &omap2_round_to_table_rate, | ||
220 | }; | ||
221 | |||
222 | /** | ||
223 | * omap2xxx_clkt_vps_init - initialize virt_prcm_set clock | ||
224 | * | ||
225 | * Does a manual init for the virtual prcm DVFS clock for OMAP2. This | ||
226 | * function is called only from omap2 DT clock init, as the virtual | ||
227 | * node is not modelled in the DT clock data. | ||
228 | */ | ||
229 | void omap2xxx_clkt_vps_init(void) | ||
230 | { | ||
231 | struct clk_init_data init = { NULL }; | ||
232 | struct clk_hw_omap *hw = NULL; | ||
233 | struct clk *clk; | ||
234 | const char *parent_name = "mpu_ck"; | ||
235 | struct clk_lookup *lookup = NULL; | ||
236 | |||
237 | omap2xxx_clkt_vps_late_init(); | ||
238 | omap2xxx_clkt_vps_check_bootloader_rates(); | ||
239 | |||
240 | hw = kzalloc(sizeof(*hw), GFP_KERNEL); | ||
241 | lookup = kzalloc(sizeof(*lookup), GFP_KERNEL); | ||
242 | if (!hw || !lookup) | ||
243 | goto cleanup; | ||
244 | init.name = "virt_prcm_set"; | ||
245 | init.ops = &virt_prcm_set_ops; | ||
246 | init.parent_names = &parent_name; | ||
247 | init.num_parents = 1; | ||
248 | |||
249 | hw->hw.init = &init; | ||
250 | |||
251 | clk = clk_register(NULL, &hw->hw); | ||
252 | |||
253 | lookup->dev_id = NULL; | ||
254 | lookup->con_id = "cpufreq_ck"; | ||
255 | lookup->clk = clk; | ||
256 | |||
257 | clkdev_add(lookup); | ||
258 | return; | ||
259 | cleanup: | ||
260 | kfree(hw); | ||
261 | kfree(lookup); | ||
262 | } | ||
263 | #endif | ||
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index bda767a9dea8..12f54d428d7c 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -178,17 +178,6 @@ struct clksel { | |||
178 | const struct clksel_rate *rates; | 178 | const struct clksel_rate *rates; |
179 | }; | 179 | }; |
180 | 180 | ||
181 | struct clk_hw_omap_ops { | ||
182 | void (*find_idlest)(struct clk_hw_omap *oclk, | ||
183 | void __iomem **idlest_reg, | ||
184 | u8 *idlest_bit, u8 *idlest_val); | ||
185 | void (*find_companion)(struct clk_hw_omap *oclk, | ||
186 | void __iomem **other_reg, | ||
187 | u8 *other_bit); | ||
188 | void (*allow_idle)(struct clk_hw_omap *oclk); | ||
189 | void (*deny_idle)(struct clk_hw_omap *oclk); | ||
190 | }; | ||
191 | |||
192 | unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw, | 181 | unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw, |
193 | unsigned long parent_rate); | 182 | unsigned long parent_rate); |
194 | 183 | ||
@@ -279,8 +268,6 @@ extern const struct clk_hw_omap_ops clkhwops_omap3430es2_hsotgusb_wait; | |||
279 | extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; | 268 | extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; |
280 | extern const struct clk_hw_omap_ops clkhwops_apll54; | 269 | extern const struct clk_hw_omap_ops clkhwops_apll54; |
281 | extern const struct clk_hw_omap_ops clkhwops_apll96; | 270 | extern const struct clk_hw_omap_ops clkhwops_apll96; |
282 | extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll; | ||
283 | extern const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait; | ||
284 | 271 | ||
285 | /* clksel_rate blocks shared between OMAP44xx and AM33xx */ | 272 | /* clksel_rate blocks shared between OMAP44xx and AM33xx */ |
286 | extern const struct clksel_rate div_1_0_rates[]; | 273 | extern const struct clksel_rate div_1_0_rates[]; |
diff --git a/arch/arm/mach-omap2/clock2xxx.h b/arch/arm/mach-omap2/clock2xxx.h index 539dc08afbba..45f41a411603 100644 --- a/arch/arm/mach-omap2/clock2xxx.h +++ b/arch/arm/mach-omap2/clock2xxx.h | |||
@@ -21,10 +21,6 @@ unsigned long omap2xxx_sys_clk_recalc(struct clk_hw *clk, | |||
21 | unsigned long parent_rate); | 21 | unsigned long parent_rate); |
22 | unsigned long omap2_osc_clk_recalc(struct clk_hw *clk, | 22 | unsigned long omap2_osc_clk_recalc(struct clk_hw *clk, |
23 | unsigned long parent_rate); | 23 | unsigned long parent_rate); |
24 | unsigned long omap2_dpllcore_recalc(struct clk_hw *hw, | ||
25 | unsigned long parent_rate); | ||
26 | int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate, | ||
27 | unsigned long parent_rate); | ||
28 | void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw); | 24 | void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw); |
29 | unsigned long omap2_clk_apll54_recalc(struct clk_hw *hw, | 25 | unsigned long omap2_clk_apll54_recalc(struct clk_hw *hw, |
30 | unsigned long parent_rate); | 26 | unsigned long parent_rate); |
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index fcd8036af910..6d7ba37e2257 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -319,6 +319,15 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel) | |||
319 | 319 | ||
320 | /* Set DPLL multiplier, divider */ | 320 | /* Set DPLL multiplier, divider */ |
321 | v = omap2_clk_readl(clk, dd->mult_div1_reg); | 321 | v = omap2_clk_readl(clk, dd->mult_div1_reg); |
322 | |||
323 | /* Handle Duty Cycle Correction */ | ||
324 | if (dd->dcc_mask) { | ||
325 | if (dd->last_rounded_rate >= dd->dcc_rate) | ||
326 | v |= dd->dcc_mask; /* Enable DCC */ | ||
327 | else | ||
328 | v &= ~dd->dcc_mask; /* Disable DCC */ | ||
329 | } | ||
330 | |||
322 | v &= ~(dd->mult_mask | dd->div1_mask); | 331 | v &= ~(dd->mult_mask | dd->div1_mask); |
323 | v |= dd->last_rounded_m << __ffs(dd->mult_mask); | 332 | v |= dd->last_rounded_m << __ffs(dd->mult_mask); |
324 | v |= (dd->last_rounded_n - 1) << __ffs(dd->div1_mask); | 333 | v |= (dd->last_rounded_n - 1) << __ffs(dd->div1_mask); |