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
193 * through all of the per-time scales and copying the unique scales in do_combined_scaletable()
196 * We assume all the gains for same integration time were unique. in do_combined_scaletable()
197 * It is likely the first time table had greatest time multiplier as in do_combined_scaletable()
320 * time. in compute_per_time_tables()
338 * Create a table of supported scales for each supported integration time.
340 * setting to change the integration time to display correct set of scales
341 * depending on the used integration time.
366 * @gts: Gain time scale descriptor
369 * originally given gain and time tables. When both time and gain tables are
372 * integration time.
418 * @gts: Gain time scale descriptor
466 * the given time table were not unique. Else we could just in iio_gts_build_avail_time_table()
483 * iio_gts_purge_avail_time_table - free-up the available integration time table
484 * @gts: Gain time scale descriptor
499 * @gts: Gain time scale descriptor
503 * given gain and given time tables.
505 * When both time and gain tables are
508 * integration time.
539 * @gts: Gain time scale descriptor
542 * integration time and scale tables.
558 * @gts: Gain time scale descriptor
562 * given gain and given time tables.
564 * When both time and gain tables are given this results:
566 * integration time.
664 * devm_iio_init_iio_gts - Initialize the gain-time-scale helper
672 * the integration time table sorted so that the preferred
673 * integration time is in the first array index. The search
676 * from first provided time.
677 * @num_times: number of times in the time table
680 * Initialize the gain-time-scale helper for use. Note, gains, times, selectors
682 * checking. The total gain (maximum gain * maximum time multiplier) must not
705 * @gts: Gain time scale descriptor
727 * iio_gts_avail_scales_for_time - list scales for integration time
728 * @gts: Gain time scale descriptor
729 * @time: Integration time for which the scales are listed
734 * Drivers which do not allow scale setting to change integration time can
736 * time.
740 int iio_gts_avail_scales_for_time(struct iio_gts *gts, int time, in iio_gts_avail_scales_for_time() argument
746 if (gts->itime_table[i].time_us == time) in iio_gts_avail_scales_for_time()
762 * @gts: Gain time scale descriptor
785 * @gts: Gain time scale descriptor
805 * @gts: Gain time scale descriptor
825 * @gts: Gain time scale descriptor
848 * @gts: Gain time scale descriptor
910 const struct iio_itime_sel_mul *time; in iio_gts_get_int_time_gain_multiplier_by_sel() local
912 time = iio_gts_find_itime_by_sel(gts, sel); in iio_gts_get_int_time_gain_multiplier_by_sel()
913 if (!time) in iio_gts_get_int_time_gain_multiplier_by_sel()
916 return time->mul; in iio_gts_get_int_time_gain_multiplier_by_sel()
920 * iio_gts_find_gain_for_scale_using_time - Find gain by time and scale
921 * @gts: Gain time scale descriptor
922 * @time_sel: Integration time selector corresponding to the time gain is
929 * corresponds given scale and integration time. Sensors which fill the
930 * gain and time tables may use this helper to retrieve the gain.
964 * @gts: Gain time scale descriptor
965 * @time_sel: Integration time selector corresponding to the time gain is
995 * iio_gts_find_gain_time_sel_for_scale - Fetch gain and time selectors for scale
996 * @gts: Gain time scale descriptor
1000 * @time_sel: Pointer to value where time selector is stored.
1003 * gain and time selectors for a given scale.
1030 * iio_gts_get_total_gain - Fetch total gain for given HW-gain and time
1031 * @gts: Gain time scale descriptor
1033 * @time: Integration time for which the total gain is searched for
1037 int iio_gts_get_total_gain(struct iio_gts *gts, int gain, int time) in iio_gts_get_total_gain() argument
1047 itime = iio_gts_find_itime_by_time(gts, time); in iio_gts_get_total_gain()
1055 static int iio_gts_get_scale_linear(struct iio_gts *gts, int gain, int time, in iio_gts_get_scale_linear() argument
1061 total_gain = iio_gts_get_total_gain(gts, gain, time); in iio_gts_get_scale_linear()
1075 * iio_gts_get_scale - get scale based on integration time and HW-gain
1076 * @gts: Gain time scale descriptor
1078 * @time: Integration time for which the scale is computed
1082 * Compute scale matching the integration time and HW-gain given as parameter.
1086 int iio_gts_get_scale(struct iio_gts *gts, int gain, int time, int *scale_int, in iio_gts_get_scale() argument
1092 ret = iio_gts_get_scale_linear(gts, gain, time, &lin_scale); in iio_gts_get_scale()
1101 * iio_gts_find_new_gain_sel_by_old_gain_time - compensate for time change
1102 * @gts: Gain time scale descriptor
1104 * @old_time_sel: Selector corresponding previously set time
1105 * @new_time_sel: Selector corresponding new time to be set
1109 * time (for a light sensor) by also updating the (HW)gain. This helper computes
1110 * new gain value to maintain the scale with new integration time.
1158 * iio_gts_find_new_gain_by_old_gain_time - compensate for time change
1159 * @gts: Gain time scale descriptor
1161 * @old_time: Selector corresponding previously set time
1162 * @new_time: Selector corresponding new time to be set
1166 * time (for a light sensor) by also updating the (HW)gain. This helper computes
1167 * new gain value to maintain the scale with new integration time.
1210 * iio_gts_find_new_gain_by_gain_time_min - compensate for time change
1211 * @gts: Gain time scale descriptor
1213 * @old_time: Selector corresponding previously set time
1214 * @new_time: Selector corresponding new time to be set
1253 MODULE_DESCRIPTION("IIO light sensor gain-time-scale helpers");