STRUCT ADC_TM5_CHIP(9)
π 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
- 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