STRUCT ADIS(9)
π 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β theopsstruct 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 amsg. 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 torequest_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:
struct adis_data(9)struct adis_ops(9)adis_reset(9)__adis_write_reg_8(9)__adis_write_reg_16(9)__adis_write_reg_32(9)__adis_read_reg_16(9)__adis_read_reg_32(9)adis_write_reg(9)adis_read_reg(9)adis_write_reg_8(9)adis_write_reg_16(9)adis_write_reg_32(9)adis_read_reg_16(9)adis_read_reg_32(9)adis_update_bits_base(9)adis_update_bits(9)
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
- 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