STRUCT TSADC_TABLE(9)
π struct tsadc_table(9) π
okay so bestie, you know how a temperature sensor just spits out raw ADC numbers and absolutely refuses to tell you how hot anything actually is? yeah. this struct is the glow-up translator for that. it's the code to temperature conversion table and it's lowkey the main character of rockchip_thermal.c iykyk π‘οΈβ¨
(the manual name is struct tsadc_table(9), from the Kernel API Manual, in case you were wondering π«Ά)
β¨ SYNOPSIS β¨
here's the whole vibe, no cap:
struct tsadc_table {
u32 code;
int temp;
};
that's it. two fields. iconic minimalism π
π Members π
codeβ the value of the adc channel. like, the raw number the sensor hands you πΈtempβ the temperature. the actual temperature bestie, the thing you actually wanted π₯
π¦ Note π¦
okay so here's the important bit, listen up π
the code to temperature mapping of the temperature sensor is a piece wise linear curve. that means any temperature, or any code, that's faling between two given temperatures/codes can be linearly interpolated β you just draw a straight lil line between the two known points and vibe check where your value lands πβ¨
β οΈ and this part is fr fr important: the code to temperature mapping should be updated based on manufacturer results. don't just make numbers up, bestie π the manufacturer hands you the real table, you put it in. that's the whole deal.
π SEE ALSO π
go read the kernel file ./drivers/thermal/rockchip_thermal.c β that's where all of this lives π«Ά and while you're in there, check out these absolute legends:
struct chip_tsadc_table(9)struct rockchip_tsadc_chip(9)struct rockchip_thermal_sensor(9)struct rockchip_thermal_data(9)rk_tsadcv2_initialize(9)rk_tsadcv3_initialize(9)rk_tsadcv3_control(9)rockchip_get_efuse_value(9)rockchip_thermal_reset_controller(9)
and that's the whole page bestie, you ate it up π this lil beauty comes from ./drivers/thermal, dated October 2026, and it's filed under struct tsadc_table(9) β mwah, go interpolate something π§ββοΈπ
π¦ 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