STRUCT ADC_TM5_CHIP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct adc_tm5_chip(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this is the page for struct adc_tm5_chip, aka the ADC Thermal Monitoring properties. it's giving "one struct to hold all the TM vibes" and honestly? iconic. ✨


🌸 NAME 🌸

struct adc_tm5_chip β€” ADC Thermal Monitoring properties πŸŽ€


✨ SYNOPSIS ✨

here's the whole squad, literally every member, copied exactly so you don't have to squint:

struct adc_tm5_chip {
    struct regmap           *regmap;
    struct device           *dev;
    const struct adc_tm5_data       *data;
    struct adc_tm5_channel  *channels;
    unsigned int            nchannels;
    unsigned int            decimation;
    unsigned int            avg_samples;
    u16 base;
    struct mutex            adc_mutex_lock;
 };

πŸ¦‹ Members πŸ¦‹

okay so let's meet the cast, one by one, no cap:

  • regmap β€” the register map field for the SPMI ADC5 Thermal Monitoring peripheral. it's the map, bestie, it maps. πŸ—ΊοΈ
  • dev β€” the SPMI ADC5 device. your main character device, periodt. πŸ‘‘
  • data β€” software configuration data. yes, the config data, lowkey the brains of the operation. 🧠
  • channels β€” array of ADC TM channel data. all the channels, living in an array, thriving. 🌈
  • nchannels β€” amount of channels defined/allocated. it's a headcount fr fr. πŸ”’
  • decimation β€” sampling rate supported for the channel. Applies to all channels, used only on Gen1 ADC_TM. so like, every channel gets it, but Gen1 only β€” iykyk. πŸ’…
  • avg_samples β€” ability to provide single result from the ADC that is an average of multiple measurements. Applies to all channels, used only on Gen1 ADC_TM. one result, many measurements, average behavior, we love a team player. 🫢
  • base β€” base address of TM registers. the starting point, the origin story. ⭐
  • adc_mutex_lock β€” ADC_TM mutex lock, used only on Gen2 ADC_TM. It is used to ensure only one ADC channel configuration is done at a time using the shared set of configuration registers.
🚨 okay so this is the important one: that mutex is Gen2 only, and it exists so only one ADC channel config happens at a time, because the configuration registers are shared. do not skip the lock, bestie, that's how you get chaos. 😭

πŸŽ€ SEE ALSO πŸŽ€

go read these next, bestie, they're literally in the kernel file ./drivers/thermal/qcom/qcom-spmi-adc-tm5.c:

  • struct adc_tm5_channel(9) β€” the channel struct, the sequel we all needed. πŸ“

that's the whole page!! shoutout to ./drivers/thermal/qcom for bringing us this masterpiece, dated October 2026 β€” mwah, ty for your service, slay πŸ’œπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from