STRUCT PM8XXX_XOADC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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's graph[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