Lines Matching +full:echo +full:- +full:gpios
1 .. SPDX-License-Identifier: GPL-2.0-only
7 that request GPIOs and then control their behavior over debugfs. Virtual
8 consumer devices can be instantiated from device-tree or over configfs.
10 A virtual consumer uses the driver-facing GPIO APIs and allows to cover it with
11 automated tests driven by user-space. The GPIOs are requested using
12 ``gpiod_get_array()`` and so we support multiple GPIOs per connector ID.
15 -----------------------
17 The gpio-consumer module registers a configfs subsystem called
18 ``'gpio-virtuser'``. For details of the configfs filesystem, please refer to
25 **Group:** ``/config/gpio-virtuser``
27 This is the top directory of the gpio-consumer configfs tree.
29 **Group:** ``/config/gpio-consumer/example-name``
31 **Attribute:** ``/config/gpio-consumer/example-name/live``
33 **Attribute:** ``/config/gpio-consumer/example-name/dev_name``
37 The read-only ``dev_name`` attribute exposes the name of the device as it will
40 ``/sys/kernel/debug/gpio-virtuser/$dev_name``.
47 ---------------------------
51 **Group:** ``/config/gpio-consumer/example-name/con_id``
55 ``con_id`` == ``'reset'`` maps to the ``reset-gpios`` device property.
57 Users can assign a number of GPIOs to each lookup. Each GPIO is a sub-directory
58 with a user-defined name under the ``'con_id'`` group.
60 **Attribute:** ``/config/gpio-consumer/example-name/con_id/0/key``
62 **Attribute:** ``/config/gpio-consumer/example-name/con_id/0/offset``
64 **Attribute:** ``/config/gpio-consumer/example-name/con_id/0/drive``
66 **Attribute:** ``/config/gpio-consumer/example-name/con_id/0/pull``
68 **Attribute:** ``/config/gpio-consumer/example-name/con_id/0/active_low``
70 **Attribute:** ``/config/gpio-consumer/example-name/con_id/0/transitory``
72 This is a group describing a single GPIO in the ``con_id-gpios`` property.
87 **``'drive'``:** ``'push-pull'``, ``'open-drain'``, ``'open-source'``
88 **``'pull'``:** ``'pull-up'``, ``'pull-down'``, ``'pull-disabled'``, ``'as-is'``
93 -------------------------
101 Device-tree
102 -----------
104 Virtual GPIO consumers can also be defined in device-tree. The compatible string
105 must be: ``"gpio-virtuser"`` with at least one property following the
108 An example device-tree code defining a virtual GPIO consumer:
110 .. code-block :: none
112 gpio-virt-consumer {
113 compatible = "gpio-virtuser";
115 foo-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>, <&gpio1 2 0>;
116 bar-gpios = <&gpio0 6 0>;
120 ----------------------------------
124 following device property: ``foo-gpios = <&gpio0 0 0>, <&gpio0 4 0>;``.
128 **Group:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/``
132 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values``
134 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo/values_atomic``
139 respectively. In this example: ``echo 11 > values``.
144 **Group:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/``
149 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/consumer``
153 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/debounce``
157 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/direction``
159 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/direction_atomic``
165 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/interrupts``
172 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/value``
174 **Attribute:** ``/sys/kernel/debug/gpio-virtuser/$dev_name/gpiod:foo:$index/value_atomic``