STRUCT IIO_DEV(9)
β¨ struct iio_dev(9) β¨
okay so bestie, welcome to the manual page for struct iio_dev β the industrial I/O device. this is the man page struct iio_dev(9) from the Kernel API Manual, and we're gonna make it make sense together. periodt π
π¦ SYNOPSIS π¦
struct iio_dev {
int modes;
struct device dev;
struct iio_buffer *buffer;
int scan_bytes;
unsigned int scan_timestamp_offset;
const unsigned long *available_scan_masks;
unsigned int masklength;
const unsigned long *active_scan_mask;
bool scan_timestamp;
struct iio_trigger *trig;
struct iio_poll_func *pollfunc;
struct iio_poll_func *pollfunc_event;
struct iio_chan_spec const *channels;
int num_channels;
const char *name;
const char *label;
const struct iio_info *info;
const struct iio_buffer_setup_ops *setup_ops;
void *priv;
};
πΈ Members πΈ
no cap, here's the breakdown of every single member. i got you π«Ά
modesβ [DRIVER] a bitmask listing all the operating modes your IIO device supports. this list should be initialized before you register the IIO device. it can also get filled up by the IIO core as a result of enabling particular features in the driver (peepiio_triggered_event_setupfor that one). slay π₯devβ [DRIVER] the device structure. should be assigned a parent and owner. iconic behavior tbh πbufferβ [DRIVER] any buffer that's present. it's giving "whatever buffer you got" πscan_bytesβ [INTERN] num bytes captured to be fed to buffer demux. literally the byte count for the demux feed πscan_timestamp_offsetβ [INTERN] cache of the offset (in bytes) for the timestamp in the scan buffer. lowkey just a lil cached offset moment β¨available_scan_masksβ [DRIVER] optional array of allowed bitmasks. sort the array in order of preference, the most preferred masks first. main character ordering energy fr fr πmasklengthβ [INTERN] the length of the mask established fromchannels. the way this ties back to channels... iykyk πactive_scan_maskβ [INTERN] union of all scan masks requested by buffers. union slay πscan_timestampβ [INTERN] set if any buffers have requested timestamp. it's a bool, it's giving yes/no, iconic πtrigβ [INTERN] current device trigger (buffer modes). the trigger bestie π―pollfuncβ [DRIVER] function run on trigger being received. run bestie run πββοΈpollfunc_eventβ [DRIVER] function run on events trigger being received. events edition, we love to see it πͺchannelsβ [DRIVER] channel specification structure table. the channel table, obsessed ποΈnum_channelsβ [DRIVER] number of channels specified inchannels. literally just the count, periodt π’nameβ [DRIVER] name of the device. the name!! π·οΈlabelβ [DRIVER] unique name to identify which device this is. unique label so you know who's who in the group chat π¬infoβ [DRIVER] callbacks and constant info from driver. the callback lore πsetup_opsβ [DRIVER] callbacks to call before and after buffer enable/disable. before AND after, she does both πprivβ [DRIVER] reference to driver's private information. MUST be accessed ONLY via theiio_privhelper. okay this is serious bestie β MUST and ONLY, no negotiating, do not come for her π ββοΈ
π real talk:privis MUST be accessed ONLY viaiio_priv. don't try her. the caps lock is there for a reason.
π SEE ALSO π
bestie, go down the rabbit hole β kernel file ./include/linux/iio/iio.h plus all of these:
struct iio_chan_spec_ext_info(9)struct iio_enum(9)IIO_ENUM(9)IIO_ENUM_AVAILABLE(9)struct iio_mount_matrix(9)IIO_MOUNT_MATRIX(9)struct iio_event_spec(9)IIO_SCAN_FORMAT_SIGNED_INT(9)IIO_SCAN_FORMAT_UNSIGNED_INT(9)IIO_SCAN_FORMAT_FLOAT(9)struct iio_scan_type(9)struct iio_chan_spec(9)iio_channel_has_info(9)iio_channel_has_available(9)struct iio_info(9)struct iio_buffer_setup_ops(9)iio_device_register(9)devm_iio_device_register(9)iio_device_claim_direct(9)iio_device_release_direct(9)iio_device_try_claim_buffer_mode(9)iio_device_release_buffer_mode(9)IIO_DEV_ACQUIRE_DIRECT_MODE(9)IIO_DEV_ACQUIRE_FAILED(9)IIO_DEV_GUARD_CURRENT_MODE(9)iio_device_put(9)dev_to_iio_dev(9)iio_device_get(9)iio_device_set_parent(9)iio_device_set_drvdata(9)iio_device_get_drvdata(9)IIO_DECLARE_BUFFER_WITH_TS(9)IIO_DECLARE_DMA_BUFFER_WITH_TS(9)IIO_DECLARE_QUATERNION(9)iio_get_debugfs_dentry(9)iio_device_suspend_triggering(9)iio_device_resume_triggering(9)iio_get_current_scan_type(9)iio_get_masklength(9)iio_for_each_active_channel(9)IIO_DEGREE_TO_RAD(9)IIO_RAD_TO_DEGREE(9)IIO_G_TO_M_S_2(9)IIO_M_S_2_TO_G(9)
π and that's the whole struct bestie. every field, every flag, every vibe. you're gonna do amazing. mwah π
sending you good vibes from the kernel source, ./include/linux/iio πΈ β October 2026, struct iio_dev(9). stay iconic, stay privileged (the access kind, not the other kind) ππ
π¦ 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