iio_gts_get_gain(9)
π iio_gts_get_gain(9) β it's from the Kernel API Manual bestie
okay so picture this: we're deep in the kernel, and there's this little helper called iio_gts_get_gain β¨ It does exactly one thing and it does it slayfully β convert scale to total gain. That's it. That's the whole vibe.
β¨ SYNOPSIS β¨
int iio_gts_get_gain (const u64 max , const u64 scale );
π ARGUMENTS π
maxβ the maximum linearized scale, bestie π As an example (and this example eats, fr): when scale is created in magnitude ofNANOsand max scale is64.1β the linearized scale is64 100 000 000. Yeah. That many zeros. It's giving "trust the process".scaleβ the linearized scale you actually wanna compute the gain for π¦
πΈ DESCRIPTION πΈ
so this is an internal helper for converting scale to total gain π«Ά That's the tea. It's not out here doing main character energy on its own β it's a support system, and honestly? Iconic.
π₯ RETURN π₯
It hands you back the (floored) gain corresponding to the scale β¨ And if the scale is invalid? Nope. Not today. You get -EINVAL π (the floor stays flooring, no cap).
π SEE ALSO π
First up, the kernel file it lives in, iykyk:
Kernel file ./drivers/iio/industrialio-gts-helper.c
and then the whole friend group π β literally the entire gts-helper squad, all present and accounted for:
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)iio_gts_find_new_gain_by_gain_time_min(9)
π that's the whole page, bestie β go forth and convert those scales π
okay and for the little sign-off: this page comes from the source directory ./drivers/iio, and it's dated October 2026 πβ Take care of her π
π¦ 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