devm_iio_init_iio_gts(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ devm_iio_init_iio_gts ✨

okay so bestie, this is the function that sets up your gain-time-scale helper for you, in the Kernel API Manual (that's the manual name, slay). it's called devm_iio_init_iio_gts and it's literally here to make your life easier before you go off and do scale stuff. no cap.


🌸 SYNOPSIS 🌸

int devm_iio_init_iio_gts (struct device *dev , int max_scale_int , int
max_scale_nano , const struct iio_gain_sel_pair *gain_tbl , int num_gain
, const struct iio_itime_sel_mul *tim_tbl , int num_times , struct
iio_gts *gts );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” pointer to the device whose lifetime the gts resources are bound to 🫢 like they're literally tied to this device's whole existence
  • max_scale_int β€” the integer part of the maximum scale value, the big whole number vibe
  • max_scale_nano β€” the fraction part of the maximum scale value, the tiny little nano detail ✨
  • gain_tbl β€” table describing supported gains, it's giving lookup table realness
  • num_gain β€” number of gains in the gain table, like how many entries we're working with
  • tim_tbl β€” table describing supported integration times. πŸ’… important: provide the integration time table sorted so that the preferred integration time is in the first array index. the search functions (like iio_gts_find_time_and_gain_sel_for_scale) start searching from the first provided time. so yeah, put your fave first, periodt.
  • num_times β€” number of times in the time table, counting them all bestie
  • gts β€” pointer to the helper struct, the main character itself πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this initializes the gain-time-scale helper for use. literally just set it up and let it work. note some things that are non-negotiable:

gains, times, selectors, and multipliers must be positive. negative values are reserved for error checking, so don't come in here with negatives, that's not the vibe πŸ™ˆ.

also, the total gain (maximum gain * maximum time multiplier) must not overflow int. no overflow, no accidental chaos, handle it.

the allocated resources will be released upon device detach β€” so when the device dips, the resources go too. automatic cleanup, iconic 🌈.


⭐ RETURN ⭐

0 on success. that's it, plain and simple, 0 and you're golden πŸ’–


🌟 SEE ALSO 🌟

bestie the whole friend group:


./drivers/iio Β· October 2026 Β· devm_iio_init_iio_gts(9) β€” mwah, that's the page bestie, go slay your IIO init πŸ’…πŸ«Άβœ¨

πŸ“¦ where this page comes from