STRUCT AD7606_STATE(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿฆ‹ struct ad7606_state(9) ๐Ÿฆ‹

okay bestie, welcome to the Kernel API Manual ๐Ÿ’– this is the whole entire page for struct ad7606_state, and it's literally the glow-up your brain needed today. no cap.


โœจ NAME โœจ

struct ad7606_state โ€” the driver-instance-specific data ๐ŸŽ€ like, every single little thing one AD7606 driver instance needs to keep track of about itself. main character energy fr fr.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

struct ad7606_state {
    struct device                   *dev;
    const struct ad7606_chip_info   *chip_info;
    const struct ad7606_bus_ops     *bops;
    struct ad7606_chan_info         chan_info[AD760X_MAX_CHANNELS];
    unsigned int                    oversampling;
    struct pwm_device               *cnvst_pwm;
    void __iomem                    *base_address;
    bool sw_mode_en;
    const unsigned int              *oversampling_avail;
    unsigned int                    num_os_ratios;
    struct iio_backend              *back;
    int (*write_scale)(struct iio_dev *indio_dev, int ch, int val);
    int (*write_os)(struct iio_dev *indio_dev, int val);
    struct mutex                    lock;
    struct gpio_desc                *gpio_convst;
    struct gpio_desc                *gpio_reset;
    struct gpio_desc                *gpio_range;
    struct gpio_desc                *gpio_standby;
    struct gpio_desc                *gpio_frstdata;
    struct gpio_descs               *gpio_os;
    struct iio_trigger              *trig;
    struct completion               completion;
    bool offload_en;
    void *bus_data;
    struct {
      union {
        u16 buf16[16];
        u32 buf32[8];
      };
      aligned_s64 timestamp;
    } data;
    __be16 d16[2];
 };

slay, now let's meet every single member one by one ๐Ÿ‘‘


๐Ÿ’… Members ๐Ÿ’…

  • dev โ€” pointer to the kernel device ๐Ÿซถ that's the device's whole identity, iconic.
  • chip_info โ€” the entry in the table of chips that describes this device ๐ŸŒˆ so it knows which chip it actually is, iykyk.
  • bops โ€” the bus operations (SPI or parallel) ๐ŸšŒ literally how this thing talks to the outside world.
  • chan_info โ€” the scale configuration for channels ๐ŸŽš๏ธ per-channel scale deets, all tucked in here.
  • oversampling โ€” the oversampling selection ๐Ÿ”ฅ which oversampling setting got picked.
  • cnvst_pwm โ€” pointer to the PWM device connected to the cnvst pin ๐ŸŒ€ pwm go brrr.
  • base_address โ€” the address from where to read data in parallel operation ๐Ÿ“ like, the literal spot you read from when you're in parallel mode.
  • sw_mode_en โ€” software mode enabled โœ… true/false vibe check.
  • oversampling_avail โ€” pointer to the array which stores the available oversampling ratios ๐Ÿ’ซ the menu of oversampling options, not the choice itself.
  • num_os_ratios โ€” number of elements stored in oversampling_avail array ๐Ÿ”ข so you know how many options are on that menu.
  • back โ€” pointer to the iio_backend structure, if used ๐Ÿ‘€ only if used, okay bestie, don't come for me.
  • write_scale โ€” pointer to the function which writes the scale โœ๏ธ yes, a function pointer, yes, it's giving old-school cool.
  • write_os โ€” pointer to the function which writes the os ๐Ÿ–Š๏ธ another function pointer, same energy.
  • lock โ€” protect sensor state from concurrent accesses to GPIOs ๐Ÿ”’ mutual exclusion, no fighting over GPIOs in the group chat please.
  • gpio_convst โ€” GPIO descriptor for conversion start signal (CONVST) โšก the "go" signal.
  • gpio_reset โ€” GPIO descriptor for device hard-reset ๐Ÿ”„ hard reset, dramatic but necessary.
  • gpio_range โ€” GPIO descriptor for range selection ๐Ÿ“ picks the range, obvi.
  • gpio_standby โ€” GPIO descriptor for stand-by signal (STBY), controls power-down mode of device ๐Ÿ˜ด it literally decides when the device goes to sleep, relatable.
  • gpio_frstdata โ€” GPIO descriptor for reading from device when data is being read on the first channel ๐ŸŽฏ first-channel-reading situation, very specific, very real.
  • gpio_os โ€” GPIO descriptors to control oversampling on the device ๐ŸŽ›๏ธ plural, it's a whole struct gpio_descs.
  • trig โ€” The IIO trigger associated with the device. ๐ŸŽฌ the trigger, the cue, the moment.
  • completion โ€” completion to indicate end of conversion ๐Ÿ it tells everyone "we're done converting, wrap it up".
  • offload_en โ€” SPI offload enabled ๐Ÿš€ yes/no, offload status.
  • bus_data โ€” bus-specific variables ๐Ÿ“ฆ the bus's own little bag of stuff.
  • data โ€” buffer for reading data from the device ๐Ÿ’พ this is where the readings land, including an aligned_s64 timestamp inside it.
  • {unnamed_union} โ€” anonymous ๐Ÿ”ฎ it's an anonymous union, no name, no problem.
  • d16 โ€” be16 buffer for reading data from the device ๐ŸŒธ big-endian be16, two of them: d16[2].

๐ŸŒŸ SEE ALSO ๐ŸŒŸ

Kernel file ./drivers/iio/adc/ad7606.h with struct ad7606_chip_info(9), struct ad7606_chan_info(9), struct ad7606_bus_ops(9), and struct ad7606_bus_info(9) ๐Ÿ’œ go read those next, bestie, they're all in the same friend group.


that's the whole page, no skips, no cuts ๐Ÿ’– this came from ./drivers/iio/adc, dated October 2026, in the Kernel API Manual โ€” mwah, bye! ๐Ÿงšโœจ

๐Ÿ“ฆ where this page comes from