Commit | Line | Data |
---|---|---|
0d9a693c MW |
1 | _DSD Device Properties Related to GPIO |
2 | -------------------------------------- | |
3 | ||
4 | With the release of ACPI 5.1 and the _DSD configuration objecte names | |
5 | can finally be given to GPIOs (and other things as well) returned by | |
6 | _CRS. Previously, we were only able to use an integer index to find | |
7 | the corresponding GPIO, which is pretty error prone (it depends on | |
8 | the _CRS output ordering, for example). | |
9 | ||
10 | With _DSD we can now query GPIOs using a name instead of an integer | |
11 | index, like the ASL example below shows: | |
12 | ||
13 | // Bluetooth device with reset and shutdown GPIOs | |
14 | Device (BTH) | |
15 | { | |
16 | Name (_HID, ...) | |
17 | ||
18 | Name (_CRS, ResourceTemplate () | |
19 | { | |
20 | GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, | |
21 | "\\_SB.GPO0", 0, ResourceConsumer) {15} | |
22 | GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, | |
23 | "\\_SB.GPO0", 0, ResourceConsumer) {27, 31} | |
24 | }) | |
25 | ||
26 | Name (_DSD, Package () | |
27 | { | |
28 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | |
29 | Package () | |
30 | { | |
31 | Package () {"reset-gpio", Package() {^BTH, 1, 1, 0 }}, | |
32 | Package () {"shutdown-gpio", Package() {^BTH, 0, 0, 0 }}, | |
33 | } | |
34 | }) | |
35 | } | |
36 | ||
37 | The format of the supported GPIO property is: | |
38 | ||
39 | Package () { "name", Package () { ref, index, pin, active_low }} | |
40 | ||
41 | ref - The device that has _CRS containing GpioIo()/GpioInt() resources, | |
42 | typically this is the device itself (BTH in our case). | |
43 | index - Index of the GpioIo()/GpioInt() resource in _CRS starting from zero. | |
44 | pin - Pin in the GpioIo()/GpioInt() resource. Typically this is zero. | |
45 | active_low - If 1 the GPIO is marked as active_low. | |
46 | ||
47 | Since ACPI GpioIo() resource does not have a field saying whether it is | |
48 | active low or high, the "active_low" argument can be used here. Setting | |
49 | it to 1 marks the GPIO as active low. | |
50 | ||
51 | In our Bluetooth example the "reset-gpio" refers to the second GpioIo() | |
52 | resource, second pin in that resource with the GPIO number of 31. |