diff options
| -rw-r--r-- | arch/arm/mach-omap2/clock3xxx.c | 36 | ||||
| -rw-r--r-- | include/linux/clk/ti.h | 2 |
2 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c index 9a2560181909..a9e86db5daf9 100644 --- a/arch/arm/mach-omap2/clock3xxx.c +++ b/arch/arm/mach-omap2/clock3xxx.c | |||
| @@ -38,6 +38,18 @@ | |||
| 38 | 38 | ||
| 39 | /* needed by omap3_core_dpll_m2_set_rate() */ | 39 | /* needed by omap3_core_dpll_m2_set_rate() */ |
| 40 | struct clk *sdrc_ick_p, *arm_fck_p; | 40 | struct clk *sdrc_ick_p, *arm_fck_p; |
| 41 | |||
| 42 | /** | ||
| 43 | * omap3_dpll4_set_rate - set rate for omap3 per-dpll | ||
| 44 | * @hw: clock to change | ||
| 45 | * @rate: target rate for clock | ||
| 46 | * @parent_rate: rate of the parent clock | ||
| 47 | * | ||
| 48 | * Check if the current SoC supports the per-dpll reprogram operation | ||
| 49 | * or not, and then do the rate change if supported. Returns -EINVAL | ||
| 50 | * if not supported, 0 for success, and potential error codes from the | ||
| 51 | * clock rate change. | ||
| 52 | */ | ||
| 41 | int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate, | 53 | int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate, |
| 42 | unsigned long parent_rate) | 54 | unsigned long parent_rate) |
| 43 | { | 55 | { |
| @@ -54,6 +66,30 @@ int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate, | |||
| 54 | return omap3_noncore_dpll_set_rate(hw, rate, parent_rate); | 66 | return omap3_noncore_dpll_set_rate(hw, rate, parent_rate); |
| 55 | } | 67 | } |
| 56 | 68 | ||
| 69 | /** | ||
| 70 | * omap3_dpll4_set_rate_and_parent - set rate and parent for omap3 per-dpll | ||
| 71 | * @hw: clock to change | ||
| 72 | * @rate: target rate for clock | ||
| 73 | * @parent_rate: rate of the parent clock | ||
| 74 | * @index: parent index, 0 - reference clock, 1 - bypass clock | ||
| 75 | * | ||
| 76 | * Check if the current SoC support the per-dpll reprogram operation | ||
| 77 | * or not, and then do the rate + parent change if supported. Returns | ||
| 78 | * -EINVAL if not supported, 0 for success, and potential error codes | ||
| 79 | * from the clock rate change. | ||
| 80 | */ | ||
| 81 | int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, | ||
| 82 | unsigned long parent_rate, u8 index) | ||
| 83 | { | ||
| 84 | if (ti_clk_features.flags & TI_CLK_DPLL4_DENY_REPROGRAM) { | ||
| 85 | pr_err("clock: DPLL4 cannot change rate due to silicon 'Limitation 2.5' on 3430ES1.\n"); | ||
| 86 | return -EINVAL; | ||
| 87 | } | ||
| 88 | |||
| 89 | return omap3_noncore_dpll_set_rate_and_parent(hw, rate, parent_rate, | ||
| 90 | index); | ||
| 91 | } | ||
| 92 | |||
| 57 | void __init omap3_clk_lock_dpll5(void) | 93 | void __init omap3_clk_lock_dpll5(void) |
| 58 | { | 94 | { |
| 59 | struct clk *dpll5_clk; | 95 | struct clk *dpll5_clk; |
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index abc702a73aca..74e5341463c9 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
| @@ -291,6 +291,8 @@ int omap2_clk_disable_autoidle_all(void); | |||
| 291 | void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); | 291 | void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); |
| 292 | int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate, | 292 | int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate, |
| 293 | unsigned long parent_rate); | 293 | unsigned long parent_rate); |
| 294 | int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, | ||
| 295 | unsigned long parent_rate, u8 index); | ||
| 294 | int omap2_dflt_clk_enable(struct clk_hw *hw); | 296 | int omap2_dflt_clk_enable(struct clk_hw *hw); |
| 295 | void omap2_dflt_clk_disable(struct clk_hw *hw); | 297 | void omap2_dflt_clk_disable(struct clk_hw *hw); |
| 296 | int omap2_dflt_clk_is_enabled(struct clk_hw *hw); | 298 | int omap2_dflt_clk_is_enabled(struct clk_hw *hw); |
