STRUCT ADIS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct adis(9) πŸ’–

okay so welcome to the struct adis manpage, section 9 of the Kernel API Manual β€” this is the one that defines what a little ADIS device instance actually is on the inside 🫢 it lives in the kernel, it's giving "one struct to hold the whole vibe", and honestly the way it just… holds everything? iconic.


✨ NAME ✨

struct adis β€” the device instance data for an ADIS device. like, the whole little bundle of state. no cap.


🌸 SYNOPSIS 🌸

struct adis {
    struct spi_device       *spi;
    struct iio_trigger      *trig;
    const struct adis_data  *data;
    unsigned int            burst_extra_len;
    const struct adis_ops   *ops;
    struct mutex            state_lock;
    struct spi_message      msg;
    struct spi_transfer     *xfer;
    unsigned int            current_page;
    unsigned long           irq_flag;
    void *buffer;
    u8 tx[10];
    u8 rx[4];
 };

literally just copy it exactly like that, bestie β€” the field order and the types are the whole point πŸ’…


πŸŽ€ Members πŸŽ€

okay so this is the part where we go field by field, and every single one of them matters:

  • spi β€” reference to the SPI device that owns this ADIS IIO device. the main character of the ownership situation fr.
  • trig β€” the IIO trigger object data. πŸ¦‹
  • data β€” the ADIS chip variant specific data. every chip's own personal lore.
  • burst_extra_len β€” the burst extra length. ⚠️ heads up: this one should only be used by devices that can dynamically change their burst mode length. so if yours can't, hands off please πŸ™ˆ
  • ops β€” the ops struct for custom read and write functions. you want your own read/write behaviour? this is where you put it.
  • state_lock β€” the lock the device uses to protect state. mutual exclusion slay πŸ”₯
  • msg β€” the SPI message object. yes, the actual message, not a text πŸ’€
  • xfer β€” the SPI transfer objects that get used for a msg. plural, bestie, it's a pointer.
  • current_page β€” some ADIS devices have registers, and this selects the current page. iykyk πŸ“„
  • irq_flag β€” the IRQ handling flags, as passed to request_irq. keep them exactly as they went in.
  • buffer β€” the data buffer for information read from the device. πŸ“
  • tx β€” DMA safe TX buffer for SPI transfers. DMA safe is not a suggestion, it's a lifestyle ✨
  • rx β€” DMA safe RX buffer for SPI transfers. same energy, other direction 🧚

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/iio/imu/adis.h, plus all of these cuties:


aaaand that's the page 🌈 mwah πŸ’‹ this one ships out of ./include/linux/iio/imu, dated October 2026 β€” go read the other ones too, they're lowkey obsessed with this struct, and honestly? valid. πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from