Lines Matching +full:in +full:- +full:gpios
1 .. SPDX-License-Identifier: GPL-2.0
8 allows names to be given to GPIOs (and other things as well) returned
13 With _DSD we can now query GPIOs using a name instead of an integer
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 } },
46 typically this is the device itself (BTH in our case).
48 Index of the GpioIo()/GpioInt() resource in _CRS starting from zero.
50 Pin in the GpioIo()/GpioInt() resource. Typically this is zero.
58 Note, active_low in _DSD does not make sense for GpioInt() resource and
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.
75 assuming non-active (Polarity = !Pull Bias)
77 Down High as low, assuming non-active
78 Up Low as high, assuming non-active
82 That said, for our above example the both GPIOs, since the bias setting
84 polarity and Linux will configure the pins in this state until a driver
87 It is possible to leave holes in the array of GPIOs. This is useful in
89 implemented as GPIOs and some as native signals. For example a SPI host
90 controller can have chip selects 0 and 2 implemented as GPIOs and 1 as
94 "cs-gpios",
103 the SPISerialBus() resource defines it on the per-chip basis. In order
114 - gpio-hog
115 - output-high
116 - output-low
117 - input
118 - line-name
124 ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
126 Package () { "hog-gpio8", "G8PU" }
131 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
133 Package () { "gpio-hog", 1 },
134 Package () { "gpios", Package () { 8, 0 } },
135 Package () { "output-high", 1 },
136 Package () { "line-name", "gpio8-pullup" },
140 - gpio-line-names
142 The ``gpio-line-names`` declaration is a list of strings ("names"), which
143 describes each line/pin of a GPIO controller/expander. This list, contained in
145 table (typically inside the DSDT). The ``gpio-line-names`` list must respect the
148 - the first name in the list corresponds with the first line/pin of the GPIO
150 - the names inside the list must be consecutive (no "holes" are permitted)
151 - the list can be incomplete and can end before the last GPIO line: in
153 - empty names are allowed (two quotation marks ``""`` correspond to an empty
155 - names inside one GPIO controller/expander must be unique
161 "gpio-line-names",
176 gpiochip4 - 16 lines:
177 line 0: "pin_0" unused input active-high
178 line 1: "pin_1" unused input active-high
179 line 2: unnamed unused input active-high
180 line 3: unnamed unused input active-high
181 line 4: "pin_3" unused input active-high
182 line 5: "pin_4_push_button" unused input active-high
183 line 6: unnamed unused input active-high
184 line 7 unnamed unused input active-high
185 line 8: unnamed unused input active-high
186 line 9: unnamed unused input active-high
187 line 10: unnamed unused input active-high
188 line 11: unnamed unused input active-high
189 line 12: unnamed unused input active-high
190 line 13: unnamed unused input active-high
191 line 14: unnamed unused input active-high
192 line 15: unnamed unused input active-high
200 "gpio-line-names",
213 There are systems in which the ACPI tables do not contain _DSD but provide _CRS
217 In those cases ACPI device identification objects, _HID, _CID, _CLS, _SUB, _HRV,
220 listed by the GpioIo()/GpioInt() resources returned by _CRS. In other words,
226 To do that, the driver needs to define a mapping table as a NULL-terminated
231 GpioIo()/GpioInt() resource in _CRS starting from zero, the index of the target
232 line in that resource starting from zero, and the active-low flag for that line,
233 respectively, in analogy with the _DSD GPIO property format specified above.
235 For the example Bluetooth device discussed previously the data structures in
242 { "reset-gpios", &reset_gpio, 1 },
243 { "shutdown-gpios", &shutdown_gpio, 1 },
250 argument. That should be done in the driver's .probe() routine.
259 mapping, the Linux GPIO framework refuses to return any GPIOs. This is
282 the GpioIo() in _CRS desc will hold ERR_PTR(-ENOENT).
285 (this is the recommended way and it's documented in the above chapter).
290 objects, as listed in the above chapter, of the device in question.
305 desc = gpiod_get(dev, "non-null-connection-id", flags);
306 desc = gpiod_get_index(dev, "non-null-connection-id", index, flags);
317 Case 2 explicitly tells GPIO core to look for resources in _CRS.
319 Be aware that gpiod_get_index() in cases 1 and 2, assuming that there
321 present in the driver, will return different resources. That's why a
322 certain driver has to handle them carefully as explained in the previous