sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget4/translations/zh_CN/driver-api/iio/triggered-buffersmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/zh_TW/driver-api/iio/triggered-buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/it_IT/driver-api/iio/triggered-buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/ja_JP/driver-api/iio/triggered-buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/ko_KR/driver-api/iio/triggered-buffersmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/sp_SP/driver-api/iio/triggered-buffersmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hTriggered Buffersh]hTriggered Buffers}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhN/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers.rsthKubh paragraph)}(hPNow that we know what buffers and triggers are let's see how they work together.h]hRNow that we know what buffers and triggers are let’s see how they work together.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hIIO triggered buffer setuph]hIIO triggered buffer setup}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh bullet_list)}(hhh](h list_item)}(hL:c:func:`iio_triggered_buffer_setup` — Setup triggered buffer and pollfunch]h)}(hhh](h)}(h$:c:func:`iio_triggered_buffer_setup`h]hliteral)}(hhh]hiio_triggered_buffer_setup()}(hhhhhNhNubah}(h]h ](xrefcc-funceh"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]refdoc driver-api/iio/triggered-buffers refdomainhreftypefunc refexplicitrefwarn reftargetiio_triggered_buffer_setupuh1hhhhK hhubh( — Setup triggered buffer and pollfunc}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hk:c:func:`iio_triggered_buffer_cleanup` — Free resources allocated by :c:func:`iio_triggered_buffer_setup`h]h)}(hk:c:func:`iio_triggered_buffer_cleanup` — Free resources allocated by :c:func:`iio_triggered_buffer_setup`h](h)}(h&:c:func:`iio_triggered_buffer_cleanup`h]h)}(hj%h]hiio_triggered_buffer_cleanup()}(hj'hhhNhNubah}(h]h ](hhc-funceh"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypefunc refexplicitrefwarnj iio_triggered_buffer_cleanupuh1hhhhK hjubh! — Free resources allocated by }(hjhhhNhNubh)}(h$:c:func:`iio_triggered_buffer_setup`h]h)}(hjHh]hiio_triggered_buffer_setup()}(hjJhhhNhNubah}(h]h ](hhc-funceh"]h$]h&]uh1hhjFubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypefunc refexplicitrefwarnj iio_triggered_buffer_setupuh1hhhhK hjubeh}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(h?struct iio_buffer_setup_ops — buffer setup related callbacks h]h)}(h>struct iio_buffer_setup_ops — buffer setup related callbacksh]h>struct iio_buffer_setup_ops — buffer setup related callbacks}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjqubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK hhhhubh)}(h2A typical triggered buffer setup looks like this::h]h1A typical triggered buffer setup looks like this:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh literal_block)}(hXconst struct iio_buffer_setup_ops sensor_buffer_setup_ops = { .preenable = sensor_buffer_preenable, .postenable = sensor_buffer_postenable, .postdisable = sensor_buffer_postdisable, .predisable = sensor_buffer_predisable, }; irqreturn_t sensor_iio_pollfunc(int irq, void *p) { pf->timestamp = iio_get_time_ns((struct indio_dev *)p); return IRQ_WAKE_THREAD; } irqreturn_t sensor_trigger_handler(int irq, void *p) { u16 buf[8]; int i = 0; /* read data for each active channel */ for_each_set_bit(bit, active_scan_mask, masklength) buf[i++] = sensor_get_data(bit) iio_push_to_buffers_with_timestamp(indio_dev, buf, timestamp); iio_trigger_notify_done(trigger); return IRQ_HANDLED; } /* setup triggered buffer, usually in probe function */ iio_triggered_buffer_setup(indio_dev, sensor_iio_polfunc, sensor_trigger_handler, sensor_buffer_setup_ops);h]hXconst struct iio_buffer_setup_ops sensor_buffer_setup_ops = { .preenable = sensor_buffer_preenable, .postenable = sensor_buffer_postenable, .postdisable = sensor_buffer_postdisable, .predisable = sensor_buffer_predisable, }; irqreturn_t sensor_iio_pollfunc(int irq, void *p) { pf->timestamp = iio_get_time_ns((struct indio_dev *)p); return IRQ_WAKE_THREAD; } irqreturn_t sensor_trigger_handler(int irq, void *p) { u16 buf[8]; int i = 0; /* read data for each active channel */ for_each_set_bit(bit, active_scan_mask, masklength) buf[i++] = sensor_get_data(bit) iio_push_to_buffers_with_timestamp(indio_dev, buf, timestamp); iio_trigger_notify_done(trigger); return IRQ_HANDLED; } /* setup triggered buffer, usually in probe function */ iio_triggered_buffer_setup(indio_dev, sensor_iio_polfunc, sensor_trigger_handler, sensor_buffer_setup_ops);}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhKhhhhubh)}(h(The important things to notice here are:h]h(The important things to notice here are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hhhhubh)}(hhh](h)}(h:c:type:`iio_buffer_setup_ops`, the buffer setup functions to be called at predefined points in the buffer configuration sequence (e.g. before enable, after disable). If not specified, the IIO core uses the default iio_triggered_buffer_setup_ops.h]h)}(h:c:type:`iio_buffer_setup_ops`, the buffer setup functions to be called at predefined points in the buffer configuration sequence (e.g. before enable, after disable). If not specified, the IIO core uses the default iio_triggered_buffer_setup_ops.h](h)}(h:c:type:`iio_buffer_setup_ops`h]h)}(hjh]hiio_buffer_setup_ops}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnj iio_buffer_setup_opsuh1hhhhK4hjubh, the buffer setup functions to be called at predefined points in the buffer configuration sequence (e.g. before enable, after disable). If not specified, the IIO core uses the default iio_triggered_buffer_setup_ops.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXK**sensor_iio_pollfunc**, the function that will be used as top half of poll function. It should do as little processing as possible, because it runs in interrupt context. The most common operation is recording of the current timestamp and for this reason one can use the IIO core defined :c:func:`iio_pollfunc_store_time` function.h]h)}(hXK**sensor_iio_pollfunc**, the function that will be used as top half of poll function. It should do as little processing as possible, because it runs in interrupt context. The most common operation is recording of the current timestamp and for this reason one can use the IIO core defined :c:func:`iio_pollfunc_store_time` function.h](hstrong)}(h**sensor_iio_pollfunc**h]hsensor_iio_pollfunc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX , the function that will be used as top half of poll function. It should do as little processing as possible, because it runs in interrupt context. The most common operation is recording of the current timestamp and for this reason one can use the IIO core defined }(hjhhhNhNubh)}(h!:c:func:`iio_pollfunc_store_time`h]h)}(hjh]hiio_pollfunc_store_time()}(hjhhhNhNubah}(h]h ](hhc-funceh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypefunc refexplicitrefwarnj iio_pollfunc_store_timeuh1hhhhK8hjubh function.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hX6**sensor_trigger_handler**, the function that will be used as bottom half of the poll function. This runs in the context of a kernel thread and all the processing takes place here. It usually reads data from the device and stores it in the internal buffer together with the timestamp recorded in the top half. h]h)}(hX5**sensor_trigger_handler**, the function that will be used as bottom half of the poll function. This runs in the context of a kernel thread and all the processing takes place here. It usually reads data from the device and stores it in the internal buffer together with the timestamp recorded in the top half.h](j)}(h**sensor_trigger_handler**h]hsensor_trigger_handler}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubhX, the function that will be used as bottom half of the poll function. This runs in the context of a kernel thread and all the processing takes place here. It usually reads data from the device and stores it in the internal buffer together with the timestamp recorded in the top half.}(hjHhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK=hjDubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhK4hhhhubeh}(h]iio-triggered-buffer-setupah ]h"]iio triggered buffer setupah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h More detailsh]h More details}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxhhhhhKDubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](single+iio_triggered_buffer_setup_ext (C function) c.iio_triggered_buffer_setup_exthNtauh1jhjxhhhNhNubhdesc)}(hhh](hdesc_signature)}(hXint 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)h]hdesc_signature_line)}(hXint 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)h](hdesc_sig_keyword_type)}(hinth]hint}(hjhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jhjhhh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chK'ubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhK'ubh desc_name)}(hiio_triggered_buffer_setup_exth]h desc_sig_name)}(hiio_triggered_buffer_setup_exth]hiio_triggered_buffer_setup_ext}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&]jjuh1jhjhhhjhK'ubhdesc_parameterlist)}(h(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)h](hdesc_parameter)}(hstruct iio_dev *indio_devh](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hiio_devh]hiio_dev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j6 ASTIdentifier)}j1jsb c.iio_triggered_buffer_setup_extasbuh1hhjubj)}(h h]h }(hjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhdesc_sig_punctuation)}(hjh]h*}(hjShhhNhNubah}(h]h ]pah"]h$]h&]uh1jQhjubj)}(h indio_devh]h indio_dev}(hjahhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h"irqreturn_t (*h)(int irq, void *p)h](h)}(hhh]j)}(h irqreturn_th]h irqreturn_t}(hj}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjzubah}(h]h ]h"]h$]h&] refdomainhreftypej1 reftargetjmodnameN classnameNj5j8)}j;]j? c.iio_triggered_buffer_setup_extasbuh1hhjvubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubjR)}(h(h]h(}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjvubjR)}(hjh]h*}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjvubj)}(hhh]hh}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubjR)}(h)h]h)}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjvubjR)}(hjh]h(}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjvubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubj)}(hirqh]hirq}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubjR)}(h,h]h,}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjvubj)}(h h]h }(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubj)}(hvoidh]hvoid}(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubj)}(h h]h }(hjAhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubjR)}(hjh]h*}(hjOhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjvubj)}(hj]h]hp}(hj\hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubjR)}(hjh]h)}(hjihhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjvubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h'irqreturn_t (*thread)(int irq, void *p)h](h)}(hhh]j)}(h irqreturn_th]h irqreturn_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypej1 reftargetjmodnameN classnameNj5j8)}j;]j? c.iio_triggered_buffer_setup_extasbuh1hhj}ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubjR)}(hjh]h(}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhj}ubjR)}(hjh]h*}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhj}ubj)}(hthreadh]hthread}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubjR)}(hjh]h)}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhj}ubjR)}(hjh]h(}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhj}ubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj)}(hirqh]hirq}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubjR)}(hjh]h,}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhj}ubj)}(h h]h }(hj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj)}(hvoidh]hvoid}(hj7hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubj)}(h h]h }(hjEhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubjR)}(hjh]h*}(hjShhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhj}ubj)}(hj]h]hp}(hj`hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubjR)}(hjh]h)}(hjmhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhj}ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h#enum iio_buffer_direction directionh](j)}(henumh]henum}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hiio_buffer_directionh]hiio_buffer_direction}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypej1 reftargetjmodnameN classnameNj5j8)}j;]j? c.iio_triggered_buffer_setup_extasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h directionh]h direction}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h,const struct iio_buffer_setup_ops *setup_opsh](j)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hiio_buffer_setup_opsh]hiio_buffer_setup_ops}(hj#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainhreftypej1 reftargetj%modnameN classnameNj5j8)}j;]j? c.iio_triggered_buffer_setup_extasbuh1hhjubj)}(h h]h }(hjAhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjR)}(hjh]h*}(hjOhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjubj)}(h setup_opsh]h setup_ops}(hj\hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h(const struct iio_dev_attr **buffer_attrsh](j)}(hjh]hconst}(hjuhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubj)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubh)}(hhh]j)}(h iio_dev_attrh]h iio_dev_attr}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypej1 reftargetjmodnameN classnameNj5j8)}j;]j? c.iio_triggered_buffer_setup_extasbuh1hhjqubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubjR)}(hjh]h*}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjqubjR)}(hjh]h*}(hjhhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjqubj)}(h buffer_attrsh]h buffer_attrs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhjhhhjhK'ubeh}(h]h ]h"]h$]h&]jj add_permalinkuh1jsphinx_line_type declaratorhjhhhjhK'ubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhK'hjhhubh desc_content)}(hhh]h)}(h#Setup triggered buffer and pollfunch]h#Setup triggered buffer and pollfunc}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhj%hhubah}(h]h ]h"]h$]h&]uh1j#hjhhhjhK'ubeh}(h]h ](hfunctioneh"]h$]h&]domainhobjtypej@desctypej@noindex noindexentrynocontentsentryuh1jhhhjxhNhNubh container)}(hXA**Parameters** ``struct iio_dev *indio_dev`` IIO device structure ``irqreturn_t (*h)(int irq, void *p)`` Function which will be used as pollfunc top half ``irqreturn_t (*thread)(int irq, void *p)`` Function which will be used as pollfunc bottom half ``enum iio_buffer_direction direction`` Direction of the data stream (in/out). ``const struct iio_buffer_setup_ops *setup_ops`` Buffer setup functions to use for this device. If NULL the default setup functions for triggered buffers will be used. ``const struct iio_dev_attr **buffer_attrs`` Extra sysfs buffer attributes for this IIO buffer **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().h](h)}(h**Parameters**h]j)}(hjRh]h Parameters}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjLubhdefinition_list)}(hhh](hdefinition_list_item)}(h3``struct iio_dev *indio_dev`` IIO device structure h](hterm)}(h``struct iio_dev *indio_dev``h]h)}(hjwh]hstruct iio_dev *indio_dev}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubah}(h]h ]h"]h$]h&]uh1jsh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjoubh definition)}(hhh]h)}(hIIO device structureh]hIIO device structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]uh1jmhjhKhjjubjn)}(hX``irqreturn_t (*h)(int irq, void *p)`` Function which will be used as pollfunc top half h](jt)}(h&``irqreturn_t (*h)(int irq, void *p)``h]h)}(hjh]h"irqreturn_t (*h)(int irq, void *p)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jsh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjubj)}(hhh]h)}(h0Function which will be used as pollfunc top halfh]h0Function which will be used as pollfunc top half}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jmhjhKhjjubjn)}(h```irqreturn_t (*thread)(int irq, void *p)`` Function which will be used as pollfunc bottom half h](jt)}(h+``irqreturn_t (*thread)(int irq, void *p)``h]h)}(hjh]h'irqreturn_t (*thread)(int irq, void *p)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jsh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjubj)}(hhh]h)}(h3Function which will be used as pollfunc bottom halfh]h3Function which will be used as pollfunc bottom half}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jmhjhKhjjubjn)}(hO``enum iio_buffer_direction direction`` Direction of the data stream (in/out). h](jt)}(h'``enum iio_buffer_direction direction``h]h)}(hj$h]h#enum iio_buffer_direction direction}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]uh1jsh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjubj)}(hhh]h)}(h&Direction of the data stream (in/out).h]h&Direction of the data stream (in/out).}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hKhj:ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jmhj9hKhjjubjn)}(h``const struct iio_buffer_setup_ops *setup_ops`` Buffer setup functions to use for this device. If NULL the default setup functions for triggered buffers will be used. h](jt)}(h0``const struct iio_buffer_setup_ops *setup_ops``h]h)}(hj]h]h,const struct iio_buffer_setup_ops *setup_ops}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj[ubah}(h]h ]h"]h$]h&]uh1jsh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjWubj)}(hhh]h)}(hvBuffer setup functions to use for this device. If NULL the default setup functions for triggered buffers will be used.h]hvBuffer setup functions to use for this device. If NULL the default setup functions for triggered buffers will be used.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjsubah}(h]h ]h"]h$]h&]uh1jhjWubeh}(h]h ]h"]h$]h&]uh1jmhjrhKhjjubjn)}(h_``const struct iio_dev_attr **buffer_attrs`` Extra sysfs buffer attributes for this IIO buffer h](jt)}(h,``const struct iio_dev_attr **buffer_attrs``h]h)}(hjh]h(const struct iio_dev_attr **buffer_attrs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jsh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjubj)}(hhh]h)}(h1Extra sysfs buffer attributes for this IIO bufferh]h1Extra sysfs buffer attributes for this IIO buffer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jmhjhKhjjubeh}(h]h ]h"]h$]h&]uh1jhhjLubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjLubh)}(hThis function combines some common tasks which will normally be performed when setting up a triggered buffer. It will allocate the buffer and the pollfunc.h]hThis function combines some common tasks which will normally be performed when setting up a triggered buffer. It will allocate the buffer and the pollfunc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjLubh)}(hBefore 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().h]hBefore 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().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chK hjLubh)}(hUTo free the resources allocated by this function call iio_triggered_buffer_cleanup().h]hUTo free the resources allocated by this function call iio_triggered_buffer_cleanup().}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chK$hjLubeh}(h]h ] kernelindentah"]h$]h&]uh1jJhjxhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j)iio_triggered_buffer_cleanup (C function)c.iio_triggered_buffer_cleanuphNtauh1jhjxhhhNhNubj)}(hhh](j)}(h=void iio_triggered_buffer_cleanup (struct iio_dev *indio_dev)h]j)}(h)}j1jX sbc.iio_triggered_buffer_cleanupasbuh1hhjn ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjn ubjR)}(hjh]h*}(hj hhhNhNubah}(h]h ]j]ah"]h$]h&]uh1jQhjn ubj)}(h indio_devh]h indio_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjn ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjj ubah}(h]h ]h"]h$]h&]jjuh1jhj1 hhhjC hKiubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj- hhhjC hKiubah}(h]j( ah ](jjeh"]h$]h&]j j!)j"huh1jhjC hKihj* hhubj$)}(hhh]h)}(h