/kernel/linux/linux-5.10/drivers/clk/sunxi/ |
D | clk-sun9i-cpus.c | 75 u8 div, pre_div = 1; in sun9i_a80_cpus_clk_round() local 90 pre_div = div; in sun9i_a80_cpus_clk_round() 93 pre_div = DIV_ROUND_UP(div, 2); in sun9i_a80_cpus_clk_round() 96 pre_div = DIV_ROUND_UP(div, 3); in sun9i_a80_cpus_clk_round() 99 pre_div = DIV_ROUND_UP(div, 4); in sun9i_a80_cpus_clk_round() 107 *pre_divp = pre_div - 1; in sun9i_a80_cpus_clk_round() 110 return parent_rate / pre_div / div; in sun9i_a80_cpus_clk_round() 157 u8 div, pre_div, parent; in sun9i_a80_cpus_clk_set_rate() local 166 sun9i_a80_cpus_clk_round(rate, &div, &pre_div, parent, parent_rate); in sun9i_a80_cpus_clk_set_rate() 169 reg = SUN9I_CPUS_PLL4_DIV_SET(reg, pre_div); in sun9i_a80_cpus_clk_set_rate()
|
/kernel/linux/linux-5.10/drivers/pwm/ |
D | pwm-meson.c | 91 u8 pre_div; member 166 unsigned int pre_div, cnt, duty_cnt; in meson_pwm_calc() local 190 pre_div = div64_u64(fin_freq * period, NSEC_PER_SEC * 0xffffLL); in meson_pwm_calc() 191 if (pre_div > MISC_CLK_DIV_MASK) { in meson_pwm_calc() 196 cnt = div64_u64(fin_freq * period, NSEC_PER_SEC * (pre_div + 1)); in meson_pwm_calc() 203 pre_div, cnt); in meson_pwm_calc() 206 channel->pre_div = pre_div; in meson_pwm_calc() 210 channel->pre_div = pre_div; in meson_pwm_calc() 215 duty_cnt = div64_u64(fin_freq * duty, NSEC_PER_SEC * (pre_div + 1)); in meson_pwm_calc() 222 duty, pre_div, duty_cnt); in meson_pwm_calc() [all …]
|
/kernel/linux/linux-5.10/drivers/gpu/drm/sun4i/ |
D | sun4i_hdmi_ddc_clk.c | 18 u8 pre_div; member 29 const u8 pre_div, in sun4i_ddc_calc_divider() argument 40 tmp_rate = (((parent_rate / pre_div) / 10) >> _n) / in sun4i_ddc_calc_divider() 67 return sun4i_ddc_calc_divider(rate, *prate, ddc->pre_div, in sun4i_ddc_round_rate() 82 return (((parent_rate / ddc->pre_div) / 10) >> n) / in sun4i_ddc_recalc_rate() 92 sun4i_ddc_calc_divider(rate, parent_rate, ddc->pre_div, in sun4i_ddc_set_rate() 134 ddc->pre_div = hdmi->variant->ddc_clk_pre_divider; in sun4i_ddc_create()
|
/kernel/linux/linux-5.10/drivers/clk/bcm/ |
D | clk-kona-setup.c | 72 div = &peri->pre_div; in clk_requires_trigger() 138 div = &peri->pre_div; in peri_clk_data_offsets_valid() 372 struct bcm_clk_div *pre_div; in kona_dividers_valid() local 377 if (!divider_exists(&peri->div) || !divider_exists(&peri->pre_div)) in kona_dividers_valid() 381 pre_div = &peri->pre_div; in kona_dividers_valid() 382 if (divider_is_fixed(div) || divider_is_fixed(pre_div)) in kona_dividers_valid() 387 return div->u.s.frac_width + pre_div->u.s.frac_width <= limit; in kona_dividers_valid() 408 struct bcm_clk_div *pre_div; in peri_clk_data_valid() local 450 pre_div = &peri->pre_div; in peri_clk_data_valid() 455 if (divider_exists(pre_div)) in peri_clk_data_valid() [all …]
|
D | clk-kona.c | 694 struct bcm_clk_div *div, struct bcm_clk_div *pre_div, in clk_recalc_rate() argument 716 if (pre_div && divider_exists(pre_div)) { in clk_recalc_rate() 719 scaled_rate = scale_rate(pre_div, parent_rate); in clk_recalc_rate() 721 scaled_div = divider_read_scaled(ccu, pre_div); in clk_recalc_rate() 749 struct bcm_clk_div *pre_div, in round_rate() argument 774 if (divider_exists(pre_div)) { in round_rate() 778 scaled_rate = scale_rate(pre_div, parent_rate); in round_rate() 780 scaled_pre_div = divider_read_scaled(ccu, pre_div); in round_rate() 1004 return clk_recalc_rate(bcm_clk->ccu, &data->div, &data->pre_div, in kona_peri_clk_recalc_rate() 1018 return round_rate(bcm_clk->ccu, div, &bcm_clk->u.peri->pre_div, in kona_peri_clk_round_rate() [all …]
|
/kernel/linux/linux-5.10/drivers/clk/qcom/ |
D | clk-rcg.c | 113 static u32 ns_to_pre_div(struct pre_div *p, u32 ns) in ns_to_pre_div() 120 static u32 pre_div_to_ns(struct pre_div *p, u8 pre_div, u32 ns) in pre_div_to_ns() argument 128 ns |= pre_div << p->pre_div_shift; in pre_div_to_ns() 203 struct pre_div *p; in configure_bank() 267 ns = pre_div_to_ns(p, f->pre_div - 1, ns); in configure_bank() 312 f.pre_div = ns_to_pre_div(&rcg->p[bank], ns) + 1; in clk_dyn_rcg_set_parent() 326 calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 pre_div) in calc_rate() argument 328 if (pre_div) in calc_rate() 329 rate /= pre_div + 1; in calc_rate() 345 u32 pre_div, m = 0, n = 0, ns, md, mode = 0; in clk_rcg_recalc_rate() local [all …]
|
D | clk-rcg.h | 15 u8 pre_div; member 47 struct pre_div { struct 80 struct pre_div p; 118 struct pre_div p[2];
|
D | clk-rcg2.c | 226 if (f->pre_div) { in _freq_tbl_determine_rate() 230 rate *= f->pre_div + 1; in _freq_tbl_determine_rate() 303 cfg = f->pre_div << CFG_SRC_DIV_SHIFT; in __clk_rcg2_configure() 445 f.pre_div = hid_div; in clk_edp_pixel_set_rate() 446 f.pre_div >>= CFG_SRC_DIV_SHIFT; in clk_edp_pixel_set_rate() 447 f.pre_div &= mask; in clk_edp_pixel_set_rate() 553 f.pre_div = div; in clk_byte_set_rate() 612 f.pre_div = div; in clk_byte2_set_rate() 709 f.pre_div = hid_div; in clk_pixel_set_rate() 710 f.pre_div >>= CFG_SRC_DIV_SHIFT; in clk_pixel_set_rate() [all …]
|
D | gcc-ipq4019.c | 1288 f->pre_div << pll->cdiv.shift); in clk_cpu_div_set_rate() 1309 u32 cdiv, pre_div; in clk_cpu_div_recalc_rate() local 1321 pre_div = (cdiv + 1) * 2; in clk_cpu_div_recalc_rate() 1323 pre_div = cdiv + 12; in clk_cpu_div_recalc_rate() 1326 do_div(rate, pre_div); in clk_cpu_div_recalc_rate() 1385 u32 cdiv, pre_div = 1; in clk_regmap_clk_div_recalc_rate() local 1390 pre_div = pll->fixed_div; in clk_regmap_clk_div_recalc_rate() 1397 pre_div = clkt->div; in clk_regmap_clk_div_recalc_rate() 1402 do_div(rate, pre_div); in clk_regmap_clk_div_recalc_rate()
|
/kernel/linux/linux-5.10/drivers/phy/mediatek/ |
D | phy-mtk-hdmi-mt8173.c | 160 unsigned int pre_div; in mtk_hdmi_pll_set_rate() local 170 pre_div = 0; in mtk_hdmi_pll_set_rate() 173 pre_div = 1; in mtk_hdmi_pll_set_rate() 176 pre_div = 1; in mtk_hdmi_pll_set_rate() 181 (pre_div << PREDIV_SHIFT), RG_HDMITX_PLL_PREDIV); in mtk_hdmi_pll_set_rate()
|
/kernel/linux/linux-5.10/drivers/clk/ |
D | clk-sparx5.c | 53 u8 pre_div; member 65 int divt = sel_rates[conf->rot_sel] * (1 + conf->pre_div); in s5_calc_freq() 91 conf->pre_div = i; in s5_search_fractional() 183 val |= FIELD_PREP(PLL_PRE_DIV, conf.pre_div); in s5_pll_set_rate() 203 conf.pre_div = FIELD_GET(PLL_PRE_DIV, val); in s5_pll_recalc_rate()
|
/kernel/linux/linux-5.10/sound/soc/codecs/ |
D | rt1016.c | 310 int pre_div, bclk_ms, frame_size; in rt1016_hw_params() local 314 pre_div = rl6231_get_clk_info(rt1016->sysclk, rt1016->lrck); in rt1016_hw_params() 315 if (pre_div < 0) { in rt1016_hw_params() 335 rt1016->lrck, pre_div, dai->id); in rt1016_hw_params() 358 ((pre_div + 3) << RT1016_FS_PD_SFT) | in rt1016_hw_params() 359 (pre_div << RT1016_OSR_PD_SFT)); in rt1016_hw_params()
|
D | rt1308.c | 459 int pre_div, bclk_ms, frame_size; in rt1308_hw_params() local 462 pre_div = rt1308_get_clk_info(rt1308->sysclk, rt1308->lrck); in rt1308_hw_params() 463 if (pre_div < 0) { in rt1308_hw_params() 480 bclk_ms, pre_div, dai->id); in rt1308_hw_params() 483 rt1308->lrck, pre_div, dai->id); in rt1308_hw_params() 505 val_clk = pre_div << RT1308_DIV_FS_SYS_SFT; in rt1308_hw_params()
|
D | rt1015.c | 729 int pre_div, bclk_ms, frame_size; in rt1015_hw_params() local 733 pre_div = rl6231_get_clk_info(rt1015->sysclk, rt1015->lrck); in rt1015_hw_params() 734 if (pre_div < 0) { in rt1015_hw_params() 750 bclk_ms, pre_div, dai->id); in rt1015_hw_params() 753 rt1015->lrck, pre_div, dai->id); in rt1015_hw_params() 774 RT1015_FS_PD_MASK, pre_div << RT1015_FS_PD_SFT); in rt1015_hw_params()
|
D | rt1305.c | 631 int pre_div, bclk_ms, frame_size; in rt1305_hw_params() local 634 pre_div = rt1305_get_clk_info(rt1305->sysclk, rt1305->lrck); in rt1305_hw_params() 635 if (pre_div < 0) { in rt1305_hw_params() 641 pre_div = 0; in rt1305_hw_params() 654 bclk_ms, pre_div, dai->id); in rt1305_hw_params() 657 rt1305->lrck, pre_div, dai->id); in rt1305_hw_params() 679 val_clk = pre_div << RT1305_DIV_FS_SYS_SFT; in rt1305_hw_params()
|
D | wm8510.c | 266 unsigned int pre_div:4; /* prescale - 1 */ member 285 pll_div.pre_div = 1; in pll_factors() 288 pll_div.pre_div = 0; in pll_factors() 332 snd_soc_component_write(component, WM8510_PLLN, (pll_div.pre_div << 4) | pll_div.n); in wm8510_set_dai_pll()
|
D | wm8974.c | 263 unsigned int pre_div:1; member 284 pll_div->pre_div = 1; in pll_factors() 287 pll_div->pre_div = 0; in pll_factors() 332 snd_soc_component_write(component, WM8974_PLLN, (pll_div.pre_div << 4) | pll_div.n); in wm8974_set_dai_pll()
|
D | rt5514.c | 756 int pre_div, bclk_ms, frame_size; in rt5514_hw_params() local 760 pre_div = rl6231_get_clk_info(rt5514->sysclk, rt5514->lrck); in rt5514_hw_params() 761 if (pre_div < 0) { in rt5514_hw_params() 778 bclk_ms, pre_div, dai->id); in rt5514_hw_params() 800 (pre_div + 1) << RT5514_CLK_AD_ANA1_SEL_SFT); in rt5514_hw_params() 803 pre_div << RT5514_CLK_SYS_DIV_OUT_SFT | in rt5514_hw_params() 804 pre_div << RT5514_SEL_ADC_OSR_SFT); in rt5514_hw_params()
|
D | rt5660.c | 841 int pre_div, bclk_ms, frame_size; in rt5660_hw_params() local 844 pre_div = rl6231_get_clk_info(rt5660->sysclk, rt5660->lrck[dai->id]); in rt5660_hw_params() 845 if (pre_div < 0) { in rt5660_hw_params() 867 bclk_ms, pre_div, dai->id); in rt5660_hw_params() 889 pre_div << RT5660_I2S_PD1_SFT; in rt5660_hw_params()
|
D | wm8960.c | 1109 u32 pre_div:1; member 1154 pll_div->pre_div = 1; in pll_factors() 1157 pll_div->pre_div = 0; in pll_factors() 1182 pll_div->n, pll_div->k, pll_div->pre_div); in pll_factors() 1209 reg |= pll_div.pre_div << 4; in wm8960_set_pll()
|
D | rt5616.c | 963 int pre_div, bclk_ms, frame_size; in rt5616_hw_params() local 967 pre_div = rl6231_get_clk_info(rt5616->sysclk, rt5616->lrck[dai->id]); in rt5616_hw_params() 969 if (pre_div < 0) { in rt5616_hw_params() 984 bclk_ms, pre_div, dai->id); in rt5616_hw_params() 1003 val_clk = pre_div << RT5616_I2S_PD1_SFT; in rt5616_hw_params()
|
/kernel/linux/linux-5.10/drivers/mmc/host/ |
D | sdhci-of-esdhc.c | 646 unsigned int pre_div = 1, div = 1; in esdhc_of_set_clock() local 659 pre_div = 2; in esdhc_of_set_clock() 672 while (host->max_clk / pre_div / 16 > clock_fixup && pre_div < 256) in esdhc_of_set_clock() 673 pre_div *= 2; in esdhc_of_set_clock() 675 while (host->max_clk / pre_div / div > clock_fixup && div < 16) in esdhc_of_set_clock() 678 esdhc->div_ratio = pre_div * div; in esdhc_of_set_clock() 686 pre_div = 4; in esdhc_of_set_clock() 689 pre_div = 4; in esdhc_of_set_clock() 692 pre_div = 4; in esdhc_of_set_clock() 698 esdhc->div_ratio = pre_div * div; in esdhc_of_set_clock() [all …]
|
D | sdhci-esdhc-imx.c | 840 int pre_div = 1; in esdhc_pltfm_set_clock() local 868 pre_div = 2; in esdhc_pltfm_set_clock() 884 while (host_clock / (16 * pre_div * ddr_pre_div) > clock && in esdhc_pltfm_set_clock() 885 pre_div < 256) in esdhc_pltfm_set_clock() 886 pre_div *= 2; in esdhc_pltfm_set_clock() 888 while (host_clock / (div * pre_div * ddr_pre_div) > clock && div < 16) in esdhc_pltfm_set_clock() 891 host->mmc->actual_clock = host_clock / (div * pre_div * ddr_pre_div); in esdhc_pltfm_set_clock() 895 pre_div >>= 1; in esdhc_pltfm_set_clock() 901 | (pre_div << ESDHC_PREDIV_SHIFT)); in esdhc_pltfm_set_clock()
|
/kernel/linux/linux-5.10/drivers/rtc/ |
D | rtc-ac100.c | 226 int div = 0, pre_div = 0; in ac100_clkout_set_rate() local 229 div = divider_get_val(rate * ac100_clkout_prediv[pre_div].div, in ac100_clkout_set_rate() 235 ac100_clkout_prediv[++pre_div].div); in ac100_clkout_set_rate() 240 pre_div = ac100_clkout_prediv[pre_div].val; in ac100_clkout_set_rate() 246 (pre_div - 1) << AC100_CLKOUT_PRE_DIV_SHIFT); in ac100_clkout_set_rate()
|
/kernel/linux/linux-5.10/drivers/iio/adc/ |
D | imx7d_adc.c | 123 u32 pre_div; member 128 .pre_div = (_pre_div), \ 205 info->pre_div_num = adc_analogure_clk.pre_div; in imx7d_adc_sample_rate_set()
|