ti_bandgap_get_trend(9)
β¨ 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 tostruct 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
-ENOTSUPPback. 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:
ti_bandgap_readl(9)ti_bandgap_writel(9)macro to update bits.(9)ti_bandgap_power(9)ti_errata814_bandgap_read_temp(9)ti_bandgap_read_temp(9)ti_bandgap_talert_irq_handler(9)ti_bandgap_tshut_irq_handler(9)ti_bandgap_adc_to_mcelsius(9)ti_bandgap_validate(9)ti_bandgap_read_counter(9)ti_bandgap_read_counter_delay(9)ti_bandgap_read_update_interval(9)ti_bandgap_write_counter_delay(9)ti_bandgap_write_counter(9)ti_bandgap_write_update_interval(9)ti_bandgap_read_temperature(9)ti_bandgap_set_sensor_data(9)ti_bandgap_get_sensor_data(9)ti_bandgap_force_single_read(9)ti_bandgap_set_continuous_mode(9)ti_bandgap_tshut_init(9)ti_bandgap_talert_init(9)ti_bandgap_build(9)
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
- 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