/drivers/iio/afe/ |
D | iio-rescale.c | 32 s32 numerator; member 52 *val *= rescale->numerator; in rescale_read_raw() 56 *val *= rescale->numerator; in rescale_read_raw() 64 tmp *= rescale->numerator; in rescale_read_raw() 173 rescale->numerator = 1000000 / factor; in rescale_current_sense_amplifier_props() 176 factor = gcd(rescale->numerator, gain_mult); in rescale_current_sense_amplifier_props() 177 rescale->numerator /= factor; in rescale_current_sense_amplifier_props() 181 rescale->numerator *= gain_div / factor; in rescale_current_sense_amplifier_props() 202 rescale->numerator = 1000000 / factor; in rescale_current_sense_shunt_props() 222 &rescale->numerator); in rescale_voltage_divider_props() [all …]
|
/drivers/gpu/drm/amd/display/dc/basics/ |
D | conversion.c | 39 int32_t numerator; in fixed_point_to_int_frac() local 49 numerator = (uint16_t)dc_fixpt_round( in fixed_point_to_int_frac() 54 numerator = dc_fixpt_floor( in fixed_point_to_int_frac() 63 if (numerator >= 0) in fixed_point_to_int_frac() 64 result = (uint16_t)numerator; in fixed_point_to_int_frac() 67 (1 << (integer_bits + fractional_bits + 1)) + numerator); in fixed_point_to_int_frac()
|
D | fixpt31_32.c | 67 struct fixed31_32 dc_fixpt_from_fraction(long long numerator, long long denominator) in dc_fixpt_from_fraction() argument 71 bool arg1_negative = numerator < 0; in dc_fixpt_from_fraction() 74 unsigned long long arg1_value = arg1_negative ? -numerator : numerator; in dc_fixpt_from_fraction()
|
/drivers/media/i2c/et8ek8/ |
D | et8ek8_mode.c | 49 .numerator = 100, 150 .numerator = 100, 206 .numerator = 100, 262 .numerator = 100, 318 .numerator = 100, 374 .numerator = 100, 429 .numerator = 100, 485 .numerator = 100, 541 .numerator = 100,
|
/drivers/media/i2c/ |
D | vs6624.c | 657 ival->interval.numerator = sensor->frame_rate.denominator; in vs6624_g_frame_interval() 658 ival->interval.denominator = sensor->frame_rate.numerator; in vs6624_g_frame_interval() 669 if (tpf->numerator == 0 || tpf->denominator == 0 in vs6624_s_frame_interval() 670 || (tpf->denominator > tpf->numerator * MAX_FRAME_RATE)) { in vs6624_s_frame_interval() 672 tpf->numerator = 1; in vs6624_s_frame_interval() 675 sensor->frame_rate.numerator = tpf->denominator; in vs6624_s_frame_interval() 676 sensor->frame_rate.denominator = tpf->numerator; in vs6624_s_frame_interval() 679 sensor->frame_rate.numerator >> 8); in vs6624_s_frame_interval() 681 sensor->frame_rate.numerator & 0xFF); in vs6624_s_frame_interval() 785 sensor->frame_rate.numerator = MAX_FRAME_RATE; in vs6624_probe() [all …]
|
D | mt9v011.c | 201 static void calc_fps(struct v4l2_subdev *sd, u32 *numerator, u32 *denominator) in calc_fps() argument 225 if (numerator && denominator) { in calc_fps() 226 *numerator = 1000; in calc_fps() 231 static u16 calc_speed(struct v4l2_subdev *sd, u32 numerator, u32 denominator) in calc_speed() argument 239 if (!numerator || !denominator) in calc_speed() 250 t_time = core->xtal * ((u64)numerator); in calc_speed() 371 &ival->interval.numerator, in mt9v011_g_frame_interval() 383 speed = calc_speed(sd, tpf->numerator, tpf->denominator); in mt9v011_s_frame_interval() 389 calc_fps(sd, &tpf->numerator, &tpf->denominator); in mt9v011_s_frame_interval()
|
D | mt9v111.c | 451 unsigned int fps = tpf->numerator ? in mt9v111_calc_frame_rate() 452 tpf->denominator / tpf->numerator : in mt9v111_calc_frame_rate() 528 tpf->numerator = 1; in mt9v111_calc_frame_rate() 729 unsigned int fps = tpf->numerator ? in mt9v111_s_frame_interval() 730 tpf->denominator / tpf->numerator : in mt9v111_s_frame_interval() 734 if (!tpf->numerator) in mt9v111_s_frame_interval() 735 tpf->numerator = 1; in mt9v111_s_frame_interval() 784 tpf->numerator = 1; in mt9v111_g_frame_interval() 841 fie->interval.numerator = 1; in mt9v111_enum_frame_interval() 1195 tpf.numerator = 1; in mt9v111_probe()
|
D | imx274.c | 1211 __func__, imx274->frame_interval.numerator, in imx274_g_frame_interval() 1243 max = fi->interval.numerator * 1000000 in imx274_s_frame_interval() 1256 fi->interval.numerator * 1000000 in imx274_s_frame_interval() 1277 priv->frame_interval.numerator = 1; in imx274_load_default() 1730 __func__, frame_interval.numerator, in imx274_set_frame_interval() 1733 if (frame_interval.numerator == 0) { in imx274_set_frame_interval() 1739 / frame_interval.numerator); in imx274_set_frame_interval() 1743 frame_interval.numerator = 1; in imx274_set_frame_interval() 1746 frame_interval.numerator = 1; in imx274_set_frame_interval() 1775 * frame_interval.numerator in imx274_set_frame_interval() [all …]
|
D | ov6650.c | 554 if (timeperframe->numerator && timeperframe->denominator) in to_clkrc() 556 (FRAME_RATE_MAX * timeperframe->numerator); in to_clkrc() 758 ival->interval.numerator = GET_CLKRC_DIV(to_clkrc(&priv->tpf, in ov6650_g_frame_interval() 763 ival->interval.numerator, ival->interval.denominator); in ov6650_g_frame_interval() 777 if (tpf->numerator == 0 || tpf->denominator == 0) in ov6650_s_frame_interval() 780 div = (tpf->numerator * FRAME_RATE_MAX) / tpf->denominator; in ov6650_s_frame_interval() 787 tpf->numerator = div; in ov6650_s_frame_interval() 794 priv->tpf.numerator = GET_CLKRC_DIV(clkrc); in ov6650_s_frame_interval() 1041 priv->tpf.numerator = GET_CLKRC_DIV(DEF_CLKRC); in ov6650_probe()
|
D | ov7670.c | 808 tpf->numerator = 1; in ov7675_get_framerate() 840 if (tpf->numerator == 0 || tpf->denominator == 0) { in ov7675_set_framerate() 844 clkrc = (5 * pll_factor * info->clock_speed * tpf->numerator) / in ov7675_set_framerate() 881 tpf->numerator = 1; in ov7670_get_framerate_legacy() 893 if (tpf->numerator == 0 || tpf->denominator == 0) in ov7670_set_framerate_legacy() 896 div = (tpf->numerator * info->clock_speed) / tpf->denominator; in ov7670_set_framerate_legacy() 902 tpf->numerator = 1; in ov7670_set_framerate_legacy() 1221 fie->interval.numerator = 1; in ov7670_enum_frame_interval() 1924 tpf.numerator = 1; in ov7670_probe()
|
/drivers/media/platform/vivid/ |
D | vivid-kthread-out.c | 126 unsigned numerator; in vivid_thread_vid_out() local 158 numerator = dev->timeperframe_vid_out.numerator; in vivid_thread_vid_out() 168 (HZ * numerator) / 2; in vivid_thread_vid_out() 169 do_div(buffers_since_start, HZ * numerator); in vivid_thread_vid_out() 193 numerators_since_start = buffers_since_start * numerator; in vivid_thread_vid_out() 199 numerators_since_start += numerator; in vivid_thread_vid_out()
|
/drivers/phy/freescale/ |
D | phy-fsl-imx8-mipi-dphy.c | 160 u32 lp_t, numerator, denominator; in mixel_dphy_config_from_opts() local 169 numerator = dphy_opts->hs_clk_rate; in mixel_dphy_config_from_opts() 171 get_best_ratio(&numerator, &denominator, 255, 256); in mixel_dphy_config_from_opts() 172 if (!numerator || !denominator) { in mixel_dphy_config_from_opts() 174 numerator, denominator, in mixel_dphy_config_from_opts() 179 while ((numerator < 16) && (denominator <= 128)) { in mixel_dphy_config_from_opts() 180 numerator <<= 1; in mixel_dphy_config_from_opts() 193 cfg->cm = numerator; in mixel_dphy_config_from_opts() 202 numerator, denominator); in mixel_dphy_config_from_opts() 207 dphy_opts->hs_clk_rate, ref_clk, numerator, denominator); in mixel_dphy_config_from_opts()
|
/drivers/media/v4l2-core/ |
D | v4l2-dv-timings.c | 347 bt->picture_aspect.numerator, in v4l2_print_dv_timings() 366 ratio.numerator = t->bt.width * t->bt.picture_aspect.denominator; in v4l2_dv_timings_aspect_ratio() 367 ratio.denominator = t->bt.height * t->bt.picture_aspect.numerator; in v4l2_dv_timings_aspect_ratio() 369 rational_best_approximation(ratio.numerator, ratio.denominator, in v4l2_dv_timings_aspect_ratio() 370 ratio.numerator, ratio.denominator, &n, &d); in v4l2_dv_timings_aspect_ratio() 371 ratio.numerator = n; in v4l2_dv_timings_aspect_ratio() 410 fps_fract.numerator = d; in v4l2_calc_timeperframe() 724 if (aspect.numerator == 0 || aspect.denominator == 0) { in v4l2_detect_gtf() 725 aspect.numerator = 16; in v4l2_detect_gtf() 728 image_width = ((image_height * aspect.numerator) / aspect.denominator); in v4l2_detect_gtf() [all …]
|
/drivers/staging/media/soc_camera/ |
D | soc_mediabus.c | 385 unsigned int *numerator, unsigned int *denominator) in soc_mbus_samples_per_pixel() argument 390 *numerator = 1; in soc_mbus_samples_per_pixel() 394 *numerator = 1; in soc_mbus_samples_per_pixel() 399 *numerator = 2; in soc_mbus_samples_per_pixel() 403 *numerator = 3; in soc_mbus_samples_per_pixel() 407 *numerator = 0; in soc_mbus_samples_per_pixel()
|
/drivers/media/usb/uvc/ |
D | uvc_v4l2.c | 332 u32 numerator, denominator; in uvc_v4l2_get_streamparm() local 338 numerator = stream->ctrl.dwFrameInterval; in uvc_v4l2_get_streamparm() 342 uvc_simplify_fraction(&numerator, &denominator, 8, 333); in uvc_v4l2_get_streamparm() 350 parm->parm.capture.timeperframe.numerator = numerator; in uvc_v4l2_get_streamparm() 357 parm->parm.output.timeperframe.numerator = numerator; in uvc_v4l2_get_streamparm() 383 interval = uvc_fraction_to_interval(timeperframe.numerator, in uvc_v4l2_set_streamparm() 386 timeperframe.numerator, timeperframe.denominator, interval); in uvc_v4l2_set_streamparm() 435 timeperframe.numerator = probe.dwFrameInterval; in uvc_v4l2_set_streamparm() 437 uvc_simplify_fraction(&timeperframe.numerator, in uvc_v4l2_set_streamparm() 1241 fival->discrete.numerator = in uvc_ioctl_enum_frameintervals() [all …]
|
/drivers/staging/sm750fb/ |
D | sm750.h | 181 unsigned long long numerator = 1000 * 1000 * 1000 * 1000ULL; in ps_to_hz() local 183 do_div(numerator, psvalue); in ps_to_hz() 184 return (unsigned long)numerator; in ps_to_hz()
|
/drivers/gpu/drm/amd/display/dc/calcs/ |
D | bw_fixed.c | 57 struct bw_fixed bw_frc_to_fixed(int64_t numerator, int64_t denominator) in bw_frc_to_fixed() argument 60 bool arg1_negative = numerator < 0; in bw_frc_to_fixed() 71 arg1_value = abs_i64(numerator); in bw_frc_to_fixed()
|
/drivers/media/usb/pvrusb2/ |
D | pvrusb2-std.c | 230 .numerator = 1, 241 .numerator = 1001, 250 .numerator = 1001, 259 .numerator = 1001,
|
/drivers/media/platform/sti/delta/ |
D | delta-debug.c | 28 s->pixelaspect.numerator, in delta_streaminfo_str() 49 f->pixelaspect.numerator, in delta_frameinfo_str()
|
/drivers/media/pci/tw5864/ |
D | tw5864-video.c | 715 frameinterval->numerator = 1001; in tw5864_frameinterval_get() 720 frameinterval->numerator = 1; in tw5864_frameinterval_get() 773 fintv->stepwise.max.numerator *= std_max_fps; in tw5864_enum_frameintervals() 788 cp->timeperframe.numerator *= input->frame_interval; in tw5864_g_parm() 807 if (!t->numerator || !t->denominator) { in tw5864_s_parm() 808 t->numerator = time_base.numerator * input->frame_interval; in tw5864_s_parm() 811 t->numerator = t->numerator * time_base.denominator / in tw5864_s_parm() 816 input->frame_interval = t->numerator / time_base.numerator; in tw5864_s_parm()
|
/drivers/media/platform/coda/ |
D | coda-common.c | 1212 f->stepwise.min.numerator = 1; in coda_enum_frameintervals() 1214 f->stepwise.max.numerator = 65536; in coda_enum_frameintervals() 1216 f->stepwise.step.numerator = 1; in coda_enum_frameintervals() 1233 tpf->numerator = 1 + (ctx->params.framerate >> in coda_g_parm() 1252 if (s.numerator == 0 || s.denominator / s.numerator > 65535) { in coda_approximate_timeperframe() 1253 timeperframe->numerator = 1; in coda_approximate_timeperframe() 1259 if (s.denominator == 0 || s.numerator / s.denominator > 65536) { in coda_approximate_timeperframe() 1260 timeperframe->numerator = 65536; in coda_approximate_timeperframe() 1266 div = gcd(s.numerator, s.denominator); in coda_approximate_timeperframe() 1268 s.numerator /= div; in coda_approximate_timeperframe() [all …]
|
/drivers/iio/adc/ |
D | sc27xx_adc.c | 286 u32 numerator, denominator; in sc27xx_adc_convert_volt() local 308 sc27xx_adc_volt_ratio(data, channel, scale, &numerator, &denominator); in sc27xx_adc_convert_volt() 310 return (volt * denominator + numerator / 2) / numerator; in sc27xx_adc_convert_volt()
|
/drivers/media/usb/s2255/ |
D | s2255drv.c | 1277 sp->parm.capture.timeperframe.numerator = def_num; in vidioc_g_parm() 1280 sp->parm.capture.timeperframe.numerator = def_num * 2; in vidioc_g_parm() 1283 sp->parm.capture.timeperframe.numerator = def_num * 3; in vidioc_g_parm() 1286 sp->parm.capture.timeperframe.numerator = def_num * 5; in vidioc_g_parm() 1292 sp->parm.capture.timeperframe.numerator, in vidioc_g_parm() 1314 sp->parm.capture.timeperframe.numerator = def_num; in vidioc_s_parm() 1315 else if (sp->parm.capture.timeperframe.numerator <= def_num) in vidioc_s_parm() 1316 sp->parm.capture.timeperframe.numerator = def_num; in vidioc_s_parm() 1317 else if (sp->parm.capture.timeperframe.numerator <= (def_num * 2)) { in vidioc_s_parm() 1318 sp->parm.capture.timeperframe.numerator = def_num * 2; in vidioc_s_parm() [all …]
|
/drivers/media/platform/sti/hva/ |
D | hva-h264.c | 651 if (time_per_frame->numerator >= 536) { in hva_h264_prepare_task() 658 (time_per_frame->numerator >> 1) - 1) / in hva_h264_prepare_task() 659 time_per_frame->numerator; in hva_h264_prepare_task() 666 td->bit_rate /= time_per_frame->numerator; in hva_h264_prepare_task() 670 td->framerate_den = time_per_frame->numerator; in hva_h264_prepare_task()
|
/drivers/media/platform/qcom/venus/ |
D | venc.c | 509 if (!timeperframe->numerator) in venc_s_parm() 510 timeperframe->numerator = inst->timeperframe.numerator; in venc_s_parm() 514 us_per_frame = timeperframe->numerator * (u64)USEC_PER_SEC; in venc_s_parm() 602 fival->stepwise.min.numerator = 1; in venc_enum_frameintervals() 604 fival->stepwise.max.numerator = 1; in venc_enum_frameintervals() 606 fival->stepwise.step.numerator = 1; in venc_enum_frameintervals() 1135 inst->timeperframe.numerator = 1; in venc_inst_init()
|