iio_gts_find...ld_gain_time(9)
π iio_gts_find...ld_gain_time(9) β the manual π
okay bestie, this is the kernel API manual page for iio_gts_find...ld_gain_time(9), and it's literally about compensating for time change. β¨ No cap, the function name is giving "long-distance relationship," but the actual job is cute and specific. We're gonna get through it together. π«Ά
πΈ NAME πΈ
iio_gts_find_new_gain_sel_by_old_gain_time β compensate for time change.
β¨ SYNOPSIS β¨
int iio_gts_find_new_gain_sel_by_old_gain_time (struct iio_gts *gts ,
int old_gain , int old_time_sel , int new_time_sel , int *new_gain );
π ARGUMENTS π
gtsβ Gain time scale descriptor. That's the descriptor, bestie.old_gainβ Previously set gain.old_time_selβ Selector corresponding previously set time.new_time_selβ Selector corresponding new time to be set.new_gainβ Pointer to value where new gain is to be written. It's literally where the new gain gets written. π
π DESCRIPTION π
We may want to mitigate the scale change caused by setting a new integration time (for a light sensor) by also updating the (HW)gain. This helper computes new gain value to maintain the scale with new integration time. Periodt. π
It's giving "keep the scale cute while the integration time changes," and honestly? Obsessed. β¨
π₯ RETURN π₯
0 if an exactly matching supported new gain was found.
When a non-zero value is returned, the new_gain will be set to a negative or positive value.
- Negative value means that no gain could be computed. π
- Positive value will be the "best possible new gain there could be". π
There can be two reasons why finding the "best possible" new gain is not deemed successful:
- This new value cannot be supported by the hardware.
- The new gain required to maintain the scale would not be an integer.
In this case, the "best possible" new gain will be a floored optimal gain, which may or may not be supported by the hardware. So yeah, it's best-effort energy, not a guarantee. π
π¦ SEE ALSO π¦
Kernel file ./drivers/iio/industrialio-gts-helper.c and this whole friend group:
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_by_old_gain_time(9)iio_gts_find_new_gain_by_gain_time_min(9)
π source/version vibe check: this page comes from ./drivers/iio, dated October 2026, and it's literally the iio_gts_find...ld_gain_time(9) manual. Bye bestie! ππ
π¦ 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