STRUCT AD5064_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ad5064_state(9) β€” like, the whole driver-instance vibe ✨

okay so bestie, we're in the Kernel API Manual and this page is literally about struct ad5064_state β€” the per-instance data a driver keeps around. it's giving "one struct to hold all your state," and honestly? iconic. πŸŽ€


✨ NAME ✨

struct ad5064_state β€” driver instance specific data 🫢


🌸 SYNOPSIS 🌸

like, here's the whole shape of it, no cap:

struct ad5064_state {
    struct device                   *dev;
    const struct ad5064_chip_info   *chip_info;
    struct regulator_bulk_data      vref_reg[AD5064_MAX_VREFS];
    bool pwr_down[AD5064_MAX_DAC_CHANNELS];
    u8 pwr_down_mode[AD5064_MAX_DAC_CHANNELS];
    unsigned int                    dac_cache[AD5064_MAX_DAC_CHANNELS];
    bool use_internal_vref;
    ad5064_write_func write;
    struct mutex lock;
    union {
      u8 i2c[3];
      __be32 spi;
    } data;
 };

πŸ¦‹ Members πŸ¦‹

  • dev β€” the device for this driver instance πŸ’– like, whose struct is this even? this one.
  • chip_info β€” chip model specific constants, available modes etc ✨ all the model-specific lore lives here.
  • vref_reg β€” vref supply regulators ⚑ the supply side of the situation.
  • pwr_down β€” whether channel is powered down 😴 one per channel, literally just vibes (sleeping or not).
  • pwr_down_mode β€” channel's current power down mode πŸŒ™ okay so how is it powered down? this tells you.
  • dac_cache β€” current DAC raw value (chip does not support readback) πŸ’€ yeah, the chip can't read back, so we keep our own little memory of it. main character caching energy.
  • use_internal_vref β€” set to true if the internal reference voltage should be used. 🧚 like, true means internal ref, periodt.
  • write β€” register write callback πŸ”₯ the function that actually does the writing.
  • lock β€” maintain consistency between cached and dev state πŸ‘‘ keeps the cache and the device from fighting, iykyk.
  • data β€” i2c/spi transfer buffers πŸŽ€ a lil union for the transfer buffers, i2c[3] on one side, spi on the other.

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/iio/dac/ad5064.c
  • enum ad5064_regmap_type(9)
  • struct ad5064_chip_info(9)

okay that's the whole page, go read the source bestie πŸ“

shoutout to ./drivers/iio/dac, October 2026, and the struct ad5064_state(9) page itself β€” that's the source, the version, and the date, all wrapped up in a cute little bow πŸ’œ 🧚 ✨
πŸ“¦ where this page comes from