Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tero Kristo and committed by
Stephen Boyd
c5cc2a0b fefe0535

+5
+3
drivers/clk/ti/clkt_dpll.c
··· 301 301 302 302 dd = clk->dpll_data; 303 303 304 + if (dd->max_rate && target_rate > dd->max_rate) 305 + target_rate = dd->max_rate; 306 + 304 307 ref_rate = clk_hw_get_rate(dd->clk_ref); 305 308 clk_name = clk_hw_get_name(hw); 306 309 pr_debug("clock: %s: starting DPLL round_rate, target rate %lu\n",
+2
include/linux/clk/ti.h
··· 37 37 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate() 38 38 * @min_divider: minimum valid non-bypass divider value (actual) 39 39 * @max_divider: maximum valid non-bypass divider value (actual) 40 + * @max_rate: maximum clock rate for the DPLL 40 41 * @modes: possible values of @enable_mask 41 42 * @autoidle_reg: register containing the DPLL autoidle mode bitfield 42 43 * @idlest_reg: register containing the DPLL idle status bitfield ··· 82 81 u8 last_rounded_n; 83 82 u8 min_divider; 84 83 u16 max_divider; 84 + unsigned long max_rate; 85 85 u8 modes; 86 86 void __iomem *autoidle_reg; 87 87 void __iomem *idlest_reg;