---
name: "iio_triggered_buffer_setup"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/iio_triggered_buffer_setup"
---

# iio\_triggered\_buffer\_setup(9)

Setup triggered buffer and pollfunc

## NAME

iio\_triggered\_buffer\_setup - Setup triggered buffer and pollfunc

## SYNOPSIS

**int iio\_triggered\_buffer\_setup(struct iio\_dev \*** *indio\_dev***, irqreturn\_t (\****h***) (int irq, void \*p), irqreturn\_t (\****thread***) (int irq, void \*p), const struct iio\_buffer\_setup\_ops \*** *setup\_ops***);**

## ARGUMENTS

*indio\_dev*

IIO device structure

*h*

Function which will be used as pollfunc top half

*thread*

Function which will be used as pollfunc bottom half

*setup\_ops*

Buffer setup functions to use for this device. If NULL the default setup functions for triggered buffers will be used.

## DESCRIPTION

This function combines some common tasks which will normally be performed when setting up a triggered buffer. It will allocate the buffer and the pollfunc.

Before calling this function the indio\_dev structure should already be completely initialized, but not yet registered. In practice this means that this function should be called right before **iio\_device\_register**.

To free the resources allocated by this function call **iio\_triggered\_buffer\_cleanup**.

## AUTHOR

**Daniel Baluta** \<daniel.baluta@intel.com\>

Author.

## COPYRIGHT
