iio_triggere...er_setup_ext(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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's NULL, 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, the indio_dev structure should already be completely initialized β€” but not yet registered. in practice? that means you call this right before iio_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