STRUCT AD7949_ADC_CHIP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ad7949_adc_chip(9) β€” okay bestie, let's talk

So this is from the Kernel API Manual, section 9, and it's literally the whole struct for the AD ADC chip. Buckle up, we're doing kernel struct lore πŸŽ€


✨ NAME ✨

struct ad7949_adc_chip β€” an AD ADC chip, no cap. That's it, that's the vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

struct ad7949_adc_chip {
    struct mutex lock;
    struct regulator *vref;
    struct iio_dev *indio_dev;
    struct spi_device *spi;
    u32 refsel;
    u8 resolution;
    u16 cfg;
    unsigned int current_channel;
    u16 buffer;
    __be16 buf8b;
};

Yes bestie, copy it exactly β€” every field in this exact order, nothing renamed, nothing merged. The compiler does not care about your feelings πŸ’€


πŸ‘‘ Members πŸ‘‘

Okay this is the part where I introduce you to every single field like they're my friends at a party 🫢

  • lock β€” a struct mutex that protects write sequences. It's giving bouncer at the club: nobody writes until this says so. πŸ”₯
  • vref β€” a struct regulator * that's the regulator generating Vref. The voltage reference main character, honestly.
  • indio_dev β€” a struct iio_dev *, aka your reference to the iio structure. It's the plug πŸ’…
  • spi β€” a struct spi_device *, the reference to the spi structure. Another plug, but SPI-flavored this time ✨
  • refsel β€” a u32 holding the reference selection. Which reference? The one you selected, bestie πŸŽ€
  • resolution β€” a u8, the resolution of the chip. Literally how much detail this thing can see. πŸ‘€
  • cfg β€” a u16 that's a copy of the configuration register. A little souvenir of the config, love that for us.
  • current_channel β€” an unsigned int, the current channel in use. Not the ex-channel, not the future channel. The current one. ⭐
  • buffer β€” a u16, the buffer to send / receive data to / from device. Two-way queen 🌈
  • buf8b β€” a __be16 buffer to exchange data with the device in 8-bit transfers. Different buffer, different transfer size, same icon energy πŸ’œ
ngl the two buffers are lowkey doing different jobs β€” buffer for send/receive data with the device, buf8b specifically for exchanging data in 8-bit transfers. Don't mix them up, bestie πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/iio/adc/ad7949.c β€” go read it, iykyk πŸ“–

That's the whole page, periodt. 🌸

And a cute little sign-off for you: this gem lives under ./drivers/iio/adc, it's dated October 2026, and its manual page name is struct ad7949_adc_chip(9) β€” so if you ever need to cite it, you're welcome πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from