STRUCT AD5064_STATE(9)
π
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,truemeans 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,spion 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 thestruct 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
- 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