Lines Matching full:time

2 /* gain-time-scale conversion helpers for IIO light sensors
58 * gain_get_scale_fraction - get the gain or time based on scale and known one
63 * @scale: Linearized scale to compute the gain/time for.
64 * @known: Either integration time or gain depending on which one is known
65 * @unknown: Pointer to variable where the computed gain/time is stored
68 * Compute either gain or time based on scale and either the gain or time
128 * @gts: Gain time scale descriptor
134 * generated by HW-gain or integration time. It is up to caller to decide what
135 * part of the total gain is due to integration time and what due to HW-gain.
154 * @gts: Gain time scale descriptor
211 * We assume all the gains for same integration time were unique. in gain_to_scaletables()
212 * It is likely the first time table had greatest time multiplier as in gain_to_scaletables()
274 * @gts: Gain time scale descriptor
277 * originally given gain and time tables. When both time and gain tables are
280 * integration time.
353 * @gts: Gain time scale descriptor
398 * the given time table were not unique. Else we could just in iio_gts_build_avail_time_table()
415 * iio_gts_purge_avail_time_table - free-up the available integration time table
416 * @gts: Gain time scale descriptor
431 * @gts: Gain time scale descriptor
435 * given gain and given time tables.
437 * When both time and gain tables are
440 * integration time.
471 * @gts: Gain time scale descriptor
474 * integration time and scale tables.
490 * @gts: Gain time scale descriptor
494 * given gain and given time tables.
496 * When both time and gain tables are given this results:
498 * integration time.
596 * devm_iio_init_iio_gts - Initialize the gain-time-scale helper
604 * the integration time table sorted so that the preferred
605 * integration time is in the first array index. The search
608 * from first provided time.
609 * @num_times: number of times in the time table
612 * Initialize the gain-time-scale helper for use. Note, gains, times, selectors
614 * checking. The total gain (maximum gain * maximum time multiplier) must not
637 * @gts: Gain time scale descriptor
659 * iio_gts_avail_scales_for_time - list scales for integration time
660 * @gts: Gain time scale descriptor
661 * @time: Integration time for which the scales are listed
666 * Drivers which do not allow scale setting to change integration time can
668 * time.
672 int iio_gts_avail_scales_for_time(struct iio_gts *gts, int time, in iio_gts_avail_scales_for_time() argument
678 if (gts->itime_table[i].time_us == time) in iio_gts_avail_scales_for_time()
694 * @gts: Gain time scale descriptor
717 * @gts: Gain time scale descriptor
737 * @gts: Gain time scale descriptor
757 * @gts: Gain time scale descriptor
780 * @gts: Gain time scale descriptor
842 const struct iio_itime_sel_mul *time; in iio_gts_get_int_time_gain_multiplier_by_sel() local
844 time = iio_gts_find_itime_by_sel(gts, sel); in iio_gts_get_int_time_gain_multiplier_by_sel()
845 if (!time) in iio_gts_get_int_time_gain_multiplier_by_sel()
848 return time->mul; in iio_gts_get_int_time_gain_multiplier_by_sel()
852 * iio_gts_find_gain_for_scale_using_time - Find gain by time and scale
853 * @gts: Gain time scale descriptor
854 * @time_sel: Integration time selector corresponding to the time gain is
861 * corresponds given scale and integration time. Sensors which fill the
862 * gain and time tables may use this helper to retrieve the gain.
896 * @gts: Gain time scale descriptor
897 * @time_sel: Integration time selector corresponding to the time gain is
926 static int iio_gts_get_total_gain(struct iio_gts *gts, int gain, int time) in iio_gts_get_total_gain() argument
936 itime = iio_gts_find_itime_by_time(gts, time); in iio_gts_get_total_gain()
943 static int iio_gts_get_scale_linear(struct iio_gts *gts, int gain, int time, in iio_gts_get_scale_linear() argument
949 total_gain = iio_gts_get_total_gain(gts, gain, time); in iio_gts_get_scale_linear()
963 * iio_gts_get_scale - get scale based on integration time and HW-gain
964 * @gts: Gain time scale descriptor
966 * @time: Integration time for which the scale is computed
970 * Compute scale matching the integration time and HW-gain given as parameter.
974 int iio_gts_get_scale(struct iio_gts *gts, int gain, int time, int *scale_int, in iio_gts_get_scale() argument
980 ret = iio_gts_get_scale_linear(gts, gain, time, &lin_scale); in iio_gts_get_scale()
989 * iio_gts_find_new_gain_sel_by_old_gain_time - compensate for time change
990 * @gts: Gain time scale descriptor
992 * @old_time_sel: Selector corresponding previously set time
993 * @new_time_sel: Selector corresponding new time to be set
997 * time (for a light sensor) by also updating the (HW)gain. This helper computes
998 * new gain value to maintain the scale with new integration time.
1046 * iio_gts_find_new_gain_by_old_gain_time - compensate for time change
1047 * @gts: Gain time scale descriptor
1049 * @old_time: Selector corresponding previously set time
1050 * @new_time: Selector corresponding new time to be set
1054 * time (for a light sensor) by also updating the (HW)gain. This helper computes
1055 * new gain value to maintain the scale with new integration time.
1099 MODULE_DESCRIPTION("IIO light sensor gain-time-scale helpers");