diff options
Diffstat (limited to 'arch/arm/mach-omap2/clock3xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/clock3xxx.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c index 0b02b4161d71..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 | { |
@@ -46,7 +58,7 @@ int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate, | |||
46 | * on 3430ES1 prevents us from changing DPLL multipliers or dividers | 58 | * on 3430ES1 prevents us from changing DPLL multipliers or dividers |
47 | * on DPLL4. | 59 | * on DPLL4. |
48 | */ | 60 | */ |
49 | if (omap_rev() == OMAP3430_REV_ES1_0) { | 61 | if (ti_clk_features.flags & TI_CLK_DPLL4_DENY_REPROGRAM) { |
50 | pr_err("clock: DPLL4 cannot change rate due to silicon 'Limitation 2.5' on 3430ES1.\n"); | 62 | pr_err("clock: DPLL4 cannot change rate due to silicon 'Limitation 2.5' on 3430ES1.\n"); |
51 | return -EINVAL; | 63 | return -EINVAL; |
52 | } | 64 | } |
@@ -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; |