Skip to content

Commit c5cc2a0

Browse files
Tero Kristobebarino
authored andcommitted
clk: ti: dpll: add support for specifying max rate for DPLLs
DPLLs typically have a maximum rate they can support, and this varies from DPLL to DPLL. Add support of the maximum rate value to the DPLL data struct, and also add check for this in the DPLL round_rate function. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Nishanth Menon <nm@ti.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
1 parent fefe053 commit c5cc2a0

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/clk/ti/clkt_dpll.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
301301

302302
dd = clk->dpll_data;
303303

304+
if (dd->max_rate && target_rate > dd->max_rate)
305+
target_rate = dd->max_rate;
306+
304307
ref_rate = clk_hw_get_rate(dd->clk_ref);
305308
clk_name = clk_hw_get_name(hw);
306309
pr_debug("clock: %s: starting DPLL round_rate, target rate %lu\n",

‎include/linux/clk/ti.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
3838
* @min_divider: minimum valid non-bypass divider value (actual)
3939
* @max_divider: maximum valid non-bypass divider value (actual)
40+
* @max_rate: maximum clock rate for the DPLL
4041
* @modes: possible values of @enable_mask
4142
* @autoidle_reg: register containing the DPLL autoidle mode bitfield
4243
* @idlest_reg: register containing the DPLL idle status bitfield
@@ -81,6 +82,7 @@ struct dpll_data {
8182
u8 last_rounded_n;
8283
u8 min_divider;
8384
u16 max_divider;
85+
unsigned long max_rate;
8486
u8 modes;
8587
void __iomem *autoidle_reg;
8688
void __iomem *idlest_reg;

0 commit comments

Comments
 (0)