/linux-6.6.21/drivers/clk/imx/ |
D | clk-pllv3.c | 112 unsigned long parent_rate) in clk_pllv3_recalc_rate() argument 117 return (div == 1) ? parent_rate * 22 : parent_rate * 20; in clk_pllv3_recalc_rate() 123 unsigned long parent_rate = *prate; in clk_pllv3_round_rate() local 125 return (rate >= parent_rate * 22) ? parent_rate * 22 : in clk_pllv3_round_rate() 126 parent_rate * 20; in clk_pllv3_round_rate() 130 unsigned long parent_rate) in clk_pllv3_set_rate() argument 135 if (rate == parent_rate * 22) in clk_pllv3_set_rate() 137 else if (rate == parent_rate * 20) in clk_pllv3_set_rate() 160 unsigned long parent_rate) in clk_pllv3_sys_recalc_rate() argument 165 return parent_rate * div / 2; in clk_pllv3_sys_recalc_rate() [all …]
|
D | clk-pllv4.c | 79 unsigned long parent_rate) in clk_pllv4_recalc_rate() argument 91 temp64 = parent_rate; in clk_pllv4_recalc_rate() 95 return (parent_rate * mult) + (u32)temp64; in clk_pllv4_recalc_rate() 102 unsigned long parent_rate = *prate; in clk_pllv4_round_rate() local 111 do_div(temp64, parent_rate); in clk_pllv4_round_rate() 115 round_rate = parent_rate * mult; in clk_pllv4_round_rate() 120 round_rate = parent_rate * pllv4_mult_table[i]; in clk_pllv4_round_rate() 130 clk_hw_get_name(hw), rate, parent_rate); in clk_pllv4_round_rate() 134 if (parent_rate <= MAX_MFD) in clk_pllv4_round_rate() 135 mfd = parent_rate; in clk_pllv4_round_rate() [all …]
|
D | clk-frac-pll.c | 97 unsigned long parent_rate) in clk_pll_recalc_rate() argument 101 u64 temp64 = parent_rate; in clk_pll_recalc_rate() 115 rate = parent_rate * 8 * (divfi + 1); in clk_pll_recalc_rate() 125 u64 parent_rate = *prate; in clk_pll_round_rate() local 129 parent_rate *= 8; in clk_pll_round_rate() 132 do_div(temp64, parent_rate); in clk_pll_round_rate() 134 temp64 = rate - divfi * parent_rate; in clk_pll_round_rate() 136 do_div(temp64, parent_rate); in clk_pll_round_rate() 139 temp64 = parent_rate; in clk_pll_round_rate() 143 rate = parent_rate * divfi + temp64; in clk_pll_round_rate() [all …]
|
/linux-6.6.21/drivers/clk/at91/ |
D | clk-h32mx.c | 29 unsigned long parent_rate) in clk_sama5d4_h32mx_recalc_rate() argument 36 return parent_rate / 2; in clk_sama5d4_h32mx_recalc_rate() 38 if (parent_rate > H32MX_MAX_FREQ) in clk_sama5d4_h32mx_recalc_rate() 40 return parent_rate; in clk_sama5d4_h32mx_recalc_rate() 44 unsigned long *parent_rate) in clk_sama5d4_h32mx_round_rate() argument 48 if (rate > *parent_rate) in clk_sama5d4_h32mx_round_rate() 49 return *parent_rate; in clk_sama5d4_h32mx_round_rate() 50 div = *parent_rate / 2; in clk_sama5d4_h32mx_round_rate() 54 if (rate - div < *parent_rate - rate) in clk_sama5d4_h32mx_round_rate() 57 return *parent_rate; in clk_sama5d4_h32mx_round_rate() [all …]
|
D | clk-plldiv.c | 23 unsigned long parent_rate) in clk_plldiv_recalc_rate() argument 31 return parent_rate / 2; in clk_plldiv_recalc_rate() 33 return parent_rate; in clk_plldiv_recalc_rate() 37 unsigned long *parent_rate) in clk_plldiv_round_rate() argument 41 if (rate > *parent_rate) in clk_plldiv_round_rate() 42 return *parent_rate; in clk_plldiv_round_rate() 43 div = *parent_rate / 2; in clk_plldiv_round_rate() 47 if (rate - div < *parent_rate - rate) in clk_plldiv_round_rate() 50 return *parent_rate; in clk_plldiv_round_rate() 54 unsigned long parent_rate) in clk_plldiv_set_rate() argument [all …]
|
D | clk-audio-pll.c | 159 static unsigned long clk_audio_pll_fout(unsigned long parent_rate, in clk_audio_pll_fout() argument 162 unsigned long long fr = (unsigned long long)parent_rate * fracr; in clk_audio_pll_fout() 170 return parent_rate * (nd + 1) + fr; in clk_audio_pll_fout() 174 unsigned long parent_rate) in clk_audio_pll_frac_recalc_rate() argument 179 fout = clk_audio_pll_fout(parent_rate, frac->nd, frac->fracr); in clk_audio_pll_frac_recalc_rate() 188 unsigned long parent_rate) in clk_audio_pll_pad_recalc_rate() argument 194 apad_rate = parent_rate / (apad_ck->qdaudio * apad_ck->div); in clk_audio_pll_pad_recalc_rate() 203 unsigned long parent_rate) in clk_audio_pll_pmc_recalc_rate() argument 208 apmc_rate = parent_rate / (apmc_ck->qdpmc + 1); in clk_audio_pll_pmc_recalc_rate() 217 unsigned long parent_rate, in clk_audio_pll_frac_compute_frac() argument [all …]
|
/linux-6.6.21/drivers/clk/actions/ |
D | owl-factor.c | 44 unsigned long rate, unsigned long parent_rate) in _get_table_val() argument 51 calc_rate = parent_rate * clkt->mul; in _get_table_val() 71 unsigned long parent_rate, try_parent_rate, best = 0, cur_rate; in owl_clk_val_best() local 79 parent_rate = *best_parent_rate; in owl_clk_val_best() 80 bestval = _get_table_val(clkt, rate, parent_rate); in owl_clk_val_best() 100 parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), in owl_clk_val_best() 102 cur_rate = DIV_ROUND_UP(parent_rate, clkt->div) * clkt->mul; in owl_clk_val_best() 106 *best_parent_rate = parent_rate; in owl_clk_val_best() 122 unsigned long *parent_rate) in owl_factor_helper_round_rate() argument 127 val = owl_clk_val_best(factor_hw, &common->hw, rate, parent_rate); in owl_factor_helper_round_rate() [all …]
|
D | owl-divider.c | 19 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 …]
|
D | owl-composite.c | 72 unsigned long parent_rate) in owl_comp_div_recalc_rate() argument 77 parent_rate); in owl_comp_div_recalc_rate() 81 unsigned long parent_rate) in owl_comp_div_set_rate() argument 86 rate, parent_rate); in owl_comp_div_set_rate() 106 unsigned long parent_rate) in owl_comp_fact_recalc_rate() argument 112 parent_rate); in owl_comp_fact_recalc_rate() 116 unsigned long parent_rate) in owl_comp_fact_set_rate() argument 122 rate, parent_rate); in owl_comp_fact_set_rate() 126 unsigned long *parent_rate) in owl_comp_fix_fact_round_rate() argument 131 return comp->fix_fact_ops->round_rate(&fix_fact_hw->hw, rate, parent_rate); in owl_comp_fix_fact_round_rate() [all …]
|
/linux-6.6.21/drivers/clk/analogbits/ |
D | wrpll-cln28hpc.c | 188 unsigned long parent_rate) in __wrpll_update_parent_rate() argument 192 if (parent_rate > MAX_INPUT_FREQ || parent_rate < MIN_POST_DIVR_FREQ) in __wrpll_update_parent_rate() 195 c->parent_rate = parent_rate; in __wrpll_update_parent_rate() 196 max_r_for_parent = div_u64(parent_rate, MIN_POST_DIVR_FREQ); in __wrpll_update_parent_rate() 199 c->init_r = DIV_ROUND_UP_ULL(parent_rate, MAX_POST_DIVR_FREQ); in __wrpll_update_parent_rate() 226 unsigned long parent_rate) in wrpll_configure_for_rate() argument 240 if (parent_rate != c->parent_rate) { in wrpll_configure_for_rate() 241 if (__wrpll_update_parent_rate(c, parent_rate)) { in wrpll_configure_for_rate() 251 if (target_rate == parent_rate) { in wrpll_configure_for_rate() 265 ratio = div64_u64((target_vco_rate << ROUND_SHIFT), parent_rate); in wrpll_configure_for_rate() [all …]
|
/linux-6.6.21/drivers/clk/ |
D | clk-multiplier.c | 33 unsigned long parent_rate) in __get_mult() argument 36 return DIV_ROUND_CLOSEST(rate, parent_rate); in __get_mult() 38 return rate / parent_rate; in __get_mult() 42 unsigned long parent_rate) in clk_multiplier_recalc_rate() argument 53 return parent_rate * val; in clk_multiplier_recalc_rate() 71 unsigned long parent_rate, current_rate, best_rate = ~0; in __bestmult() local 101 parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), in __bestmult() 103 current_rate = parent_rate * i; in __bestmult() 108 *best_parent_rate = parent_rate; in __bestmult() 116 unsigned long *parent_rate) in clk_multiplier_round_rate() argument [all …]
|
D | clk-loongson2.c | 84 unsigned long parent_rate) in loongson2_node_recalc_rate() argument 86 return loongson2_calc_pll_rate(0x0, parent_rate); in loongson2_node_recalc_rate() 94 unsigned long parent_rate) in loongson2_ddr_recalc_rate() argument 96 return loongson2_calc_pll_rate(0x10, parent_rate); in loongson2_ddr_recalc_rate() 104 unsigned long parent_rate) in loongson2_dc_recalc_rate() argument 106 return loongson2_calc_pll_rate(0x20, parent_rate); in loongson2_dc_recalc_rate() 114 unsigned long parent_rate) in loongson2_pix0_recalc_rate() argument 116 return loongson2_calc_pll_rate(0x30, parent_rate); in loongson2_pix0_recalc_rate() 124 unsigned long parent_rate) in loongson2_pix1_recalc_rate() argument 126 return loongson2_calc_pll_rate(0x40, parent_rate); in loongson2_pix1_recalc_rate() [all …]
|
D | clk-vt8500.c | 115 unsigned long parent_rate) in vt8500_dclk_recalc_rate() argument 128 return parent_rate / div; in vt8500_dclk_recalc_rate() 158 unsigned long parent_rate) in vt8500_dclk_set_rate() argument 167 divisor = parent_rate / rate; in vt8500_dclk_set_rate() 350 static int vt8500_find_pll_bits(unsigned long rate, unsigned long parent_rate, in vt8500_find_pll_bits() argument 356 if ((rate < parent_rate * 4) || (rate > parent_rate * 62)) { in vt8500_find_pll_bits() 362 if (rate <= parent_rate * 31) in vt8500_find_pll_bits() 368 *multiplier = rate / (parent_rate / *prediv); in vt8500_find_pll_bits() 369 tclk = (parent_rate / *prediv) * *multiplier; in vt8500_find_pll_bits() 390 unsigned long parent_rate, u32 *multiplier, u32 *divisor1, in wm8650_find_pll_bits() argument [all …]
|
D | clk-cdce925.c | 92 static unsigned long cdce925_pll_calculate_rate(unsigned long parent_rate, in cdce925_pll_calculate_rate() argument 96 return parent_rate; /* In bypass mode runs at same frequency */ in cdce925_pll_calculate_rate() 97 return mult_frac(parent_rate, (unsigned long)n, (unsigned long)m); in cdce925_pll_calculate_rate() 101 unsigned long parent_rate) in cdce925_pll_recalc_rate() argument 106 return cdce925_pll_calculate_rate(parent_rate, data->n, data->m); in cdce925_pll_recalc_rate() 110 unsigned long parent_rate, u16 *n, u16 *m) in cdce925_pll_find_rate() argument 116 if (rate <= parent_rate) { in cdce925_pll_find_rate() 118 rate = parent_rate; in cdce925_pll_find_rate() 128 g = gcd(rate, parent_rate); in cdce925_pll_find_rate() 129 um = parent_rate / g; in cdce925_pll_find_rate() [all …]
|
D | clk-sparx5.c | 58 static unsigned long s5_calc_freq(unsigned long parent_rate, in s5_calc_freq() argument 61 unsigned long rate = parent_rate / conf->div; in s5_calc_freq() 76 unsigned long parent_rate, in s5_search_fractional() argument 94 conf->freq = s5_calc_freq(parent_rate, conf); in s5_search_fractional() 109 unsigned long parent_rate, in s5_calc_params() argument 112 if (parent_rate % rate) { in s5_calc_params() 116 div = DIV_ROUND_CLOSEST_ULL(parent_rate, rate); in s5_calc_params() 117 s5_search_fractional(rate, parent_rate, div, &alt1); in s5_calc_params() 124 div = parent_rate / rate; in s5_calc_params() 126 s5_search_fractional(rate, parent_rate, div, in s5_calc_params() [all …]
|
D | clk-highbank.c | 94 unsigned long parent_rate) in clk_pll_recalc_rate() argument 101 return parent_rate; in clk_pll_recalc_rate() 105 vco_freq = parent_rate * (divf + 1); in clk_pll_recalc_rate() 135 unsigned long *parent_rate) in clk_pll_round_rate() argument 138 unsigned long ref_freq = *parent_rate; in clk_pll_round_rate() 146 unsigned long parent_rate) in clk_pll_set_rate() argument 152 clk_pll_calc(rate, parent_rate, &divq, &divf); in clk_pll_set_rate() 194 unsigned long parent_rate) in clk_cpu_periphclk_recalc_rate() argument 198 return parent_rate / div; in clk_cpu_periphclk_recalc_rate() 206 unsigned long parent_rate) in clk_cpu_a9bclk_recalc_rate() argument [all …]
|
/linux-6.6.21/drivers/clk/nuvoton/ |
D | clk-ma35d1-pll.c | 82 unsigned long parent_rate) in ma35d1_calc_smic_pll_freq() argument 88 return parent_rate; in ma35d1_calc_smic_pll_freq() 94 pll_freq = (u64)parent_rate * n; in ma35d1_calc_smic_pll_freq() 99 static unsigned long ma35d1_calc_pll_freq(u8 mode, u32 *reg_ctl, unsigned long parent_rate) in ma35d1_calc_pll_freq() argument 105 return parent_rate; in ma35d1_calc_pll_freq() 112 pll_freq = (u64)parent_rate * n; in ma35d1_calc_pll_freq() 118 pll_freq = div_u64(parent_rate * n, 100 * m * p); in ma35d1_calc_pll_freq() 124 unsigned long parent_rate, u32 *reg_ctl, in ma35d1_pll_find_closest() argument 148 tmp = div_u64(parent_rate, m); in ma35d1_pll_find_closest() 153 fclk = div_u64(parent_rate * n, m); in ma35d1_pll_find_closest() [all …]
|
/linux-6.6.21/drivers/clk/meson/ |
D | clk-pll.c | 54 static unsigned long __pll_params_to_rate(unsigned long parent_rate, in __pll_params_to_rate() argument 59 u64 rate = (u64)parent_rate * m; in __pll_params_to_rate() 62 u64 frac_rate = (u64)parent_rate * frac; in __pll_params_to_rate() 72 unsigned long parent_rate) in meson_clk_pll_recalc_rate() argument 94 return __pll_params_to_rate(parent_rate, m, n, frac, pll); in meson_clk_pll_recalc_rate() 98 unsigned long parent_rate, in __pll_params_with_frac() argument 107 if (rate < parent_rate * m / n) in __pll_params_with_frac() 111 val = DIV_ROUND_CLOSEST_ULL(val * frac_max, parent_rate); in __pll_params_with_frac() 113 val = div_u64(val * frac_max, parent_rate); in __pll_params_with_frac() 153 unsigned long parent_rate, in meson_clk_get_pll_range_m() argument [all …]
|
/linux-6.6.21/drivers/clk/sprd/ |
D | div.c | 13 unsigned long *parent_rate) in sprd_div_round_rate() argument 17 return divider_round_rate(&cd->common.hw, rate, parent_rate, NULL, in sprd_div_round_rate() 23 unsigned long parent_rate) in sprd_div_helper_recalc_rate() argument 32 return divider_recalc_rate(&common->hw, parent_rate, val, NULL, 0, in sprd_div_helper_recalc_rate() 38 unsigned long parent_rate) in sprd_div_recalc_rate() argument 42 return sprd_div_helper_recalc_rate(&cd->common, &cd->div, parent_rate); in sprd_div_recalc_rate() 48 unsigned long parent_rate) in sprd_div_helper_set_rate() argument 53 val = divider_get_val(rate, parent_rate, NULL, in sprd_div_helper_set_rate() 68 unsigned long parent_rate) in sprd_div_set_rate() argument 73 rate, parent_rate); in sprd_div_set_rate()
|
/linux-6.6.21/drivers/clk/sunxi/ |
D | clk-sun9i-cpus.c | 53 unsigned long parent_rate) in sun9i_a80_cpus_clk_recalc_rate() argument 64 parent_rate /= SUN9I_CPUS_PLL4_DIV_GET(reg) + 1; in sun9i_a80_cpus_clk_recalc_rate() 67 rate = parent_rate / (SUN9I_CPUS_DIV_GET(reg) + 1); in sun9i_a80_cpus_clk_recalc_rate() 73 u8 parent, unsigned long parent_rate) in sun9i_a80_cpus_clk_round() argument 81 if (parent_rate && rate > parent_rate) in sun9i_a80_cpus_clk_round() 82 rate = parent_rate; in sun9i_a80_cpus_clk_round() 84 div = DIV_ROUND_UP(parent_rate, rate); in sun9i_a80_cpus_clk_round() 110 return parent_rate / pre_div / div; in sun9i_a80_cpus_clk_round() 118 unsigned long parent_rate, best = 0, child_rate, best_child_rate = 0; in sun9i_a80_cpus_clk_determine_rate() local 128 parent_rate = clk_hw_round_rate(parent, rate); in sun9i_a80_cpus_clk_determine_rate() [all …]
|
D | clk-sun9i-core.c | 103 if (req->parent_rate < req->rate) in sun9i_a80_get_gt_factors() 104 req->rate = req->parent_rate; in sun9i_a80_get_gt_factors() 106 div = DIV_ROUND_UP(req->parent_rate, req->rate); in sun9i_a80_get_gt_factors() 112 req->rate = req->parent_rate / div; in sun9i_a80_get_gt_factors() 158 if (req->parent_rate < req->rate) in sun9i_a80_get_ahb_factors() 159 req->rate = req->parent_rate; in sun9i_a80_get_ahb_factors() 161 _p = order_base_2(DIV_ROUND_UP(req->parent_rate, req->rate)); in sun9i_a80_get_ahb_factors() 167 req->rate = req->parent_rate >> _p; in sun9i_a80_get_ahb_factors() 238 if (req->parent_rate < req->rate) in sun9i_a80_get_apb1_factors() 239 req->rate = req->parent_rate; in sun9i_a80_get_apb1_factors() [all …]
|
/linux-6.6.21/drivers/clk/microchip/ |
D | clk-core.c | 120 unsigned long parent_rate, in calc_best_divided_rate() argument 131 div = parent_rate / rate; in calc_best_divided_rate() 135 divided_rate = parent_rate / div; in calc_best_divided_rate() 136 divided_rate_down = parent_rate / div_up; in calc_best_divided_rate() 151 unsigned long parent_rate) in pbclk_recalc_rate() argument 155 return parent_rate / pbclk_read_pbdiv(pb); in pbclk_recalc_rate() 159 unsigned long *parent_rate) in pbclk_round_rate() argument 161 return calc_best_divided_rate(rate, *parent_rate, in pbclk_round_rate() 166 unsigned long parent_rate) in pbclk_set_rate() argument 180 div = DIV_ROUND_CLOSEST(parent_rate, rate); in pbclk_set_rate() [all …]
|
/linux-6.6.21/drivers/clk/sunxi-ng/ |
D | ccu_mp.c | 49 unsigned long parent_rate, now; in ccu_mp_find_best_with_parent_adj() local 81 parent_rate = clk_hw_round_rate(hw, rate * div); in ccu_mp_find_best_with_parent_adj() 82 now = parent_rate / div; in ccu_mp_find_best_with_parent_adj() 86 *parent = parent_rate; in ccu_mp_find_best_with_parent_adj() 99 unsigned long *parent_rate, in ccu_mp_round_rate() argument 114 rate = ccu_mp_find_best(*parent_rate, rate, max_m, max_p, &m, &p); in ccu_mp_round_rate() 116 rate = ccu_mp_find_best_with_parent_adj(hw, parent_rate, rate, in ccu_mp_round_rate() 148 unsigned long parent_rate) in ccu_mp_recalc_rate() argument 156 parent_rate = ccu_mux_helper_apply_prediv(&cmp->common, &cmp->mux, -1, in ccu_mp_recalc_rate() 157 parent_rate); in ccu_mp_recalc_rate() [all …]
|
/linux-6.6.21/drivers/clk/bcm/ |
D | clk-iproc-asiu.c | 69 unsigned long parent_rate) in iproc_asiu_clk_recalc_rate() argument 76 if (parent_rate == 0) { in iproc_asiu_clk_recalc_rate() 84 clk->rate = parent_rate; in iproc_asiu_clk_recalc_rate() 85 return parent_rate; in iproc_asiu_clk_recalc_rate() 94 clk->rate = parent_rate / (div_h + div_l); in iproc_asiu_clk_recalc_rate() 96 __func__, clk->rate, parent_rate, div_h, div_l); in iproc_asiu_clk_recalc_rate() 102 unsigned long *parent_rate) in iproc_asiu_clk_round_rate() argument 106 if (rate == 0 || *parent_rate == 0) in iproc_asiu_clk_round_rate() 109 if (rate == *parent_rate) in iproc_asiu_clk_round_rate() 110 return *parent_rate; in iproc_asiu_clk_round_rate() [all …]
|
/linux-6.6.21/drivers/clk/mstar/ |
D | clk-msc313-cpupll.c | 117 static unsigned long msc313_cpupll_frequencyforreg(u32 reg, unsigned long parent_rate) in msc313_cpupll_frequencyforreg() argument 119 unsigned long long prescaled = ((unsigned long long)parent_rate) * MULTIPLIER; in msc313_cpupll_frequencyforreg() 126 static u32 msc313_cpupll_regforfrequecy(unsigned long rate, unsigned long parent_rate) in msc313_cpupll_regforfrequecy() argument 128 unsigned long long prescaled = ((unsigned long long)parent_rate) * MULTIPLIER; in msc313_cpupll_regforfrequecy() 135 static unsigned long msc313_cpupll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) in msc313_cpupll_recalc_rate() argument 140 parent_rate); in msc313_cpupll_recalc_rate() 144 unsigned long *parent_rate) in msc313_cpupll_round_rate() argument 146 u32 reg = msc313_cpupll_regforfrequecy(rate, *parent_rate); in msc313_cpupll_round_rate() 147 long rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate); in msc313_cpupll_round_rate() 154 rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate); in msc313_cpupll_round_rate() [all …]
|