iio_triggere...er_setup_ext(9)
π NAME π
iio_triggered_buffer_setup_ext β the one that sets up your triggered buffer and the pollfunc, together, bestie β¨
(also yes, the page title is iio_triggere...er_setup_ext(9) β the kernel API manual really said "imma abbreviate" π, it's the same function, we move)
πΈ SYNOPSIS πΈ
int iio_triggered_buffer_setup_ext (struct iio_dev *indio_dev ,
irqreturn_t (*h)(int irq, void *p) , irqreturn_t (*thread)(int irq, void
*p) , enum iio_buffer_direction direction , const struct
iio_buffer_setup_ops *setup_ops , const struct iio_dev_attr
**buffer_attrs );
okay so that's a lot of args, i know, but it's literally all needed π«Ά every single one is doing its job, no dead weight.
π ARGUMENTS π
indio_devβ the IIO device structure π« your whole device situation lives here.hβ the function that gets used as the pollfunc top half π₯threadβ the function that gets used as the pollfunc bottom half πdirectionβ which way the data stream flows (in/out) π¦setup_opsβ the buffer setup functions to use for this device. and listen β if it'sNULL, the default setup functions for triggered buffers get used instead, easy peasy β¨buffer_attrsβ extra sysfs buffer attributes for this IIO buffer π a little something extra, as a treat.
β DESCRIPTION β
so this function is basically the group-project-assembler of the IIO world π it combines a bunch of common tasks that you'd normally have to do by hand whenever you're setting up a triggered buffer. specifically: it allocates the buffer and it allocates the pollfunc. two birds, one iconique function π¦β¨
β οΈ timing check, bestie, this one matters: before you call this function, theindio_devstructure should already be completely initialized β but not yet registered. in practice? that means you call this right beforeiio_device_register. fr fr, order is everything π
and when you're done and you need to free all the resources this bad boy allocated, you call iio_triggered_buffer_cleanup π§Ή don't forget, or it's giving leak era π
π¦ SEE ALSO π¦
- Kernel file
./drivers/iio/buffer/industrialio-triggered-buffer.cβ go read the source, it ate π iio_triggered_buffer_cleanup(9)β the cleanup half of the story, your ride or die for teardown πΈ
and that's the whole page, bestie β no cap, every detail is here π«Ά this came to you from ./drivers/iio/buffer, dated October 2026, living in the Kernel API Manual β mwah, go write some drivers π
π¦ 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