STRUCT ROCKCHIP_TSADC_CHIP(9)
π struct rockchip_tsadc_chip(9)
okay so bestie, welcome to the Kernel API Manual π β this page is literally all about struct rockchip_tsadc_chip, and its whole entire job is to hold the private data of tsadc chip. that's it, that's the thesis. no cap, it's the little backpack the thermal sensor driver carries around everywhere πβ¨
π¦ SYNOPSIS π¦
here's the whole glow-up, laid out exactly as the kernel gods wrote it:
struct rockchip_tsadc_chip {
int chn_offset;
int chn_num;
int trim_slope;
int tshut_temp;
enum tshut_mode tshut_mode;
enum tshut_polarity tshut_polarity;
bool grf_required;
void (*initialize)(struct regmap *grf, void __iomem *reg, enum tshut_polarity p);
void (*irq_ack)(void __iomem *reg);
void (*control)(void __iomem *reg, bool on);
int (*get_temp)(const struct chip_tsadc_table *table, int chn, void __iomem *reg, int *temp);
int (*set_alarm_temp)(const struct chip_tsadc_table *table, int chn, void __iomem *reg, int temp);
int (*set_tshut_temp)(const struct chip_tsadc_table *table, int chn, void __iomem *reg, int temp);
void (*set_tshut_mode)(int chn, void __iomem *reg, enum tshut_mode m);
int (*get_trim_code)(const struct chip_tsadc_table *table, int code, int trim_base, int trim_base_frac);
struct chip_tsadc_table table;
};
it's giving "function pointer buffet" and honestly? we ate π
π Members π
okay now let's meet the cast, one member at a time β every single one, no skipping π
chn_offsetβ the channel offset of the first channel. where the counting starts, basically the group chat's first member πΈchn_numβ the channel number of tsadc chip. how many channels this chip is serving, iconic headcount energy πtrim_slopeβ used to convert the trim code to a temperature in millicelsius. it's the math-y one, doing the celsius glow-up β¨tshut_tempβ the hardware-controlled shutdown temperature value, with no trim. raw, unfiltered, no edits π«Άtshut_modeβ the hardware-controlled shutdown mode (0:CRU1:GPIO). pick your fighter πtshut_polarityβ the hardware-controlled active polarity (0:LOW1:HIGH). low key or high key, literally π₯grf_requiredβtrue, if a GRF is required for proper functionality. so if it'strue, don't go forgetting the GRF, bestie πinitializeβ SoC special initialize tsadc controller method. the main character entrance for each SoC πirq_ackβ clear the interrupt. yes queen, acknowledge it and move on πcontrolβ enable/disable method for the tsadc controller. the on/off switch of destiny βget_tempβ get the raw temperature, unadjusted by trim. naked temperature, not yet dressed for the occasion πset_alarm_tempβ set the high temperature interrupt. the "girl wake UP" alarm π¨set_tshut_tempβ set the hardware-controlled shutdown temperature. the actual "we're shutting this down" temperature π€set_tshut_modeβ set the hardware-controlled shutdown mode.CRUorGPIO, choose wisely π¦get_trim_codeβ convert a hardware temperature code to one adjusted for by trim. the code's little makeover montage πtableβ the chip-specific conversion table. the cheat sheet, the lore document, the vibe check reference π
π SEE ALSO π
go read these next, iykyk π (they all live in the kernel file ./drivers/thermal/rockchip_thermal.c):
struct chip_tsadc_table(9)struct rockchip_thermal_sensor(9)struct rockchip_thermal_data(9)struct tsadc_table(9)rk_tsadcv2_initialize(9)rk_tsadcv3_initialize(9)rk_tsadcv3_control(9)rockchip_get_efuse_value(9)rockchip_thermal_reset_controller(9)
lowkey a reminder that this is the Kernel API Manual page for struct rockchip_tsadc_chip(9) β that's the manual name, that's the title, that's the moment π«
and that's the whole page, bestie, you understood it perfectly, i'm so proud of you fr fr ππ«Ά
sign-off szn: this little masterpiece lives under ./drivers/thermal, dated October 2026, and it's the struct rockchip_tsadc_chip(9) page of the Kernel API Manual. slay, bye π
β¨π
π¦ 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