Lines Matching +full:set +full:- +full:gpios
1 .. SPDX-License-Identifier: GPL-2.0-only
6 The GPIO Aggregator provides a mechanism to aggregate GPIOs, and expose them as
10 Aggregating GPIOs using Sysfs
11 -----------------------------
15 system permissions, on an all-or-nothing basis: either a GPIO controller is
18 The GPIO Aggregator provides access control for a set of one or more GPIOs, by
21 simplifies and hardens exporting GPIOs to a virtual machine, as the VM can just
22 grab the full GPIO controller, and no longer needs to care about which GPIOs to
26 write-only attribute files in sysfs.
28 /sys/bus/platform/drivers/gpio-aggregator/
32 controller by writing a string describing the GPIOs to
35 .. code-block:: none
48 is a comma-separated list of GPIO offsets and/or
52 line 19 of "e6052000.gpio" and GPIO lines 20-21 of
55 .. code-block:: sh
57 $ echo 'e6052000.gpio 19 e6050000.gpio 20-21' > new_device
64 Example: Destroy the previously-created aggregated GPIO
65 controller, assumed to be "gpio-aggregator.0":
67 .. code-block:: sh
69 $ echo gpio-aggregator.0 > delete_device
72 Aggregating GPIOs using Configfs
73 --------------------------------
75 **Group:** ``/config/gpio-aggregator``
77 This is the root directory of the gpio-aggregator configfs tree.
79 **Group:** ``/config/gpio-aggregator/<example-name>``
82 name to ``<example-name>`` (e.g. ``agg0``), except names starting with
83 ``_sysfs`` prefix, which are reserved for auto-generated configfs
86 **Attribute:** ``/config/gpio-aggregator/<example-name>/live``
94 **Attribute:** ``/config/gpio-aggregator/<example-name>/dev_name``
96 The read-only ``dev_name`` attribute exposes the name of the device as it
97 will appear in the system on the platform bus (e.g. ``gpio-aggregator.0``).
99 aggregator. If it's ``gpio-aggregator.0``,
100 ``/sys/devices/platform/gpio-aggregator.0/gpiochipX`` path tells you that the
108 **Group:** ``/config/gpio-aggregator/<example-name>/<lineY>/``
112 **Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/key``
114 **Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/offset``
119 * ``offset`` : -1
126 * Set ``key`` to the line name.
127 * Ensure ``offset`` remains -1 (the default).
131 * Set ``key`` to the chip name.
132 * Set ``offset`` to the line offset (0 <= ``offset`` < 65535).
134 **Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/name``
139 Once the configuration is done, the ``'live'`` attribute must be set to 1
140 in order to instantiate the aggregator device. It can be set back to 0 to
149 auto-generated and appear as ``/config/gpio-aggregator/_sysfs.<N>/``. You
155 is set to 0 by hand (i.e. it's not waiting for deferred probe).
160 .. code-block:: sh
163 $ mkdir /sys/kernel/config/gpio-aggregator/agg0
166 $ mkdir /sys/kernel/config/gpio-aggregator/agg0/line0
167 $ echo gpiochip0 > /sys/kernel/config/gpio-aggregator/agg0/line0/key
168 $ echo 6 > /sys/kernel/config/gpio-aggregator/agg0/line0/offset
169 $ echo test0 > /sys/kernel/config/gpio-aggregator/agg0/line0/name
170 $ mkdir /sys/kernel/config/gpio-aggregator/agg0/line1
171 $ echo gpiochip0 > /sys/kernel/config/gpio-aggregator/agg0/line1/key
172 $ echo 7 > /sys/kernel/config/gpio-aggregator/agg0/line1/offset
173 $ echo test1 > /sys/kernel/config/gpio-aggregator/agg0/line1/name
176 $ echo 1 > /sys/kernel/config/gpio-aggregator/agg0/live
180 -------------------
183 GPIO-operated device described in DT, without a dedicated in-kernel driver.
188 gpio-aggregator driver, or by writing to the "driver_override" file in Sysfs.
190 Example: If "door" is a GPIO-operated device described in DT, using its own
196 gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>,
198 gpio-line-names = "open", "lock";
206 .. code-block:: sh
208 $ echo gpio-aggregator > /sys/bus/platform/devices/door/driver_override
209 $ echo door > /sys/bus/platform/drivers/gpio-aggregator/bind
213 .. code-block:: sh
216 gpiochip12 - 2 lines:
217 line 0: "open" unused input active-high
218 line 1: "lock" unused input active-high