ti_bandgap_get_trend(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ti_bandgap_get_trend(9) ✨

okay so this is a page straight out of the Kernel API Manual, and it's about ti_bandgap_get_trend β€” the little function that tells you which way a sensor's temperature is going. bestie, we're reading vibes. temperature vibes. let's go πŸ’…


🌑️ NAME

ti_bandgap_get_trend β€” to fetch the temperature trend of a sensor πŸ¦‹

like, is it getting hotter? colder? the sensor knows, and this function asks.


πŸŽ€ SYNOPSIS

int ti_bandgap_get_trend (struct ti_bandgap *bgp , int id , int *trend
);

yep, that's the whole signature, no cap. three things go in, one int comes out. πŸ’–


🌸 ARGUMENTS

  • bgp β€” pointer to struct ti_bandgap. this is the bandgap you're interrogating, bestie. be nice to it.
  • id β€” id of the individual sensor. yes, individual β€” each sensor in there has its own little number and you gotta say which one you mean.
  • trend β€” pointer to trend. this is where the answer lands. you hand it a pointer, it fills in the tea. β˜•

πŸ”₯ DESCRIPTION

so here's the situation: you call this function when you need to fetch the temperature trend of a particular sensor. not just any sensor. the one you asked about. main character energy only. πŸ‘‘

what it actually does is compute the difference in temperature w.r.t time β€” i.e. the direction things are moving. is it heating up? cooling down? that's the trend, and that's the whole point.

here's the catch though, and it's a real one:

  • for the bandgaps that have a built in history buffer, the temperatures are read straight out of that buffer β€” easy, iconic, no notes ✨
  • for the ones without the buffer, you get -ENOTSUPP back. that's not a bug, that's just how it is. if you don't have the buffer, you don't get the trend. periodt.
🫢 lowkey important: don't go assuming every bandgap supports this. check for that -ENOTSUPP and handle it, or you're gonna have a bad time.

πŸ’€ RETURN

0 if no error β€” slay. otherwise it returns the corresponding error, and you should probably go read it instead of pretending it didn't happen 😭

and if there's no error? the trend value is passed on to the trend parameter. that's the pointer from earlier doing its job. it ate. πŸ“


🌈 SEE ALSO

the kernel file in question lives at ./drivers/thermal/ti-soc-thermal/ti-bandgap.c β€” go read the source if you want the full lore, iykyk πŸ“–

and here's the whole extended friend group, all of them, in order:


and that's the page, bestie πŸ§šπŸ’œ this one came from ./drivers/thermal/ti-soc-thermal, dated October 2026 β€” so go forth, read your trends, respect the -ENOTSUPP, and stay hydrated πŸ’–βœ¨

πŸ“¦ where this page comes from