STRUCT VADC_PRIV(9)
π struct vadc_priv(9) β the VADC private structure, explained by your favorite kernel bestie
okay so you opened the struct vadc_priv(9) page in the Kernel API Manual and you're like "what is all this" β don't worry, we're getting through it together π«Ά. This is the private struct for the VADC driver, i.e. the little home where all the driver's own state lives. Nobody outside gets to peek in. It's giving private, it's giving exclusive, it's giving main character energy π
β¨ SYNOPSIS β¨
here's the whole thing, no cap, exactly as it is:
struct vadc_priv {
struct regmap *regmap;
struct device *dev;
u16 base;
unsigned int nchannels;
struct vadc_channel_prop *chan_props;
struct iio_chan_spec *iio_chans;
bool are_ref_measured;
bool poll_eoc;
struct completion complete;
struct vadc_linear_graph graph[2];
struct mutex lock;
};
like, look at her. eleven members, all baddies π
π Members π
regmapβ pointer tostruct regmap. yes bestie, the regmap, the one that handles all the register reads and writes for you πdevβ pointer tostruct device. the device this whole situation belongs to πΈbaseβ the base address for the ADC peripheral. where it lives in register-land πnchannelsβ number of VADC channels. count 'em πchan_propsβ array of VADC channel properties. one entry per channel, per channel πiio_chansβ array of IIO channels specification. this is the IIO-facing version of the channel lineup β¨are_ref_measuredβ are reference points measured. literally just a yes/no on whether the reference points got measured π§poll_eocβ use polling instead of interrupt. some setups poll, some get interrupted. both valid, both iconic π¦completeβ VADC result notification after interrupt is received. it's the "hey your result is ready" completion πgraphβ store parameters for calibration. and note it'sgraph[2]β two of them, so calibration can keep both sets of parameters, periodt πlockβ ADC lock for access to the peripheral. the mutex that keeps everyone from grabbing the peripheral at the same time, thank u π
lowkey the lock is the MVP here β no lock, no peace, no cap π
π SEE ALSO π
- the Kernel file
./drivers/iio/adc/qcom-spmi-vadc.cβ go read the source, iykyk π struct vadc_channel_prop(9)β the channel properties struct, aka wherechan_propspoints π₯
and that's the whole vibe check bestie, you ate π
β¨ this page came from ./drivers/iio/adc and it's dated October 2026 β so like, future energy fr fr πβ mwah, go read some kernel code π«Άπ
π¦ 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