Home
last modified time | relevance | path

Searched refs:den (Results 1 – 25 of 57) sorted by relevance

123

/drivers/gpu/drm/amd/amdgpu/
Damdgpu_pll.c44 static void amdgpu_pll_reduce_ratio(unsigned *nom, unsigned *den, in amdgpu_pll_reduce_ratio() argument
50 tmp = gcd(*nom, *den); in amdgpu_pll_reduce_ratio()
52 *den /= tmp; in amdgpu_pll_reduce_ratio()
58 *den *= tmp; in amdgpu_pll_reduce_ratio()
62 if (*den < den_min) { in amdgpu_pll_reduce_ratio()
63 tmp = DIV_ROUND_UP(den_min, *den); in amdgpu_pll_reduce_ratio()
65 *den *= tmp; in amdgpu_pll_reduce_ratio()
83 static void amdgpu_pll_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_div, in amdgpu_pll_get_fb_ref_div() argument
91 *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u), ref_div_max); in amdgpu_pll_get_fb_ref_div()
92 *fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den); in amdgpu_pll_get_fb_ref_div()
[all …]
/drivers/clk/mmp/
Dclk-frac.c37 rate *= factor->ftbl[i].den; in clk_factor_round_rate()
58 unsigned int val, num, den; in clk_factor_recalc_rate() local
67 den = (val >> masks->den_shift) & masks->den_mask; in clk_factor_recalc_rate()
69 if (!den) in clk_factor_recalc_rate()
73 rate *= den; in clk_factor_recalc_rate()
92 rate *= factor->ftbl[i].den; in clk_factor_set_rate()
110 val |= (factor->ftbl[i].den & masks->den_mask) << masks->den_shift; in clk_factor_set_rate()
124 u32 val, num, den; in clk_factor_init() local
137 den = (val >> masks->den_shift) & masks->den_mask; in clk_factor_init()
140 if (den == factor->ftbl[i].den && num == factor->ftbl[i].num) in clk_factor_init()
[all …]
Dclk-of-mmp2.c148 {.num = 8125, .den = 1536}, /*14.745MHZ */
149 {.num = 3521, .den = 689}, /*19.23MHZ */
162 {.num = 24868, .den = 511}, /* 2.0480 MHz */
163 {.num = 28003, .den = 793}, /* 2.8224 MHz */
164 {.num = 24941, .den = 1025}, /* 4.0960 MHz */
165 {.num = 28003, .den = 1586}, /* 5.6448 MHz */
166 {.num = 31158, .den = 2561}, /* 8.1920 MHz */
167 {.num = 16288, .den = 1845}, /* 11.2896 MHz */
168 {.num = 20772, .den = 2561}, /* 12.2880 MHz */
169 {.num = 8144, .den = 1845}, /* 22.5792 MHz */
[all …]
/drivers/media/dvb-frontends/cxd2880/
Dcxd2880_tnrdmd_dvbt_mon.c550 int den; in cxd2880_tnrdmd_dvbt_mon_sampling_offset() local
639 den = (nominal_rate_reg[0] & 0x7f) << 24; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
640 den |= nominal_rate_reg[1] << 16; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
641 den |= nominal_rate_reg[2] << 8; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
642 den |= nominal_rate_reg[3]; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
643 den = (den + (390625 / 2)) / 390625; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
645 den >>= 1; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
648 *ppm = (num + (den / 2)) / den; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
650 *ppm = (num - (den / 2)) / den; in cxd2880_tnrdmd_dvbt_mon_sampling_offset()
Dcxd2880_tnrdmd_dvbt2_mon.c1437 int den; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset() local
1537 den = (nominal_rate_reg[0] & 0x7f) << 24; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1538 den |= nominal_rate_reg[1] << 16; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1539 den |= nominal_rate_reg[2] << 8; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1540 den |= nominal_rate_reg[3]; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1541 den = (den + (390625 / 2)) / 390625; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1543 den >>= 1; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1546 *ppm = (num + (den / 2)) / den; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
1548 *ppm = (num - (den / 2)) / den; in cxd2880_tnrdmd_dvbt2_mon_sampling_offset()
/drivers/gpu/drm/i915/display/
Dintel_sprite.c361 unsigned int *num, unsigned int *den) in skl_plane_ratio() argument
369 *den = 8; in skl_plane_ratio()
372 *den = 8; in skl_plane_ratio()
376 *den = 1; in skl_plane_ratio()
384 unsigned int num, den; in skl_plane_min_cdclk() local
387 skl_plane_ratio(crtc_state, plane_state, &num, &den); in skl_plane_min_cdclk()
391 den *= 2; in skl_plane_min_cdclk()
393 return DIV_ROUND_UP(pixel_rate * num, den); in skl_plane_min_cdclk()
846 unsigned int *num, unsigned int *den) in vlv_plane_ratio() argument
862 *den = 8; in vlv_plane_ratio()
[all …]
/drivers/clk/qcom/
Dclk-rcg2.c387 int den; member
431 request *= frac->den; in clk_edp_pixel_set_rate()
443 f.n = frac->den; in clk_edp_pixel_set_rate()
481 request *= frac->den; in clk_edp_pixel_determine_rate()
493 frac->num, frac->den, in clk_edp_pixel_determine_rate()
494 !!frac->den, hid_div); in clk_edp_pixel_determine_rate()
657 request = (req->rate * frac->den) / frac->num; in clk_pixel_determine_rate()
665 req->rate = (src_rate * frac->num) / frac->den; in clk_pixel_determine_rate()
695 request = (rate * frac->den) / frac->num; in clk_pixel_set_rate()
707 f.n = frac->den; in clk_pixel_set_rate()
[all …]
/drivers/clk/spear/
Dclk-aux-synth.c69 unsigned int num = 1, den = 1, val, eqn; in clk_aux_recalc_rate() local
82 den = 2; in clk_aux_recalc_rate()
89 den *= (val >> aux->masks->yscale_sel_shift) & in clk_aux_recalc_rate()
92 if (!den) in clk_aux_recalc_rate()
95 return (((parent_rate / 10000) * num) / den) * 10000; in clk_aux_recalc_rate()
Dclk-vco-pll.c197 unsigned int num = 2, den = 0, val, mode = 0; in clk_vco_recalc_rate() local
209 den = (val >> PLL_DIV_N_SHIFT) & PLL_DIV_N_MASK; in clk_vco_recalc_rate()
218 den *= 256; in clk_vco_recalc_rate()
221 if (!den) { in clk_vco_recalc_rate()
226 return (((parent_rate / 10000) * num) / den) * 10000; in clk_vco_recalc_rate()
/drivers/media/i2c/m5mols/
Dm5mols_capture.c43 u32 num, den; in m5mols_read_rational() local
47 ret = m5mols_read_u32(sd, addr_den, &den); in m5mols_read_rational()
50 *val = den == 0 ? 0 : num / den; in m5mols_read_rational()
/drivers/iio/adc/
Dqcom-spmi-adc5.c158 {.num = 1, .den = 1},
159 {.num = 1, .den = 3},
160 {.num = 1, .den = 4},
161 {.num = 1, .den = 6},
162 {.num = 1, .den = 20},
163 {.num = 1, .den = 8},
164 {.num = 10, .den = 81},
165 {.num = 1, .den = 10},
166 {.num = 1, .den = 16}
184 static int adc5_prescaling_from_dt(u32 num, u32 den) in adc5_prescaling_from_dt() argument
[all …]
Dqcom-spmi-vadc.c127 {.num = 1, .den = 1},
128 {.num = 1, .den = 3},
129 {.num = 1, .den = 4},
130 {.num = 1, .den = 6},
131 {.num = 1, .den = 20},
132 {.num = 1, .den = 8},
133 {.num = 10, .den = 81},
134 {.num = 1, .den = 10}
408 static int vadc_prescaling_from_dt(u32 num, u32 den) in vadc_prescaling_from_dt() argument
414 vadc_prescale_ratios[pre].den == den) in vadc_prescaling_from_dt()
Dqcom-vadc-common.c392 voltage = voltage * prescale->den; in qcom_vadc_scale_volt()
434 temp = voltage * prescale->den; in qcom_vadc_scale_die_temp()
455 voltage = voltage * prescale->den; in qcom_vadc_scale_chg_temp()
485 voltage *= prescale->den; in qcom_vadc_scale_code_voltage_factor()
/drivers/gpu/drm/i915/gt/
Dintel_gt_clock_utils.c64 static u64 div_u64_roundup(u64 nom, u32 den) in div_u64_roundup() argument
66 return div_u64(nom + den - 1, den); in div_u64_roundup()
/drivers/staging/media/meson/vdec/
Dcodec_vp9.c1450 int den, m_count, get_prob, factor; in vp9_tree_merge_probs() local
1457 den = tree_left + tree_right; in vp9_tree_merge_probs()
1459 if (den == 0) { in vp9_tree_merge_probs()
1462 m_count = den < MODE_MV_COUNT_SAT ? den : MODE_MV_COUNT_SAT; in vp9_tree_merge_probs()
1465 (den >> 1)), in vp9_tree_merge_probs()
1466 den)); in vp9_tree_merge_probs()
1489 int num, den, m_count, get_prob, factor; in adapt_coef_probs_cxt() local
1515 den = branch_ct[node][0] + branch_ct[node][1]; in adapt_coef_probs_cxt()
1516 m_count = den < count_sat ? den : count_sat; in adapt_coef_probs_cxt()
1518 get_prob = (den == 0) ? in adapt_coef_probs_cxt()
[all …]
/drivers/clk/meson/
Dsclk-div.c116 sclk->cached_duty.den); in sclk_apply_ratio()
147 duty->den = 2; in sclk_div_get_duty_cycle()
153 duty->den = sclk->cached_div; in sclk_div_get_duty_cycle()
/drivers/video/fbdev/core/
Dfbcvt.c76 u32 den; in fb_cvt_hperiod() local
80 den = 2 * (cvt->yres/cvt->interlace + 2 * cvt->v_margin); in fb_cvt_hperiod()
83 den = 2 * (cvt->yres/cvt->interlace + cvt->v_margin * 2 in fb_cvt_hperiod()
87 return 2 * (num/den); in fb_cvt_hperiod()
/drivers/gpu/drm/radeon/
Dradeon_display.c893 static void avivo_reduce_ratio(unsigned *nom, unsigned *den, in avivo_reduce_ratio() argument
899 tmp = gcd(*nom, *den); in avivo_reduce_ratio()
901 *den /= tmp; in avivo_reduce_ratio()
907 *den *= tmp; in avivo_reduce_ratio()
911 if (*den < den_min) { in avivo_reduce_ratio()
912 tmp = DIV_ROUND_UP(den_min, *den); in avivo_reduce_ratio()
914 *den *= tmp; in avivo_reduce_ratio()
932 static void avivo_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_div, in avivo_get_fb_ref_div() argument
940 *ref_div = min(max(den/post_div, 1u), ref_div_max); in avivo_get_fb_ref_div()
941 *fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den); in avivo_get_fb_ref_div()
[all …]
/drivers/media/v4l2-core/
Dv4l2-dv-timings.c756 u32 den; in v4l2_detect_gtf() local
760 den = (hfreq * (100 - GTF_D_C_PRIME) + GTF_D_M_PRIME * 1000) * in v4l2_detect_gtf()
762 h_blank = div_u64((num + (den >> 1)), den); in v4l2_detect_gtf()
766 u32 den; in v4l2_detect_gtf() local
770 den = (hfreq * (100 - GTF_S_C_PRIME) + GTF_S_M_PRIME * 1000) * in v4l2_detect_gtf()
772 h_blank = div_u64((num + (den >> 1)), den); in v4l2_detect_gtf()
/drivers/staging/vc04_services/bcm2835-camera/
Dcontrols.c169 rational_value.den = 100; in ctrl_set_rational()
500 gains.r_gain.den = gains.b_gain.den = 1000; in ctrl_set_awb_gains()
1282 fps_range.fps_high.den = dev->capture.timeperframe.numerator; in set_framerate_params()
1288 fps_range.fps_low.den = 1; in set_framerate_params()
1292 fps_range.fps_low.den = fps_range.fps_high.den; in set_framerate_params()
1298 fps_range.fps_low.den, in set_framerate_params()
1300 fps_range.fps_high.den); in set_framerate_params()
/drivers/thermal/qcom/
Dtsens.c81 int num, den; in compute_intercept_slope() local
96 den = CAL_DEGC_PT2 - CAL_DEGC_PT1; in compute_intercept_slope()
97 priv->sensor[i].slope = num / den; in compute_intercept_slope()
118 int degc, num, den; in code_to_degc() local
121 den = s->slope; in code_to_degc()
124 degc = num + (den / 2); in code_to_degc()
126 degc = num - (den / 2); in code_to_degc()
130 degc /= den; in code_to_degc()
/drivers/gpu/drm/msm/dp/
Ddp_catalog.c412 unsigned long den, num; in dp_catalog_ctrl_config_msa() local
430 (unsigned long)(1 << 16) - 1, &den, &num); in dp_catalog_ctrl_config_msa()
432 den = ~(den - num); in dp_catalog_ctrl_config_msa()
433 den = den & 0xFFFF; in dp_catalog_ctrl_config_msa()
435 pixel_n = den; in dp_catalog_ctrl_config_msa()
/drivers/video/fbdev/riva/
Dfbdev.c862 int nom, int den) in rivafb_do_maximize() argument
882 if (modes[i].xres * nom / den * modes[i].yres < in rivafb_do_maximize()
899 var->xres_virtual = (info->fix.smem_len * den / in rivafb_do_maximize()
905 var->yres_virtual = info->fix.smem_len * den / in rivafb_do_maximize()
911 if (var->xres_virtual * nom / den * var->yres_virtual > info->fix.smem_len) { in rivafb_do_maximize()
920 if (var->xres_virtual * nom / den >= 8192) { in rivafb_do_maximize()
923 var->xres_virtual, 8192 * den / nom - 16); in rivafb_do_maximize()
924 var->xres_virtual = 8192 * den / nom - 16; in rivafb_do_maximize()
1083 int nom, den; /* translating from pixels->bytes */ in rivafb_check_var() local
1095 nom = den = 1; in rivafb_check_var()
[all …]
/drivers/video/fbdev/aty/
Dradeonfb.h439 static inline int round_div(int num, int den) in round_div() argument
441 return (num + (den / 2)) / den; in round_div()
/drivers/staging/vc04_services/vchiq-mmal/
Dmmal-msg-common.h45 s32 den; /**< Denominator */ member

123