STRUCT TSENS_PRIV(9)
π struct tsens_priv(9)
okay so this is a page straight out of the Kernel API Manual, and bestie, we are about to get so cozy with it. β¨
π NAME
struct tsens_priv β the private data for each instance of the tsens IP π«Ά
like, every single tsens instance gets its own lil' bundle of secrets and we're holding all of them right here. no cap.
πΈ SYNOPSIS
struct tsens_priv {
struct device *dev;
u32 num_sensors;
struct regmap *tm_map;
struct regmap *srot_map;
u32 tm_offset;
spinlock_t ul_lock;
struct regmap_field *rf[MAX_REGFIELDS];
struct tsens_context ctx;
struct tsens_features *feat;
const struct reg_field *fields;
const struct tsens_ops *ops;
struct dentry *debug_root;
struct dentry *debug;
int uplow_irq;
int crit_irq;
int combined_irq;
struct tsens_sensor sensor[];
};
look at her. the struct of all time. π
π¦ Members
okay so member by member, here we go, don't scroll past, i'm literally explaining each one:
devβ pointer tostruct device. that's the device she belongs to, her home base fr.num_sensorsβ number of sensors enabled on this device. counting them like a little inventory πtm_mapβ pointer to the TM register address space.srot_mapβ pointer to the SROT register address space.tm_offsetβ this one deals with old device trees that don't address the TM and SROT address space separately. legacy support, iconic behavior honestly.ul_lockβ the lock while processing upper/lower threshold interrupts. she's keeping things from stepping on each other πrfβ array ofregmap_fields used to store the value of the field. it's an array, and it's literallyMAX_REGFIELDSlong, and yes that's a macro you have to just trust.ctxβ the registers to be saved and restored during suspend/resume. nap time preservation π§featβ features of the IP. her personality traits, basically.fieldsβ bitfield locations. where things live inside the bits, iykyk.opsβ pointer to the list of callbacks supported by this device. all her little functions she can do π₯debug_rootβ pointer to the debugfs dentry for all tsens.debugβ pointer to the debugfs dentry for the tsens controller. yes these two are different, do not mix them up, i saw that.uplow_irqβ the IRQ number for uplow (upper/lower) threshold interrupts.crit_irqβ the IRQ number for critical threshold interrupts. critical, as in, girl, this one matters.combined_irqβ the IRQ number for combined threshold interrupts. the two-for-one situation.sensorβ list of sensors attached to this device. the actual cast of characters π
ngl the sensor[] at the end is a flexible array member, which is exactly the kind of main character energy this struct is giving. β¨
π SEE ALSO
sibling pages, the whole squad, go read them:
- the Kernel file
./drivers/thermal/qcom/tsens.h struct tsens_sensor(9)struct tsens_ops(9)struct tsens_features(9)struct tsens_plat_data(9)struct tsens_context(9)struct tsens_single_value(9)struct tsens_legacy_calibration_format(9)
π and that's the page!! sourced from ./drivers/thermal/qcom, dated October 2026, living in the Kernel API Manual β go off, bestie, you now know the whole struct. periodt. ππ¦π
π¦ 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