Lines Matching +full:power +full:- +full:gpios

5 This document explains how GPIOs can be assigned to given devices and functions.
7 Note that it only applies to the new descriptor-based interface. For a
8 description of the deprecated integer-based GPIO interface please refer to
15 Kconfig. Then, how GPIOs are mapped depends on what the platform uses to
20 -----------
21 GPIOs can easily be mapped to devices and functions in the device tree. The
22 exact way to do it depends on the GPIO controller providing the GPIOs, see the
25 GPIOs mappings are defined in the consumer device's node, in a property named
26 <function>-gpios, where <function> is the function the driver will request
32 led-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>, /* red */
36 power-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
39 Properties named <function>-gpio are also considered valid and old bindings use
43 This property will make GPIOs 15, 16 and 17 available to the driver under the
44 "led" function, and GPIO 1 as the "power" GPIO::
46 struct gpio_desc *red, *green, *blue, *power;
52 power = gpiod_get(dev, "power", GPIOD_OUT_HIGH);
54 The led GPIOs will be active high, while the power GPIO will be active low (i.e.
55 gpiod_is_active_low(power) will be true).
58 the <function>-prefix of the GPIO suffixes ("gpios" or "gpio", automatically
60 "led-gpios" example, use the prefix without the "-" as con_id parameter: "led".
62 Internally, the GPIO subsystem prefixes the GPIO suffix ("gpios" or "gpio")
64 (``snprintf(... "%s-%s", con_id, gpio_suffixes[]``).
67 ----
68 ACPI also supports function names for GPIOs in a similar fashion to DT.
81 "\\_SB.GPI0", 0, ResourceConsumer) { 1 } // power
85 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
88 "led-gpios",
95 Package () { "power-gpios", Package () { ^FOO, 3, 0, 0 } },
101 Documentation/firmware-guide/acpi/gpio-properties.rst.
104 -------------
105 Finally, GPIOs can be bound to devices and functions using platform data. Board
110 GPIOs are mapped by the means of tables of lookups, containing instances of the
118 - key is either the label of the gpiod_chip instance providing the GPIO, or
120 - chip_hwnum is the hardware number of the GPIO within the chip, or U16_MAX
122 - con_id is the name of the GPIO function from the device point of view. It
124 - idx is the index of the GPIO within the function.
125 - flags is defined to specify the following properties:
126 * GPIO_ACTIVE_HIGH - GPIO line is active high
127 * GPIO_ACTIVE_LOW - GPIO line is active low
128 * GPIO_OPEN_DRAIN - GPIO line is set up as open drain
129 * GPIO_OPEN_SOURCE - GPIO line is set up as open source
130 * GPIO_PERSISTENT - GPIO line is persistent during
132 * GPIO_TRANSITORY - GPIO line is transitory and may loose its
144 make use of these GPIOs. It can be NULL, in which case it will be matched for
147 .. code-block:: c
155 GPIO_LOOKUP("gpio.0", 1, "power", GPIO_ACTIVE_LOW),
164 The driver controlling "foo.0" will then be able to obtain its GPIOs as follows::
166 struct gpio_desc *red, *green, *blue, *power;
172 power = gpiod_get(dev, "power", GPIOD_OUT_HIGH);
174 Since the "led" GPIOs are mapped as active-high, this example will switch their
175 signals to 1, i.e. enabling the LEDs. And for the "power" GPIO, which is mapped
176 as active-low, its actual signal will be 0 after this code. Contrary to the
177 legacy integer GPIO interface, the active-low property is handled during
181 the new descriptor-oriented interface.
185 .. code-block:: c
196 The line will be hogged as soon as the gpiochip is created or - in case the
197 chip was created earlier - when the hog table is registered.
200 --------------
210 - pin hardware number of array member 0 must also be 0,
211 - pin hardware numbers of consecutive array members which belong to the same