Lines Matching +full:reset +full:- +full:gpio +full:- +full:active +full:- +full:high

1 .. SPDX-License-Identifier: GPL-2.0
4 _DSD Device Properties Related to GPIO
10 the corresponding GPIO, which is pretty error prone (it depends on
16 // Bluetooth device with reset and shutdown GPIOs
31 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
34 Package () { "reset-gpios", Package () { ^BTH, 1, 1, 0 } },
35 Package () { "shutdown-gpios", Package () { ^BTH, 0, 0, 0 } },
40 The format of the supported GPIO property is::
52 If 1, the GPIO is marked as active_low.
55 active low or high, the "active_low" argument can be used here. Setting
56 it to 1 marks the GPIO as active low.
61 In our Bluetooth example the "reset-gpios" refers to the second GpioIo()
62 resource, second pin in that resource with the GPIO number of 31.
70 +-------------+-------------+-----------------------------------------------+
74 +-------------+-------------+-----------------------------------------------+
76 +-------------+-------------+-----------------------------------------------+
78 +-------------+-------------+-----------------------------------------------+
81 +-------------+-------------+-----------------------------------------------+
83 | +-------------+ as high, assuming non-active |
85 | +-------------+-----------------------------------------------+
86 | | High | as high, assuming active |
87 +-------------+-------------+-----------------------------------------------+
89 | +-------------+ as low, assuming non-active |
90 | | High | |
91 | +-------------+-----------------------------------------------+
92 | | Low | as low, assuming active |
93 +-------------+-------------+-----------------------------------------------+
96 is explicit and _DSD is present, will be treated as active with a high
107 "cs-gpios",
109 ^GPIO, 19, 0, 0, // chip select 0: GPIO
111 ^GPIO, 20, 0, 0, // chip select 2: GPIO
115 Note, that historically ACPI has no means of the GPIO polarity and thus
116 the SPISerialBus() resource defines it on the per-chip basis. In order
117 to avoid a chain of negations, the GPIO polarity is considered being
118 Active High. Even for the cases when _DSD() is involved (see the example
119 above) the GPIO CS polarity must be defined Active High to avoid ambiguity.
125 _DSD device properties for GPIO controllers:
127 - gpio-hog
128 - output-high
129 - output-low
130 - input
131 - line-name
137 ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
139 Package () { "hog-gpio8", "G8PU" }
144 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
146 Package () { "gpio-hog", 1 },
148 Package () { "output-high", 1 },
149 Package () { "line-name", "gpio8-pullup" },
153 - gpio-line-names
155 The ``gpio-line-names`` declaration is a list of strings ("names"), which
156 describes each line/pin of a GPIO controller/expander. This list, contained in
157 a package, must be inserted inside the GPIO controller declaration of an ACPI
158 table (typically inside the DSDT). The ``gpio-line-names`` list must respect the
161 - the first name in the list corresponds with the first line/pin of the GPIO
163 - the names inside the list must be consecutive (no "holes" are permitted)
164 - the list can be incomplete and can end before the last GPIO line: in
165 other words, it is not mandatory to fill all the GPIO lines
166 - empty names are allowed (two quotation marks ``""`` correspond to an empty
168 - names inside one GPIO controller/expander must be unique
170 Example of a GPIO controller of 16 lines, with an incomplete list with two
174 "gpio-line-names",
189 gpiochip4 - 16 lines:
190 line 0: "pin_0" unused input active-high
191 line 1: "pin_1" unused input active-high
192 line 2: unnamed unused input active-high
193 line 3: unnamed unused input active-high
194 line 4: "pin_3" unused input active-high
195 line 5: "pin_4_push_button" unused input active-high
196 line 6: unnamed unused input active-high
197 line 7 unnamed unused input active-high
198 line 8: unnamed unused input active-high
199 line 9: unnamed unused input active-high
200 line 10: unnamed unused input active-high
201 line 11: unnamed unused input active-high
202 line 12: unnamed unused input active-high
203 line 13: unnamed unused input active-high
204 line 14: unnamed unused input active-high
205 line 15: unnamed unused input active-high
213 "gpio-line-names",
220 See Documentation/devicetree/bindings/gpio/gpio.txt for more information
223 ACPI GPIO Mappings Provided by Drivers
232 to be sufficient to determine the meaning and purpose of all of the GPIO lines
236 to the GPIO lines it is going to use and provide the GPIO subsystem with a
237 mapping between those names and the ACPI GPIO resources corresponding to them.
239 To do that, the driver needs to define a mapping table as a NULL-terminated
245 line in that resource starting from zero, and the active-low flag for that line,
246 respectively, in analogy with the _DSD GPIO property format specified above.
255 { "reset-gpios", &reset_gpio, 1 },
256 { "shutdown-gpios", &shutdown_gpio, 1 },
264 On removal, the driver should unregister its GPIO mapping table by
271 If a device does not have _DSD or the driver does not create ACPI GPIO
272 mapping, the Linux GPIO framework refuses to return any GPIOs. This is
288 The driver might expect to get the right GPIO when it does::
290 desc = gpiod_get(dev, "reset", GPIOD_OUT_LOW);
294 but since there is no way to know the mapping between "reset" and
295 the GpioIo() in _CRS desc will hold ERR_PTR(-ENOENT).
300 The ACPI GPIO mapping tables should not contaminate drivers that are not
302 the ACPI GPIO mapping tables are hardly linked to an ACPI ID and certain
305 Getting GPIO descriptor
308 There are two main approaches to get GPIO resource from ACPI::
318 desc = gpiod_get(dev, "non-null-connection-id", flags);
319 desc = gpiod_get_index(dev, "non-null-connection-id", index, flags);
327 defined device properties and will prevent to getting any GPIO resources
330 Case 2 explicitly tells GPIO core to look for resources in _CRS.