Lines Matching +full:in +full:- +full:gpios
5 This document explains how GPIOs can be assigned to given devices and functions.
9 Kconfig. Then, how GPIOs are mapped depends on what the platform uses to
14 -----------
15 GPIOs can easily be mapped to devices and functions in the device tree. The
16 exact way to do it depends on the GPIO controller providing the GPIOs, see the
19 GPIOs mappings are defined in the consumer device's node, in a property named
20 <function>-gpios, where <function> is the function the driver will request
26 led-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>, /* red */
30 power-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
33 Properties named <function>-gpio are also considered valid and old bindings use
37 This property will make GPIOs 15, 16 and 17 available to the driver under the
48 The led GPIOs will be active high, while the power GPIO will be active low (i.e.
52 the <function>-prefix of the GPIO suffixes ("gpios" or "gpio", automatically
53 looked up by the gpiod functions internally) used in the device tree. With above
54 "led-gpios" example, use the prefix without the "-" as con_id parameter: "led".
56 Internally, the GPIO subsystem prefixes the GPIO suffix ("gpios" or "gpio")
57 with the string passed in con_id to get the resulting string
58 (``snprintf(... "%s-%s", con_id, gpio_suffixes[]``).
61 ----
62 ACPI also supports function names for GPIOs in a similar fashion to DT.
64 with the help of _DSD (Device Specific Data), introduced in ACPI 5.1::
79 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
82 "led-gpios",
89 Package () { "power-gpios", Package () { ^FOO, 3, 0, 0 } },
95 Documentation/firmware-guide/acpi/gpio-properties.rst.
98 -------------
99 Finally, GPIOs can be bound to devices and functions using platform data. Board
104 GPIOs are mapped by the means of tables of lookups, containing instances of the
112 - key is either the label of the gpiod_chip instance providing the GPIO, or
114 - chip_hwnum is the hardware number of the GPIO within the chip, or U16_MAX
116 - con_id is the name of the GPIO function from the device point of view. It
117 can be NULL, in which case it will match any function.
118 - idx is the index of the GPIO within the function.
119 - flags is defined to specify the following properties:
120 * GPIO_ACTIVE_HIGH - GPIO line is active high
121 * GPIO_ACTIVE_LOW - GPIO line is active low
122 * GPIO_OPEN_DRAIN - GPIO line is set up as open drain
123 * GPIO_OPEN_SOURCE - GPIO line is set up as open source
124 * GPIO_PERSISTENT - GPIO line is persistent during
126 * GPIO_TRANSITORY - GPIO line is transitory and may loose its
129 In the future, these flags might be extended to support more properties.
138 make use of these GPIOs. It can be NULL, in which case it will be matched for
141 .. code-block:: c
158 The driver controlling "foo.0" will then be able to obtain its GPIOs as follows::
168 Since the "led" GPIOs are mapped as active-high, this example will switch their
170 as active-low, its actual signal will be 0 after this code. Contrary to the
171 legacy integer GPIO interface, the active-low property is handled during
175 the new descriptor-oriented interface.
179 .. code-block:: c
190 The line will be hogged as soon as the gpiochip is created or - in case the
191 chip was created earlier - when the hog table is registered.
194 --------------
195 In addition to requesting pins belonging to a function one by one, a device may
201 In order to qualify for fast bitmap processing, the array must meet the
204 - pin hardware number of array member 0 must also be 0,
205 - pin hardware numbers of consecutive array members which belong to the same
208 Otherwise fast bitmap processing path is not used in order to avoid consecutive
209 pins which belong to the same chip but are not in hardware order being processed