STRUCT PM8XXX_XOADC(9)
π struct pm8xxx_xoadc(9) β like, the state container for the XOADC, bestie
okay so this is a page from the Kernel API Manual, and it's literally all about struct pm8xxx_xoadc β the state container for the XOADC. no cap, that's the whole vibe. she holds the state, she holds the channels, she holds the lock, she's the main character of qcom-pm8xxx-xoadc.c. π
β¨ NAME β¨
struct pm8xxx_xoadc β the state container for the XOADC π«Ά
πΈ SYNOPSIS πΈ
struct pm8xxx_xoadc {
struct device *dev;
struct regmap *map;
const struct xoadc_variant *variant;
struct regulator *vref;
unsigned int nchans;
struct pm8xxx_chan_info *chans;
struct iio_chan_spec *iio_chans;
struct vadc_linear_graph graph[2];
struct completion complete;
struct mutex lock;
};
like. look at her. ten fields. absolutely iconic structure layout, no notes. π
π Members π
okay so this is the part where we meet the whole cast, one field at a time. vibe check each one, they all pass. π
devβ pointer to device. that's it, that's the field. she points at the device, she's the link back home πmapβ the regmap to access registers. this is how we actually talk to the hardware, iykyk π₯variantβ the XOADC variant characteristics. which flavour of XOADC are we dealing with? she knows. β¨vrefβ the reference voltage regulator characteristics of the channels, and sensible default settings. yes, that's the description, and yes, both of those things are in there. thank you for your service, regulators π«Άnchansβ number of channels, configured by the device tree. so like, the device tree decides how many, not us. we just hold the count πchansβ the channel information per-channel, configured by the device tree. same situation, but now it's the actual per-channel deets. device tree said "here's your channels", and we were like "slay, storing those" πiio_chansβ IIO channel specifiers. the IIO-facing version of the channel situation, looking gorgeous as always βgraphβ linear calibration parameters for absolute and ratiometric measurements. note that it'sgraph[2]β two of them, one for absolute, one for ratiometric, and she's calibrated πβ¨completeβ the completion to indicate end of conversion. literally just sitting there waiting to tell everyone "conversion's done, you may proceed" πlockβ the lock to restrict access to the hardware to one client at the time. one client. at the time. not two, not "well technically three if you're quick", just one. mutual exclusion is a boundary and we respect it, bestie ππ
π¦ SEE ALSO π¦
- the Kernel file
./drivers/iio/adc/qcom-pm8xxx-xoadc.cβ go read the source, she's right there struct xoadc_channel(9)struct xoadc_variant(9)struct pm8xxx_chan_info(9)
like, read all of them honestly. they're all in the same friend group π§
lowkey a reminder: if you're gonna poke at the hardware, it's lock's whole job to keep that to one client at a time. don't be the one who makes it awkward. π
alright bestie that's the page!! shipped from ./drivers/iio/adc, dated October 2026, and it's still struct pm8xxx_xoadc(9) in the Kernel API Manual π go forth and calibrate responsibly πβ¨
π¦ 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