STRUCT TSENS_PRIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to struct 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 of regmap_fields used to store the value of the field. it's an array, and it's literally MAX_REGFIELDS long, 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