aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2015-01-23 06:03:31 -0500
committerMichael Turquette <mturquette@linaro.org>2015-02-02 17:23:42 -0500
commit1c8e600440c7f5036bd9a94526d01e9c7cb68dca (patch)
tree36c9811e976332bc23a00a6fb216dce5e6b55a5a /arch/mips
parentb09d6d99102504a929cfaba4cd0e07658d7f01d1 (diff)
clk: Add rate constraints to clocks
Adds a way for clock consumers to set maximum and minimum rates. This can be used for thermal drivers to set minimum rates, or by misc. drivers to set maximum rates to assure a minimum performance level. Changes the signature of the determine_rate callback by adding the parameters min_rate and max_rate. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> [sboyd@codeaurora.org: set req_rate in __clk_init] Signed-off-by: Michael Turquette <mturquette@linaro.org> [mturquette@linaro.org: min/max rate for sun6i_ahb1_clk_determine_rate migrated clk-private.h changes to clk.c]
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/alchemy/common/clock.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/mips/alchemy/common/clock.c b/arch/mips/alchemy/common/clock.c
index 48a9dfc55b51..4e65404b3ba3 100644
--- a/arch/mips/alchemy/common/clock.c
+++ b/arch/mips/alchemy/common/clock.c
@@ -373,6 +373,8 @@ static long alchemy_calc_div(unsigned long rate, unsigned long prate,
373} 373}
374 374
375static long alchemy_clk_fgcs_detr(struct clk_hw *hw, unsigned long rate, 375static long alchemy_clk_fgcs_detr(struct clk_hw *hw, unsigned long rate,
376 unsigned long min_rate,
377 unsigned long max_rate,
376 unsigned long *best_parent_rate, 378 unsigned long *best_parent_rate,
377 struct clk_hw **best_parent_clk, 379 struct clk_hw **best_parent_clk,
378 int scale, int maxdiv) 380 int scale, int maxdiv)
@@ -546,6 +548,8 @@ static unsigned long alchemy_clk_fgv1_recalc(struct clk_hw *hw,
546} 548}
547 549
548static long alchemy_clk_fgv1_detr(struct clk_hw *hw, unsigned long rate, 550static long alchemy_clk_fgv1_detr(struct clk_hw *hw, unsigned long rate,
551 unsigned long min_rate,
552 unsigned long max_rate,
549 unsigned long *best_parent_rate, 553 unsigned long *best_parent_rate,
550 struct clk_hw **best_parent_clk) 554 struct clk_hw **best_parent_clk)
551{ 555{
@@ -678,6 +682,8 @@ static unsigned long alchemy_clk_fgv2_recalc(struct clk_hw *hw,
678} 682}
679 683
680static long alchemy_clk_fgv2_detr(struct clk_hw *hw, unsigned long rate, 684static long alchemy_clk_fgv2_detr(struct clk_hw *hw, unsigned long rate,
685 unsigned long min_rate,
686 unsigned long max_rate,
681 unsigned long *best_parent_rate, 687 unsigned long *best_parent_rate,
682 struct clk_hw **best_parent_clk) 688 struct clk_hw **best_parent_clk)
683{ 689{
@@ -897,6 +903,8 @@ static int alchemy_clk_csrc_setr(struct clk_hw *hw, unsigned long rate,
897} 903}
898 904
899static long alchemy_clk_csrc_detr(struct clk_hw *hw, unsigned long rate, 905static long alchemy_clk_csrc_detr(struct clk_hw *hw, unsigned long rate,
906 unsigned long min_rate,
907 unsigned long max_rate,
900 unsigned long *best_parent_rate, 908 unsigned long *best_parent_rate,
901 struct clk_hw **best_parent_clk) 909 struct clk_hw **best_parent_clk)
902{ 910{