asphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget2/translations/zh_CN/admin-guide/gpio/gpio-virtusermodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/zh_TW/admin-guide/gpio/gpio-virtusermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/it_IT/admin-guide/gpio/gpio-virtusermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/ja_JP/admin-guide/gpio/gpio-virtusermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/ko_KR/admin-guide/gpio/gpio-virtusermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/pt_BR/admin-guide/gpio/gpio-virtusermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget2/translations/sp_SP/admin-guide/gpio/gpio-virtusermodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h%SPDX-License-Identifier: GPL-2.0-onlyh]h%SPDX-License-Identifier: GPL-2.0-only}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhL/var/lib/git/docbuild/linux/Documentation/admin-guide/gpio/gpio-virtuser.rsthKubhsection)}(hhh](htitle)}(hVirtual GPIO Consumerh]hVirtual GPIO Consumer}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThe virtual GPIO Consumer module allows users to instantiate virtual devices that request GPIOs and then control their behavior over debugfs. Virtual consumer devices can be instantiated from device-tree or over configfs.h]hThe virtual GPIO Consumer module allows users to instantiate virtual devices that request GPIOs and then control their behavior over debugfs. Virtual consumer devices can be instantiated from device-tree or over configfs.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hA virtual consumer uses the driver-facing GPIO APIs and allows to cover it with automated tests driven by user-space. The GPIOs are requested using ``gpiod_get_array()`` and so we support multiple GPIOs per connector ID.h](hA virtual consumer uses the driver-facing GPIO APIs and allows to cover it with automated tests driven by user-space. The GPIOs are requested using }(hhhhhNhNubhliteral)}(h``gpiod_get_array()``h]hgpiod_get_array()}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh3 and so we support multiple GPIOs per connector ID.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(hCreating GPIO consumersh]hCreating GPIO consumers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThe gpio-consumer module registers a configfs subsystem called ``'gpio-virtuser'``. For details of the configfs filesystem, please refer to the configfs documentation.h](h?The gpio-consumer module registers a configfs subsystem called }(hj hhhNhNubh)}(h``'gpio-virtuser'``h]h'gpio-virtuser'}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhU. For details of the configfs filesystem, please refer to the configfs documentation.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe user can create a hierarchy of configfs groups and items as well as modify values of exposed attributes. Once the consumer is instantiated, this hierarchy will be translated to appropriate device properties. The general structure is:h]hThe user can create a hierarchy of configfs groups and items as well as modify values of exposed attributes. Once the consumer is instantiated, this hierarchy will be translated to appropriate device properties. The general structure is:}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h$**Group:** ``/config/gpio-virtuser``h](hstrong)}(h **Group:**h]hGroup:}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjNubh }(hjNhhhNhNubh)}(h``/config/gpio-virtuser``h]h/config/gpio-virtuser}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h=This is the top directory of the gpio-consumer configfs tree.h]h=This is the top directory of the gpio-consumer configfs tree.}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h1**Group:** ``/config/gpio-consumer/example-name``h](jS)}(h **Group:**h]hGroup:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h&``/config/gpio-consumer/example-name``h]h"/config/gpio-consumer/example-name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h:**Attribute:** ``/config/gpio-consumer/example-name/live``h](jS)}(h**Attribute:**h]h Attribute:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h+``/config/gpio-consumer/example-name/live``h]h'/config/gpio-consumer/example-name/live}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h>**Attribute:** ``/config/gpio-consumer/example-name/dev_name``h](jS)}(h**Attribute:**h]h Attribute:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h/``/config/gpio-consumer/example-name/dev_name``h]h+/config/gpio-consumer/example-name/dev_name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK!hjhhubh)}(h8This is a directory representing a GPIO consumer device.h]h8This is a directory representing a GPIO consumer device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjhhubh)}(hThe read-only ``dev_name`` attribute exposes the name of the device as it will appear in the system on the platform bus. This is useful for locating the associated debugfs directory under ``/sys/kernel/debug/gpio-virtuser/$dev_name``.h](hThe read-only }(hjhhhNhNubh)}(h ``dev_name``h]hdev_name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh attribute exposes the name of the device as it will appear in the system on the platform bus. This is useful for locating the associated debugfs directory under }(hjhhhNhNubh)}(h-``/sys/kernel/debug/gpio-virtuser/$dev_name``h]h)/sys/kernel/debug/gpio-virtuser/$dev_name}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK%hjhhubh)}(hThe ``'live'`` attribute allows to trigger the actual creation of the device once it's fully configured. The accepted values are: ``'1'`` to enable the virtual device and ``'0'`` to disable and tear it down.h](hThe }(hjFhhhNhNubh)}(h ``'live'``h]h'live'}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFubhv attribute allows to trigger the actual creation of the device once it’s fully configured. The accepted values are: }(hjFhhhNhNubh)}(h``'1'``h]h'1'}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFubh" to enable the virtual device and }(hjFhhhNhNubh)}(h``'0'``h]h'0'}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFubh to disable and tear it down.}(hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK*hjhhubeh}(h]creating-gpio-consumersah ]h"]creating gpio consumersah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hCreating GPIO lookup tablesh]hCreating GPIO lookup tables}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK/ubh)}(hDUsers can create a number of configfs groups under the device group:h]hDUsers can create a number of configfs groups under the device group:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjhhubh)}(h8**Group:** ``/config/gpio-consumer/example-name/con_id``h](jS)}(h **Group:**h]hGroup:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h-``/config/gpio-consumer/example-name/con_id``h]h)/config/gpio-consumer/example-name/con_id}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK3hjhhubh)}(hThe ``'con_id'`` directory represents a single GPIO lookup and its value maps to the ``'con_id'`` argument of the ``gpiod_get()`` function. For example: ``con_id`` == ``'reset'`` maps to the ``reset-gpios`` device property.h](hThe }(hjhhhNhNubh)}(h ``'con_id'``h]h'con_id'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhE directory represents a single GPIO lookup and its value maps to the }(hjhhhNhNubh)}(h ``'con_id'``h]h'con_id'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh argument of the }(hjhhhNhNubh)}(h``gpiod_get()``h]h gpiod_get()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh function. For example: }(hjhhhNhNubh)}(h ``con_id``h]hcon_id}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh == }(hjhhhNhNubh)}(h ``'reset'``h]h'reset'}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh maps to the }(hjhhhNhNubh)}(h``reset-gpios``h]h reset-gpios}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh device property.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK5hjhhubh)}(hUsers can assign a number of GPIOs to each lookup. Each GPIO is a sub-directory with a user-defined name under the ``'con_id'`` group.h](hsUsers can assign a number of GPIOs to each lookup. Each GPIO is a sub-directory with a user-defined name under the }(hjUhhhNhNubh)}(h ``'con_id'``h]h'con_id'}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUubh group.}(hjUhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hjhhubh)}(hB**Attribute:** ``/config/gpio-consumer/example-name/con_id/0/key``h](jS)}(h**Attribute:**h]h Attribute:}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjuubh }(hjuhhhNhNubh)}(h3``/config/gpio-consumer/example-name/con_id/0/key``h]h//config/gpio-consumer/example-name/con_id/0/key}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hD**Attribute:** ``/config/gpio-consumer/example-name/con_id/0/drive``h](jS)}(h**Attribute:**h]h Attribute:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h5``/config/gpio-consumer/example-name/con_id/0/drive``h]h1/config/gpio-consumer/example-name/con_id/0/drive}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK@hjhhubh)}(hC**Attribute:** ``/config/gpio-consumer/example-name/con_id/0/pull``h](jS)}(h**Attribute:**h]h Attribute:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h4``/config/gpio-consumer/example-name/con_id/0/pull``h]h0/config/gpio-consumer/example-name/con_id/0/pull}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKBhjhhubh)}(hI**Attribute:** ``/config/gpio-consumer/example-name/con_id/0/active_low``h](jS)}(h**Attribute:**h]h Attribute:}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h:``/config/gpio-consumer/example-name/con_id/0/active_low``h]h6/config/gpio-consumer/example-name/con_id/0/active_low}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKDhjhhubh)}(hI**Attribute:** ``/config/gpio-consumer/example-name/con_id/0/transitory``h](jS)}(h**Attribute:**h]h Attribute:}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjGubh }(hjGhhhNhNubh)}(h:``/config/gpio-consumer/example-name/con_id/0/transitory``h]h6/config/gpio-consumer/example-name/con_id/0/transitory}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubeh}(h]h ]h"]h$]h&]uh1hhhhKFhjhhubh)}(hJThis is a group describing a single GPIO in the ``con_id-gpios`` property.h](h0This is a group describing a single GPIO in the }(hjqhhhNhNubh)}(h``con_id-gpios``h]h con_id-gpios}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqubh property.}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKHhjhhubh)}(hFor virtual consumers created using configfs we use machine lookup tables so this group can be considered as a mapping between the filesystem and the fields of a single entry in ``'struct gpiod_lookup'``.h](hFor virtual consumers created using configfs we use machine lookup tables so this group can be considered as a mapping between the filesystem and the fields of a single entry in }(hjhhhNhNubh)}(h``'struct gpiod_lookup'``h]h'struct gpiod_lookup'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKJhjhhubh)}(hX~The ``'key'`` attribute represents either the name of the chip this GPIO belongs to or the GPIO line name. This depends on the value of the ``'offset'`` attribute: if its value is >= 0, then ``'key'`` represents the label of the chip to lookup while ``'offset'`` represents the offset of the line in that chip. If ``'offset'`` is < 0, then ``'key'`` represents the name of the line.h](hThe }(hjhhhNhNubh)}(h ``'key'``h]h'key'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh attribute represents either the name of the chip this GPIO belongs to or the GPIO line name. This depends on the value of the }(hjhhhNhNubh)}(h ``'offset'``h]h'offset'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh' attribute: if its value is >= 0, then }(hjhhhNhNubh)}(h ``'key'``h]h'key'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh2 represents the label of the chip to lookup while }(hjhhhNhNubh)}(h ``'offset'``h]h'offset'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh4 represents the offset of the line in that chip. If }(hjhhhNhNubh)}(h ``'offset'``h]h'offset'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh is < 0, then }(hjhhhNhNubh)}(h ``'key'``h]h'key'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh! represents the name of the line.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubh)}(hThe remaining attributes map to the ``'flags'`` field of the GPIO lookup struct. The first two take string values as arguments:h](h$The remaining attributes map to the }(hj+hhhNhNubh)}(h ``'flags'``h]h'flags'}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ubhP field of the GPIO lookup struct. The first two take string values as arguments:}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKThjhhubh)}(h**``'drive'``:** ``'push-pull'``, ``'open-drain'``, ``'open-source'`` **``'pull'``:** ``'pull-up'``, ``'pull-down'``, ``'pull-disabled'``, ``'as-is'``h](jS)}(h**``'drive'``:**h]h``’drive’``:}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjKubh }(hjKhhhNhNubh)}(h``'push-pull'``h]h 'push-pull'}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubh, }(hjKhhhNhNubh)}(h``'open-drain'``h]h 'open-drain'}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubh, }hjKsbh)}(h``'open-source'``h]h 'open-source'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubh }(hjKhhhNhNubjS)}(h**``'pull'``:**h]h``’pull’``:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjKubh }hjKsbh)}(h ``'pull-up'``h]h 'pull-up'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubh, }hjKsbh)}(h``'pull-down'``h]h 'pull-down'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubh, }hjKsbh)}(h``'pull-disabled'``h]h'pull-disabled'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubh, }hjKsbh)}(h ``'as-is'``h]h'as-is'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubeh}(h]h ]h"]h$]h&]uh1hhhhKWhjhhubh)}(h=``'active_low'`` and ``'transitory'`` are boolean attributes.h](h)}(h``'active_low'``h]h 'active_low'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h``'transitory'``h]h 'transitory'}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh are boolean attributes.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKZhjhhubeh}(h]creating-gpio-lookup-tablesah ]h"]creating gpio lookup tablesah$]h&]uh1hhhhhhhhK/ubh)}(hhh](h)}(hActivating GPIO consumersh]hActivating GPIO consumers}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)hhhhhK]ubh)}(hXOOnce the configuration is complete, the ``'live'`` attribute must be set to 1 in order to instantiate the consumer. It can be set back to 0 to destroy the virtual device. The module will synchronously wait for the new simulated device to be successfully probed and if this doesn't happen, writing to ``'live'`` will result in an error.h](h(Once the configuration is complete, the }(hj:hhhNhNubh)}(h ``'live'``h]h'live'}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj:ubh attribute must be set to 1 in order to instantiate the consumer. It can be set back to 0 to destroy the virtual device. The module will synchronously wait for the new simulated device to be successfully probed and if this doesn’t happen, writing to }(hj:hhhNhNubh)}(h ``'live'``h]h'live'}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhj:ubh will result in an error.}(hj:hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK_hj)hhubeh}(h]activating-gpio-consumersah ]h"]activating gpio consumersah$]h&]uh1hhhhhhhhK]ubh)}(hhh](h)}(h Device-treeh]h Device-tree}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjthhhhhKfubh)}(hVirtual GPIO consumers can also be defined in device-tree. The compatible string must be: ``"gpio-virtuser"`` with at least one property following the standardized GPIO pattern.h](hZVirtual GPIO consumers can also be defined in device-tree. The compatible string must be: }(hjhhhNhNubh)}(h``"gpio-virtuser"``h]h"gpio-virtuser"}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhD with at least one property following the standardized GPIO pattern.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhjthhubh)}(h=An example device-tree code defining a virtual GPIO consumer:h]h=An example device-tree code defining a virtual GPIO consumer:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjthhubh literal_block)}(hgpio-virt-consumer { compatible = "gpio-virtuser"; foo-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>, <&gpio1 2 0>; bar-gpios = <&gpio0 6 0>; };h]hgpio-virt-consumer { compatible = "gpio-virtuser"; foo-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>, <&gpio1 2 0>; bar-gpios = <&gpio0 6 0>; };}hjsbah}(h]h ]h"]h$]h&]hhƌforcelanguagenonehighlight_args}uh1jhhhKnhjthhubeh}(h] device-treeah ]h"] device-treeah$]h&]uh1hhhhhhhhKfubh)}(hhh](h)}(h"Controlling virtual GPIO consumersh]h"Controlling virtual GPIO consumers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKxubh)}(hOnce active, the device will export debugfs attributes for controlling GPIO arrays as well as each requested GPIO line separately. Let's consider the following device property: ``foo-gpios = <&gpio0 0 0>, <&gpio0 4 0>;``.h](hOnce active, the device will export debugfs attributes for controlling GPIO arrays as well as each requested GPIO line separately. Let’s consider the following device property: }(hjhhhNhNubh)}(h+``foo-gpios = <&gpio0 0 0>, <&gpio0 4 0>;``h]h'foo-gpios = <&gpio0 0 0>, <&gpio0 4 0>;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKzhjhhubh)}(h7The following debugfs attribute groups will be created:h]h7The following debugfs attribute groups will be created:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjhhubh)}(hC**Group:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/``h](jS)}(h **Group:**h]hGroup:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h8``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/``h]h4/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hMThis is the group that will contain the attributes for the entire GPIO array.h]hMThis is the group that will contain the attributes for the entire GPIO array.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hM**Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values``h](jS)}(h**Attribute:**h]h Attribute:}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjGubh }(hjGhhhNhNubh)}(h>``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values``h]h:/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hT**Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values_atomic``h](jS)}(h**Attribute:**h]h Attribute:}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjqubh }(hjqhhhNhNubh)}(hE``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values_atomic``h]hA/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values_atomic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXBoth attributes allow to read and set arrays of GPIO values. User must pass exactly the number of values that the array contains in the form of a string containing zeroes and ones representing inactive and active GPIO states respectively. In this example: ``echo 11 > values``.h](hXBoth attributes allow to read and set arrays of GPIO values. User must pass exactly the number of values that the array contains in the form of a string containing zeroes and ones representing inactive and active GPIO states respectively. In this example: }(hjhhhNhNubh)}(h``echo 11 > values``h]hecho 11 > values}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe ``values_atomic`` attribute works the same as ``values`` but the kernel will execute the GPIO driver callbacks in interrupt context.h](hThe }(hjhhhNhNubh)}(h``values_atomic``h]h values_atomic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh attribute works the same as }(hjhhhNhNubh)}(h ``values``h]hvalues}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhL but the kernel will execute the GPIO driver callbacks in interrupt context.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hJ**Group:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/``h](jS)}(h **Group:**h]hGroup:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh }(hjhhhNhNubh)}(h?``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/``h]h;/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h\This is a group that represents a single GPIO with ``$index`` being its offset in the array.h](h3This is a group that represents a single GPIO with }(hjhhhNhNubh)}(h ``$index``h]h$index}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh being its offset in the array.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hV**Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/consumer``h](jS)}(h**Attribute:**h]h Attribute:}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj7ubh }(hj7hhhNhNubh)}(hG``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/consumer``h]hC/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/consumer}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h;Allows to set and read the consumer label of the GPIO line.h]h;Allows to set and read the consumer label of the GPIO line.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hV**Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/debounce``h](jS)}(h**Attribute:**h]h Attribute:}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjoubh }(hjohhhNhNubh)}(hG``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/debounce``h]hC/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/debounce}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjoubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h