Home
last modified time | relevance | path

Searched refs:parent_rate (Results 1 – 25 of 215) sorted by relevance

123456789

/linux-4.19.296/drivers/clk/imx/
Dclk-pllv3.c116 unsigned long parent_rate) in clk_pllv3_recalc_rate() argument
121 return (div == 1) ? parent_rate * 22 : parent_rate * 20; in clk_pllv3_recalc_rate()
127 unsigned long parent_rate = *prate; in clk_pllv3_round_rate() local
129 return (rate >= parent_rate * 22) ? parent_rate * 22 : in clk_pllv3_round_rate()
130 parent_rate * 20; in clk_pllv3_round_rate()
134 unsigned long parent_rate) in clk_pllv3_set_rate() argument
139 if (rate == parent_rate * 22) in clk_pllv3_set_rate()
141 else if (rate == parent_rate * 20) in clk_pllv3_set_rate()
164 unsigned long parent_rate) in clk_pllv3_sys_recalc_rate() argument
169 return parent_rate * div / 2; in clk_pllv3_sys_recalc_rate()
[all …]
/linux-4.19.296/drivers/clk/at91/
Dclk-h32mx.c34 unsigned long parent_rate) in clk_sama5d4_h32mx_recalc_rate() argument
41 return parent_rate / 2; in clk_sama5d4_h32mx_recalc_rate()
43 if (parent_rate > H32MX_MAX_FREQ) in clk_sama5d4_h32mx_recalc_rate()
45 return parent_rate; in clk_sama5d4_h32mx_recalc_rate()
49 unsigned long *parent_rate) in clk_sama5d4_h32mx_round_rate() argument
53 if (rate > *parent_rate) in clk_sama5d4_h32mx_round_rate()
54 return *parent_rate; in clk_sama5d4_h32mx_round_rate()
55 div = *parent_rate / 2; in clk_sama5d4_h32mx_round_rate()
59 if (rate - div < *parent_rate - rate) in clk_sama5d4_h32mx_round_rate()
62 return *parent_rate; in clk_sama5d4_h32mx_round_rate()
[all …]
Dclk-plldiv.c28 unsigned long parent_rate) in clk_plldiv_recalc_rate() argument
36 return parent_rate / 2; in clk_plldiv_recalc_rate()
38 return parent_rate; in clk_plldiv_recalc_rate()
42 unsigned long *parent_rate) in clk_plldiv_round_rate() argument
46 if (rate > *parent_rate) in clk_plldiv_round_rate()
47 return *parent_rate; in clk_plldiv_round_rate()
48 div = *parent_rate / 2; in clk_plldiv_round_rate()
52 if (rate - div < *parent_rate - rate) in clk_plldiv_round_rate()
55 return *parent_rate; in clk_plldiv_round_rate()
59 unsigned long parent_rate) in clk_plldiv_set_rate() argument
[all …]
Dclk-audio-pll.c162 static unsigned long clk_audio_pll_fout(unsigned long parent_rate, in clk_audio_pll_fout() argument
165 unsigned long long fr = (unsigned long long)parent_rate * fracr; in clk_audio_pll_fout()
173 return parent_rate * (nd + 1) + fr; in clk_audio_pll_fout()
177 unsigned long parent_rate) in clk_audio_pll_frac_recalc_rate() argument
182 fout = clk_audio_pll_fout(parent_rate, frac->nd, frac->fracr); in clk_audio_pll_frac_recalc_rate()
191 unsigned long parent_rate) in clk_audio_pll_pad_recalc_rate() argument
197 apad_rate = parent_rate / (apad_ck->qdaudio * apad_ck->div); in clk_audio_pll_pad_recalc_rate()
206 unsigned long parent_rate) in clk_audio_pll_pmc_recalc_rate() argument
211 apmc_rate = parent_rate / (apmc_ck->qdpmc + 1); in clk_audio_pll_pmc_recalc_rate()
220 unsigned long parent_rate, in clk_audio_pll_frac_compute_frac() argument
[all …]
Dclk-smd.c34 unsigned long parent_rate) in at91sam9x5_clk_smd_recalc_rate() argument
43 return parent_rate / (smddiv + 1); in at91sam9x5_clk_smd_recalc_rate()
47 unsigned long *parent_rate) in at91sam9x5_clk_smd_round_rate() argument
53 if (rate >= *parent_rate) in at91sam9x5_clk_smd_round_rate()
54 return *parent_rate; in at91sam9x5_clk_smd_round_rate()
56 div = *parent_rate / rate; in at91sam9x5_clk_smd_round_rate()
58 return *parent_rate / (SMD_MAX_DIV + 1); in at91sam9x5_clk_smd_round_rate()
60 bestrate = *parent_rate / div; in at91sam9x5_clk_smd_round_rate()
61 tmp = *parent_rate / (div + 1); in at91sam9x5_clk_smd_round_rate()
92 unsigned long parent_rate) in at91sam9x5_clk_smd_set_rate() argument
[all …]
/linux-4.19.296/drivers/clk/actions/
Dowl-factor.c45 unsigned long rate, unsigned long parent_rate) in _get_table_val() argument
52 calc_rate = parent_rate * clkt->mul; in _get_table_val()
72 unsigned long parent_rate, try_parent_rate, best = 0, cur_rate; in owl_clk_val_best() local
80 parent_rate = *best_parent_rate; in owl_clk_val_best()
81 bestval = _get_table_val(clkt, rate, parent_rate); in owl_clk_val_best()
101 parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), in owl_clk_val_best()
103 cur_rate = DIV_ROUND_UP(parent_rate, clkt->div) * clkt->mul; in owl_clk_val_best()
107 *best_parent_rate = parent_rate; in owl_clk_val_best()
123 unsigned long *parent_rate) in owl_factor_helper_round_rate() argument
128 val = owl_clk_val_best(factor_hw, &common->hw, rate, parent_rate); in owl_factor_helper_round_rate()
[all …]
Dowl-composite.c57 unsigned long *parent_rate) in owl_comp_div_round_rate() argument
62 rate, parent_rate); in owl_comp_div_round_rate()
66 unsigned long parent_rate) in owl_comp_div_recalc_rate() argument
71 parent_rate); in owl_comp_div_recalc_rate()
75 unsigned long parent_rate) in owl_comp_div_set_rate() argument
80 rate, parent_rate); in owl_comp_div_set_rate()
84 unsigned long *parent_rate) in owl_comp_fact_round_rate() argument
90 rate, parent_rate); in owl_comp_fact_round_rate()
94 unsigned long parent_rate) in owl_comp_fact_recalc_rate() argument
100 parent_rate); in owl_comp_fact_recalc_rate()
[all …]
Dowl-divider.c19 unsigned long *parent_rate) in owl_divider_helper_round_rate() argument
21 return divider_round_rate(&common->hw, rate, parent_rate, in owl_divider_helper_round_rate()
27 unsigned long *parent_rate) in owl_divider_round_rate() argument
32 rate, parent_rate); in owl_divider_round_rate()
37 unsigned long parent_rate) in owl_divider_helper_recalc_rate() argument
46 return divider_recalc_rate(&common->hw, parent_rate, in owl_divider_helper_recalc_rate()
53 unsigned long parent_rate) in owl_divider_recalc_rate() argument
58 &div->div_hw, parent_rate); in owl_divider_recalc_rate()
64 unsigned long parent_rate) in owl_divider_helper_set_rate() argument
69 val = divider_get_val(rate, parent_rate, div_hw->table, in owl_divider_helper_set_rate()
[all …]
/linux-4.19.296/drivers/clk/sprd/
Ddiv.c15 unsigned long *parent_rate) in sprd_div_helper_round_rate() argument
17 return divider_round_rate(&common->hw, rate, parent_rate, in sprd_div_helper_round_rate()
23 unsigned long *parent_rate) in sprd_div_round_rate() argument
28 rate, parent_rate); in sprd_div_round_rate()
33 unsigned long parent_rate) in sprd_div_helper_recalc_rate() argument
42 return divider_recalc_rate(&common->hw, parent_rate, val, NULL, 0, in sprd_div_helper_recalc_rate()
48 unsigned long parent_rate) in sprd_div_recalc_rate() argument
52 return sprd_div_helper_recalc_rate(&cd->common, &cd->div, parent_rate); in sprd_div_recalc_rate()
58 unsigned long parent_rate) in sprd_div_helper_set_rate() argument
63 val = divider_get_val(rate, parent_rate, NULL, in sprd_div_helper_set_rate()
[all …]
/linux-4.19.296/drivers/clk/
Dclk-multiplier.c19 unsigned long parent_rate) in __get_mult() argument
22 return DIV_ROUND_CLOSEST(rate, parent_rate); in __get_mult()
24 return rate / parent_rate; in __get_mult()
28 unsigned long parent_rate) in clk_multiplier_recalc_rate() argument
39 return parent_rate * val; in clk_multiplier_recalc_rate()
57 unsigned long parent_rate, current_rate, best_rate = ~0; in __bestmult() local
87 parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), in __bestmult()
89 current_rate = parent_rate * i; in __bestmult()
94 *best_parent_rate = parent_rate; in __bestmult()
102 unsigned long *parent_rate) in clk_multiplier_round_rate() argument
[all …]
Dclk-fractional-divider.c20 unsigned long parent_rate) in clk_fd_recalc_rate() argument
44 return parent_rate; in clk_fd_recalc_rate()
46 ret = (u64)parent_rate * m; in clk_fd_recalc_rate()
53 unsigned long *parent_rate, in clk_fd_general_approximation() argument
64 scale = fls_long(*parent_rate / rate - 1); in clk_fd_general_approximation()
68 rational_best_approximation(rate, *parent_rate, in clk_fd_general_approximation()
74 unsigned long *parent_rate) in clk_fd_round_rate() argument
80 if (!rate || (!clk_hw_can_set_rate_parent(hw) && rate >= *parent_rate)) in clk_fd_round_rate()
81 return *parent_rate; in clk_fd_round_rate()
84 fd->approximation(hw, rate, parent_rate, &m, &n); in clk_fd_round_rate()
[all …]
Dclk-vt8500.c124 unsigned long parent_rate) in vt8500_dclk_recalc_rate() argument
137 return parent_rate / div; in vt8500_dclk_recalc_rate()
167 unsigned long parent_rate) in vt8500_dclk_set_rate() argument
176 divisor = parent_rate / rate; in vt8500_dclk_set_rate()
359 static int vt8500_find_pll_bits(unsigned long rate, unsigned long parent_rate, in vt8500_find_pll_bits() argument
365 if ((rate < parent_rate * 4) || (rate > parent_rate * 62)) { in vt8500_find_pll_bits()
371 if (rate <= parent_rate * 31) in vt8500_find_pll_bits()
377 *multiplier = rate / (parent_rate / *prediv); in vt8500_find_pll_bits()
378 tclk = (parent_rate / *prediv) * *multiplier; in vt8500_find_pll_bits()
399 unsigned long parent_rate, u32 *multiplier, u32 *divisor1, in wm8650_find_pll_bits() argument
[all …]
Dclk-cdce925.c91 static unsigned long cdce925_pll_calculate_rate(unsigned long parent_rate, in cdce925_pll_calculate_rate() argument
95 return parent_rate; /* In bypass mode runs at same frequency */ in cdce925_pll_calculate_rate()
96 return mult_frac(parent_rate, (unsigned long)n, (unsigned long)m); in cdce925_pll_calculate_rate()
100 unsigned long parent_rate) in cdce925_pll_recalc_rate() argument
105 return cdce925_pll_calculate_rate(parent_rate, data->n, data->m); in cdce925_pll_recalc_rate()
109 unsigned long parent_rate, u16 *n, u16 *m) in cdce925_pll_find_rate() argument
115 if (rate <= parent_rate) { in cdce925_pll_find_rate()
117 rate = parent_rate; in cdce925_pll_find_rate()
127 g = gcd(rate, parent_rate); in cdce925_pll_find_rate()
128 um = parent_rate / g; in cdce925_pll_find_rate()
[all …]
Dclk-highbank.c106 unsigned long parent_rate) in clk_pll_recalc_rate() argument
113 return parent_rate; in clk_pll_recalc_rate()
117 vco_freq = parent_rate * (divf + 1); in clk_pll_recalc_rate()
147 unsigned long *parent_rate) in clk_pll_round_rate() argument
150 unsigned long ref_freq = *parent_rate; in clk_pll_round_rate()
158 unsigned long parent_rate) in clk_pll_set_rate() argument
164 clk_pll_calc(rate, parent_rate, &divq, &divf); in clk_pll_set_rate()
206 unsigned long parent_rate) in clk_cpu_periphclk_recalc_rate() argument
210 return parent_rate / div; in clk_cpu_periphclk_recalc_rate()
218 unsigned long parent_rate) in clk_cpu_a9bclk_recalc_rate() argument
[all …]
Dclk-xgene.c86 unsigned long parent_rate) in xgene_clk_pll_recalc_rate() argument
105 fvco = parent_rate * (N_DIV_RD(pll) + 4); in xgene_clk_pll_recalc_rate()
115 fref = parent_rate / nref; in xgene_clk_pll_recalc_rate()
124 fvco = parent_rate * SC_N_DIV_RD(pll); in xgene_clk_pll_recalc_rate()
127 clk_hw_get_name(hw), fvco / nout, parent_rate, in xgene_clk_pll_recalc_rate()
253 unsigned long parent_rate) in xgene_clk_pmd_recalc_rate() argument
272 ret = (u64)parent_rate; in xgene_clk_pmd_recalc_rate()
284 ret = (u64)parent_rate; in xgene_clk_pmd_recalc_rate()
290 unsigned long *parent_rate) in xgene_clk_pmd_round_rate() argument
295 if (!rate || rate >= *parent_rate) in xgene_clk_pmd_round_rate()
[all …]
/linux-4.19.296/drivers/clk/sunxi/
Dclk-sun9i-cpus.c52 unsigned long parent_rate) in sun9i_a80_cpus_clk_recalc_rate() argument
63 parent_rate /= SUN9I_CPUS_PLL4_DIV_GET(reg) + 1; in sun9i_a80_cpus_clk_recalc_rate()
66 rate = parent_rate / (SUN9I_CPUS_DIV_GET(reg) + 1); in sun9i_a80_cpus_clk_recalc_rate()
72 u8 parent, unsigned long parent_rate) in sun9i_a80_cpus_clk_round() argument
80 if (parent_rate && rate > parent_rate) in sun9i_a80_cpus_clk_round()
81 rate = parent_rate; in sun9i_a80_cpus_clk_round()
83 div = DIV_ROUND_UP(parent_rate, rate); in sun9i_a80_cpus_clk_round()
109 return parent_rate / pre_div / div; in sun9i_a80_cpus_clk_round()
117 unsigned long parent_rate, best = 0, child_rate, best_child_rate = 0; in sun9i_a80_cpus_clk_determine_rate() local
127 parent_rate = clk_hw_round_rate(parent, rate); in sun9i_a80_cpus_clk_determine_rate()
[all …]
Dclk-sun9i-core.c112 if (req->parent_rate < req->rate) in sun9i_a80_get_gt_factors()
113 req->rate = req->parent_rate; in sun9i_a80_get_gt_factors()
115 div = DIV_ROUND_UP(req->parent_rate, req->rate); in sun9i_a80_get_gt_factors()
121 req->rate = req->parent_rate / div; in sun9i_a80_get_gt_factors()
167 if (req->parent_rate < req->rate) in sun9i_a80_get_ahb_factors()
168 req->rate = req->parent_rate; in sun9i_a80_get_ahb_factors()
170 _p = order_base_2(DIV_ROUND_UP(req->parent_rate, req->rate)); in sun9i_a80_get_ahb_factors()
176 req->rate = req->parent_rate >> _p; in sun9i_a80_get_ahb_factors()
247 if (req->parent_rate < req->rate) in sun9i_a80_get_apb1_factors()
248 req->rate = req->parent_rate; in sun9i_a80_get_apb1_factors()
[all …]
/linux-4.19.296/drivers/clk/microchip/
Dclk-core.c127 unsigned long parent_rate, in calc_best_divided_rate() argument
138 div = parent_rate / rate; in calc_best_divided_rate()
142 divided_rate = parent_rate / div; in calc_best_divided_rate()
143 divided_rate_down = parent_rate / div_up; in calc_best_divided_rate()
158 unsigned long parent_rate) in pbclk_recalc_rate() argument
162 return parent_rate / pbclk_read_pbdiv(pb); in pbclk_recalc_rate()
166 unsigned long *parent_rate) in pbclk_round_rate() argument
168 return calc_best_divided_rate(rate, *parent_rate, in pbclk_round_rate()
173 unsigned long parent_rate) in pbclk_set_rate() argument
187 div = DIV_ROUND_CLOSEST(parent_rate, rate); in pbclk_set_rate()
[all …]
/linux-4.19.296/drivers/clk/meson/
Dclk-mpll.c27 static long rate_from_params(unsigned long parent_rate, in rate_from_params() argument
36 return DIV_ROUND_UP_ULL((u64)parent_rate * SDM_DEN, divisor); in rate_from_params()
40 unsigned long parent_rate, in params_from_rate() argument
45 uint64_t div = parent_rate; in params_from_rate()
72 unsigned long parent_rate) in mpll_recalc_rate() argument
82 rate = rate_from_params(parent_rate, sdm, n2); in mpll_recalc_rate()
88 unsigned long *parent_rate) in mpll_round_rate() argument
94 params_from_rate(rate, *parent_rate, &sdm, &n2, mpll->flags); in mpll_round_rate()
95 return rate_from_params(*parent_rate, sdm, n2); in mpll_round_rate()
100 unsigned long parent_rate) in mpll_set_rate() argument
[all …]
Dclk-pll.c43 static unsigned long __pll_params_to_rate(unsigned long parent_rate, in __pll_params_to_rate() argument
48 u64 rate = (u64)parent_rate * pllt->m; in __pll_params_to_rate()
52 u64 frac_rate = (u64)parent_rate * frac; in __pll_params_to_rate()
62 unsigned long parent_rate) in meson_clk_pll_recalc_rate() argument
85 return __pll_params_to_rate(parent_rate, &pllt, frac, pll); in meson_clk_pll_recalc_rate()
89 unsigned long parent_rate, in __pll_params_with_frac() argument
99 val = DIV_ROUND_CLOSEST_ULL(val * frac_max, parent_rate); in __pll_params_with_frac()
101 val = div_u64(val * frac_max, parent_rate); in __pll_params_with_frac()
134 unsigned long *parent_rate) in meson_clk_pll_round_rate() argument
143 return meson_clk_pll_recalc_rate(hw, *parent_rate); in meson_clk_pll_round_rate()
[all …]
Dgxbb-aoclk-32k.c44 unsigned long parent_rate; member
55 .parent_rate = 24000000,
74 unsigned long parent_rate) in aoclk_cec_32k_recalc_rate() argument
84 return parent_rate; in aoclk_cec_32k_recalc_rate()
95 f1 = DIV_ROUND_CLOSEST(parent_rate, n1); in aoclk_cec_32k_recalc_rate()
96 f2 = DIV_ROUND_CLOSEST(parent_rate, n2); in aoclk_cec_32k_recalc_rate()
106 return DIV_ROUND_CLOSEST(parent_rate, n1); in aoclk_cec_32k_recalc_rate()
115 if (aoclk_cec_32k_table[i].parent_rate == prate && in find_cec_32k_freq()
141 unsigned long parent_rate) in aoclk_cec_32k_set_rate() argument
144 parent_rate); in aoclk_cec_32k_set_rate()
/linux-4.19.296/drivers/clk/bcm/
Dclk-iproc-asiu.c79 unsigned long parent_rate) in iproc_asiu_clk_recalc_rate() argument
86 if (parent_rate == 0) { in iproc_asiu_clk_recalc_rate()
94 clk->rate = parent_rate; in iproc_asiu_clk_recalc_rate()
95 return parent_rate; in iproc_asiu_clk_recalc_rate()
104 clk->rate = parent_rate / (div_h + div_l); in iproc_asiu_clk_recalc_rate()
106 __func__, clk->rate, parent_rate, div_h, div_l); in iproc_asiu_clk_recalc_rate()
112 unsigned long *parent_rate) in iproc_asiu_clk_round_rate() argument
116 if (rate == 0 || *parent_rate == 0) in iproc_asiu_clk_round_rate()
119 if (rate == *parent_rate) in iproc_asiu_clk_round_rate()
120 return *parent_rate; in iproc_asiu_clk_round_rate()
[all …]
/linux-4.19.296/drivers/clk/pxa/
Dclk-pxa27x.c228 unsigned long parent_rate) in clk_pxa27x_cpll_get_rate() argument
241 L = l * parent_rate; in clk_pxa27x_cpll_get_rate()
255 unsigned long parent_rate) in clk_pxa27x_cpll_set_rate() argument
259 pr_debug("%s(rate=%lu parent_rate=%lu)\n", __func__, rate, parent_rate); in clk_pxa27x_cpll_set_rate()
275 unsigned long parent_rate) in clk_pxa27x_lcd_base_get_rate() argument
285 return parent_rate * 2; in clk_pxa27x_lcd_base_get_rate()
287 return parent_rate; in clk_pxa27x_lcd_base_get_rate()
291 return parent_rate; in clk_pxa27x_lcd_base_get_rate()
293 return parent_rate / 2; in clk_pxa27x_lcd_base_get_rate()
294 return parent_rate / 4; in clk_pxa27x_lcd_base_get_rate()
[all …]
/linux-4.19.296/drivers/clk/sunxi-ng/
Dccu_phase.c20 unsigned int parent_rate, grandparent_rate; in ccu_phase_get_phase() local
38 parent_rate = clk_hw_get_rate(parent); in ccu_phase_get_phase()
39 if (!parent_rate) in ccu_phase_get_phase()
53 parent_div = grandparent_rate / parent_rate; in ccu_phase_get_phase()
63 unsigned int parent_rate, grandparent_rate; in ccu_phase_set_phase() local
74 parent_rate = clk_hw_get_rate(parent); in ccu_phase_set_phase()
75 if (!parent_rate) in ccu_phase_set_phase()
92 parent_div = grandparent_rate / parent_rate; in ccu_phase_set_phase()
Dccu_mp.c45 unsigned long *parent_rate, in ccu_mp_round_rate() argument
59 ccu_mp_find_best(*parent_rate, rate, max_m, max_p, &m, &p); in ccu_mp_round_rate()
60 rate = *parent_rate / p / m; in ccu_mp_round_rate()
90 unsigned long parent_rate) in ccu_mp_recalc_rate() argument
98 parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1, in ccu_mp_recalc_rate()
99 parent_rate); in ccu_mp_recalc_rate()
112 rate = (parent_rate >> p) / m; in ccu_mp_recalc_rate()
129 unsigned long parent_rate) in ccu_mp_set_rate() argument
138 parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1, in ccu_mp_set_rate()
139 parent_rate); in ccu_mp_set_rate()
[all …]

123456789