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]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/pt_BR/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()}(hjhhhNhNubah}(h]h ](xrefcc-funceh"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]refdoc driver-api/iio/triggered-buffers refdomainj reftypefunc 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)}(hj9h]hiio_triggered_buffer_cleanup()}(hj;hhhNhNubah}(h]h ](j j c-funceh"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]refdocj refdomainj reftypefunc refexplicitrefwarnjiio_triggered_buffer_cleanupuh1hhhhK hj3ubh! — Free resources allocated by }(hj3hhhNhNubh)}(h$:c:func:`iio_triggered_buffer_setup`h]h)}(hj\h]hiio_triggered_buffer_setup()}(hj^hhhNhNubah}(h]h ](j j c-funceh"]h$]h&]uh1hhjZubah}(h]h ]h"]h$]h&]refdocj refdomainj reftypefunc refexplicitrefwarnjiio_triggered_buffer_setupuh1hhhhK hj3ubeh}(h]h ]h"]h$]h&]uh1hhhhK hj/ubah}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(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 ](j j c-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdocj refdomainj reftypetype refexplicitrefwarnjiio_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)}(hj+h]hiio_pollfunc_store_time()}(hj-hhhNhNubah}(h]h ](j j c-funceh"]h$]h&]uh1hhj)ubah}(h]h ]h"]h$]h&]refdocj refdomainj reftypefunc refexplicitrefwarnjiio_pollfunc_store_timeuh1hhhhK8hjubh function.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK8hj ubah}(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}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj\ubhX, 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.}(hj\hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK=hjXubah}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKDubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](single+iio_triggered_buffer_setup_ext (C function) c.iio_triggered_buffer_setup_exthNtauh1jhjhhhNhNubhdesc)}(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.chKubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhKubh 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&]jjuh1jhjhhhjhKubhdesc_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&]uh1j hj ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j)}(hiio_devh]hiio_dev}(hj/hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&] refdomainj reftype identifier reftargetj1modnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]jJ ASTIdentifier)}jEjsb c.iio_triggered_buffer_setup_extasbuh1hhj ubj)}(h h]h }(hjWhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubhdesc_sig_punctuation)}(hjh]h*}(hjghhhNhNubah}(h]h ]pah"]h$]h&]uh1jehj ubj)}(h indio_devh]h indio_dev}(hjuhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h"irqreturn_t (*h)(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&] refdomainj reftypejE reftargetjmodnameN classnameNjIjL)}jO]jS c.iio_triggered_buffer_setup_extasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(h(h]h(}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubjf)}(hjh]h*}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(hhh]hh}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(h)h]h)}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubjf)}(hjh]h(}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hirqh]hirq}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(h,h]h,}(hj+hhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(h h]h }(hj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hvoidh]hvoid}(hjGhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjUhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h*}(hjchhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(hjqh]hp}(hjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h)}(hj}hhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubeh}(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&] refdomainj reftypejE reftargetjmodnameN classnameNjIjL)}jO]jS c.iio_triggered_buffer_setup_extasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h(}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubjf)}(hjh]h*}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(hthreadh]hthread}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h)}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubjf)}(hjh]h(}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hirqh]hirq}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hj-h]h,}(hj0hhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(h h]h }(hj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hvoidh]hvoid}(hjKhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjYhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h*}(hjghhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(hjqh]hp}(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h)}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h#enum iio_buffer_direction directionh](j)}(henumh]henum}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j hjubj)}(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&] refdomainj reftypejE reftargetjmodnameN classnameNjIjL)}jO]jS 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&]uh1j hjubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j hjubj)}(h h]h }(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hiio_buffer_setup_opsh]hiio_buffer_setup_ops}(hj7hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubah}(h]h ]h"]h$]h&] refdomainj reftypejE reftargetj9modnameN classnameNjIjL)}jO]jS c.iio_triggered_buffer_setup_extasbuh1hhjubj)}(h h]h }(hjUhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h*}(hjchhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(h setup_opsh]h setup_ops}(hjphhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubj)}(h(const struct iio_dev_attr **buffer_attrsh](j)}(hjh]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j hjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j hjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(h iio_dev_attrh]h iio_dev_attr}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainj reftypejE reftargetjmodnameN classnameNjIjL)}jO]jS c.iio_triggered_buffer_setup_extasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjf)}(hjh]h*}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubjf)}(hjh]h*}(hjhhhNhNubah}(h]h ]jqah"]h$]h&]uh1jehjubj)}(h buffer_attrsh]h buffer_attrs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]jj add_permalinkuh1jsphinx_line_type declaratorhjhhhjhKubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhKhjhhubh 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.chKhj9hhubah}(h]h ]h"]h$]h&]uh1j7hjhhhjhKubeh}(h]h ](j functioneh"]h$]h&]domainj objtypejTdesctypejTnoindex noindexentrynocontentsentryuh1jhhhjhNhNubh 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)}(hjfh]h Parameters}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjdubah}(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`ubhdefinition_list)}(hhh](hdefinition_list_item)}(h3``struct iio_dev *indio_dev`` IIO device structure h](hterm)}(h``struct iio_dev *indio_dev``h]h)}(hjh]hstruct iio_dev *indio_dev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjubh definition)}(hhh]h)}(hIIO device structureh]hIIO device structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhj~ubj)}(hX``irqreturn_t (*h)(int irq, void *p)`` Function which will be used as pollfunc top half h](j)}(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&]uh1jh/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&]uh1jhjhKhj~ubj)}(h```irqreturn_t (*thread)(int irq, void *p)`` Function which will be used as pollfunc bottom half h](j)}(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&]uh1jh/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&]uh1jhjhKhj~ubj)}(hO``enum iio_buffer_direction direction`` Direction of the data stream (in/out). h](j)}(h'``enum iio_buffer_direction direction``h]h)}(hj8h]h#enum iio_buffer_direction direction}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6ubah}(h]h ]h"]h$]h&]uh1jh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhj2ubj)}(hhh]h)}(h&Direction of the data stream (in/out).h]h&Direction of the data stream (in/out).}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhKhjNubah}(h]h ]h"]h$]h&]uh1jhj2ubeh}(h]h ]h"]h$]h&]uh1jhjMhKhj~ubj)}(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](j)}(h0``const struct iio_buffer_setup_ops *setup_ops``h]h)}(hjqh]h,const struct iio_buffer_setup_ops *setup_ops}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjoubah}(h]h ]h"]h$]h&]uh1jh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKhjkubj)}(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.}(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.chKhjubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1jhjhKhj~ubj)}(h_``const struct iio_dev_attr **buffer_attrs`` Extra sysfs buffer attributes for this IIO buffer h](j)}(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&]uh1jh/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&]uh1jhjhKhj~ubeh}(h]h ]h"]h$]h&]uh1j|hj`ubh)}(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.chKhj`ubh)}(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.chKhj`ubh)}(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().}(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`ubh)}(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#hj`ubeh}(h]h ] kernelindentah"]h$]h&]uh1j^hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j)iio_triggered_buffer_cleanup (C function)c.iio_triggered_buffer_cleanuphNtauh1jhjhhhNhNubj)}(hhh](j)}(h=void iio_triggered_buffer_cleanup (struct iio_dev *indio_dev)h]j)}(h hhubj8)}(hhh]h)}(h hhhjW hKfubeh}(h]h ](j functioneh"]h$]h&]jXj jYj! jZj! j[j\j]uh1jhhhjhNhNubj_)}(hD**Parameters** ``struct iio_dev *indio_dev`` IIO device structureh](h)}(h**Parameters**h]j)}(hj+ h]h Parameters}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj) ubah}(h]h ]h"]h$]h&]uh1hh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKjhj% ubj})}(hhh]j)}(h2``struct iio_dev *indio_dev`` IIO device structureh](j)}(h``struct iio_dev *indio_dev``h]h)}(hjJ h]hstruct iio_dev *indio_dev}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjH ubah}(h]h ]h"]h$]h&]uh1jh/var/lib/git/docbuild/linux/Documentation/driver-api/iio/triggered-buffers:69: ./drivers/iio/buffer/industrialio-triggered-buffer.chKlhjD ubj)}(hhh]h)}(hIIO device structureh]hIIO device structure}(hjc 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.chKghj` ubah}(h]h ]h"]h$]h&]uh1jhjD ubeh}(h]h ]h"]h$]h&]uh1jhj_ hKlhjA ubah}(h]h ]h"]h$]h&]uh1j|hj% ubeh}(h]h ] kernelindentah"]h$]h&]uh1j^hjhhhNhNubeh}(h] more-detailsah ]h"] more detailsah$]h&]uh1hhhhhhhhKDubeh}(h]triggered-buffersah ]h"]triggered buffersah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehʌ _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j j jjj j u nametypes}(j jj uh}(j hjhj jjjj< jA u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.