iio_gts_find...ain_time_min(9)
π iio_gts_find_new_gain_by_gain_time_min(9) π
okok so real talk β this is a page from the Kernel API Manual, and it's literally the whole iio_gts_find...ain_time_min(9) situation. bestie, grab a strawberry drink π, we're getting into gain/time scale brainrot and it's actually kind of iconic.
β¨ NAME β¨
iio_gts_find_new_gain_by_gain_time_min β compensate for time change. that's it, that's the vibe π¦
πΈ SYNOPSIS πΈ
int iio_gts_find_new_gain_by_gain_time_min (struct iio_gts *gts , int
old_gain , int old_time , int new_time , int *new_gain , bool *in_range
);
bestie look at that signature it's giving six whole parameters and not one of them is optional π
π ARGUMENTS π
gtsβ Gain time scale descriptor. this is the main character, the whole context lives in here πold_gainβ Previously set gain. yes, the gain that was already chilling there before.old_timeβ Selector corresponding previously set time. which time slot we were on before, lowkey.new_timeβ Selector corresponding new time to be set. the new time slot we're moving to, slay.new_gainβ Pointer to value where new gain is to be written. it's a pointer, so we're writing through it, no cap πin_rangeβ Indicate if thenew_gainwas in the range of supported gains. it tells you whether the result actually stayed inside the supported-gain zone or not. important!!
π DESCRIPTION π
so this function is a wrapper around iio_gts_find_new_gain_by_old_gain_time. like, it's the cuter, more helpful outer layer π«Ά
what it does: it tries to set an optimal value if no exact match was found, and it defaults to the minimum gain to avoid saturations if that optimal value is not in the range of supported gains. so basically it never leaves you hanging β worst case it plays it safe with min gain instead of letting things saturate. genuinely obsessed with the safety net ngl β¨
the "avoid saturations" part is not decorative, bestie β that's the whole reason it falls back to minimum gain, so don't sleep on it π
β RETURN β
0 on success, and a negative value if no gain was found. so like... zero is the slay outcome, negative is the "it's not giving" outcome π
π¦ SEE ALSO π¦
all the siblings and cousins live in the kernel file ./drivers/iio/industrialio-gts-helper.c, and here's the full friend group, no one gets left out:
iio_gts_get_gain(9)gain_get_scale_fraction(9)iio_gts_total_gain_to_scale(9)iio_gts_purge_avail_scale_table(9)iio_gts_build_avail_scale_table(9)iio_gts_build_avail_time_table(9)iio_gts_purge_avail_time_table(9)iio_gts_build_avail_tables(9)iio_gts_purge_avail_tables(9)devm_iio_gts_build_avail_tables(9)devm_iio_init_iio_gts(9)iio_gts_all_avail_scales(9)iio_gts_avail_scales_for_time(9)iio_gts_avail_times(9)iio_gts_find_sel_by_gain(9)iio_gts_find_gain_by_sel(9)iio_gts_get_min_gain(9)iio_find_closest_gain_low(9)iio_gts_find_gain_for_scale_using_time(9)iio_gts_find_gain_sel_for_scale_using_time(9)iio_gts_find_gain_time_sel_for_scale(9)iio_gts_get_total_gain(9)iio_gts_get_scale(9)iio_gts_find_new_gain_sel_by_old_gain_time(9)iio_gts_find_new_gain_by_old_gain_time(9)
and that's the whole page, bestie!! π§ this one came from ./drivers/iio and it's dated October 2026 β write that in your notes, periodt π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms