iio_gts_get_total_gain(9)
π iio_gts_get_total_gain β kernel API manual, but make it cute
okay so bestie, you're looking at iio_gts_get_total_gain(9) β a kernel function from the man page fam, and honestly? she's a little math gremlin and I'm obsessed. Let me walk you through it π«Ά
β¨ NAME β¨
iio_gts_get_total_gain β Fetch total gain for given HW-gain and time
like literally, that's the whole plot: you hand her a hardware gain and an integration time, she goes and finds the total gain for that combo. queen behavior π
π¦ SYNOPSIS π¦
int iio_gts_get_total_gain (struct iio_gts *gts , int gain , int time );
yep that's it, that's the whole signature. no cap, four things: a return type, a descriptor, and two ints. she's lowkey minimal π
πΈ ARGUMENTS πΈ
gtsβ the Gain time scale descriptor π this is the context object, the main character of the whole operation, she holds all the info you need.gainβ the HW-gain for which the total gain is searched for π like, the hardware gain value you're feeding in so she can go hunt down the matching total gain.timeβ the Integration time for which the total gain is searched for β±οΈ the second half of the search key, the time value in the same little lookup. gain + time = the vibe check, and she finds the total gain that passes it β¨
π RETURN π
- total gain on success π you got your number, slay
-EINVALon error π something was invalid, bestie, and it did not work out β handle it fr fr
ngl, always check your return value. don't just assume she returned a gain and go about your day, because -EINVAL will absolutely humble you π
π§ SEE ALSO π§
okay this is the part where I introduce you to the entire friend group. it's a big friend group. it's giving group chat with 25 people and honestly they're all iconic π
the kernel file this lives in is ./drivers/iio/industrialio-gts-helper.c β that's home base π and here are her besties:
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_scale(9)iio_gts_find_new_gain_sel_by_old_gain_time(9)iio_gts_find_new_gain_by_old_gain_time(9)iio_gts_find_new_gain_by_gain_time_min(9)
like I said β huge friend group, all of them relevant, none of them skipped π go read them, iykyk π
π the sign-off π
this one came out of the ./drivers/iio corner of the kernel, dated October 2026, and it's filed under the Kernel API Manual. go off, industrial I/O gain-time-scale helper code, you absolute legend πβπ
periodt. now go call iio_gts_get_total_gain responsibly π¦β¨
π¦ 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