Lines Matching full:time

2 /* gain-time-scale conversion helpers for IIO light sensors
45 * gain_get_scale_fraction - get the gain or time based on scale and known one
50 * @scale: Linearized scale to compute the gain/time for.
51 * @known: Either integration time or gain depending on which one is known
52 * @unknown: Pointer to variable where the computed gain/time is stored
55 * Compute either gain or time based on scale and either the gain or time
115 * @gts: Gain time scale descriptor
121 * generated by HW-gain or integration time. It is up to caller to decide what
122 * part of the total gain is due to integration time and what due to HW-gain.
141 * @gts: Gain time scale descriptor
198 * We assume all the gains for same integration time were unique. in gain_to_scaletables()
199 * It is likely the first time table had greatest time multiplier as in gain_to_scaletables()
261 * @gts: Gain time scale descriptor
264 * originally given gain and time tables. When both time and gain tables are
267 * integration time.
342 * @gts: Gain time scale descriptor
390 * the given time table were not unique. Else we could just in iio_gts_build_avail_time_table()
407 * iio_gts_purge_avail_time_table - free-up the available integration time table
408 * @gts: Gain time scale descriptor
423 * @gts: Gain time scale descriptor
427 * given gain and given time tables.
429 * When both time and gain tables are
432 * integration time.
463 * @gts: Gain time scale descriptor
466 * integration time and scale tables.
482 * @gts: Gain time scale descriptor
486 * given gain and given time tables.
488 * When both time and gain tables are given this results:
490 * integration time.
588 * devm_iio_init_iio_gts - Initialize the gain-time-scale helper
596 * the integration time table sorted so that the preferred
597 * integration time is in the first array index. The search
600 * from first provided time.
601 * @num_times: number of times in the time table
604 * Initialize the gain-time-scale helper for use. Note, gains, times, selectors
606 * checking. The total gain (maximum gain * maximum time multiplier) must not
629 * @gts: Gain time scale descriptor
651 * iio_gts_avail_scales_for_time - list scales for integration time
652 * @gts: Gain time scale descriptor
653 * @time: Integration time for which the scales are listed
658 * Drivers which do not allow scale setting to change integration time can
660 * time.
664 int iio_gts_avail_scales_for_time(struct iio_gts *gts, int time, in iio_gts_avail_scales_for_time() argument
670 if (gts->itime_table[i].time_us == time) in iio_gts_avail_scales_for_time()
686 * @gts: Gain time scale descriptor
709 * @gts: Gain time scale descriptor
729 * @gts: Gain time scale descriptor
749 * @gts: Gain time scale descriptor
772 * @gts: Gain time scale descriptor
834 const struct iio_itime_sel_mul *time; in iio_gts_get_int_time_gain_multiplier_by_sel() local
836 time = iio_gts_find_itime_by_sel(gts, sel); in iio_gts_get_int_time_gain_multiplier_by_sel()
837 if (!time) in iio_gts_get_int_time_gain_multiplier_by_sel()
840 return time->mul; in iio_gts_get_int_time_gain_multiplier_by_sel()
844 * iio_gts_find_gain_for_scale_using_time - Find gain by time and scale
845 * @gts: Gain time scale descriptor
846 * @time_sel: Integration time selector corresponding to the time gain is
853 * corresponds given scale and integration time. Sensors which fill the
854 * gain and time tables may use this helper to retrieve the gain.
888 * @gts: Gain time scale descriptor
889 * @time_sel: Integration time selector corresponding to the time gain is
918 static int iio_gts_get_total_gain(struct iio_gts *gts, int gain, int time) in iio_gts_get_total_gain() argument
928 itime = iio_gts_find_itime_by_time(gts, time); in iio_gts_get_total_gain()
935 static int iio_gts_get_scale_linear(struct iio_gts *gts, int gain, int time, in iio_gts_get_scale_linear() argument
941 total_gain = iio_gts_get_total_gain(gts, gain, time); in iio_gts_get_scale_linear()
955 * iio_gts_get_scale - get scale based on integration time and HW-gain
956 * @gts: Gain time scale descriptor
958 * @time: Integration time for which the scale is computed
962 * Compute scale matching the integration time and HW-gain given as parameter.
966 int iio_gts_get_scale(struct iio_gts *gts, int gain, int time, int *scale_int, in iio_gts_get_scale() argument
972 ret = iio_gts_get_scale_linear(gts, gain, time, &lin_scale); in iio_gts_get_scale()
981 * iio_gts_find_new_gain_sel_by_old_gain_time - compensate for time change
982 * @gts: Gain time scale descriptor
984 * @old_time_sel: Selector corresponding previously set time
985 * @new_time_sel: Selector corresponding new time to be set
989 * time (for a light sensor) by also updating the (HW)gain. This helper computes
990 * new gain value to maintain the scale with new integration time.
1038 * iio_gts_find_new_gain_by_old_gain_time - compensate for time change
1039 * @gts: Gain time scale descriptor
1041 * @old_time: Selector corresponding previously set time
1042 * @new_time: Selector corresponding new time to be set
1046 * time (for a light sensor) by also updating the (HW)gain. This helper computes
1047 * new gain value to maintain the scale with new integration time.
1091 MODULE_DESCRIPTION("IIO light sensor gain-time-scale helpers");