Documentation: gpio: Update ACPI part of the document to mention _DSD
Subsystems (3)
PATCH 1/1 Documentation: gpio: Update ACPI part of the document to mention _DSD
With ACPI 5.1 _DSD (Device Specific Data) it is now possible to name functions just like Device Tree is doing. Make sure that the documentation mentions _DSD as the recommended way to describe GPIOs in ACPI systems.
--- Documentation/gpio/board.txt | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)
Documentation/gpio/board.txt +37 -4
@@ -50,10 +50,43 @@ gpiod_is_active_low(power) will be true). ACPI ---- -ACPI does not support function names for GPIOs. Therefore, only the "idx" -argument of gpiod_get_index() is useful to discriminate between GPIOs assigned -to a device. The "con_id" argument can still be set for debugging purposes (it -will appear under error messages as well as debug and sysfs nodes). +ACPI does also support function names for GPIOs in similar fashion than DT. +The above DT example can be converted to corresponding ACPI version with +the help of _DSD (Device Specific Data) which was introduced in ACPI 5.1: + + Device (FOO) { + Name (_CRS, ResourceTemplate () { + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {15} // red + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {16} // green + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {17} // blue + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {1} // power + }) + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { + "led-gpios", + Package () { + ^FOO, 0, 0, 1, + ^FOO, 1, 0, 1, + ^FOO, 2, 0, 1, + } + }, + Package () { + "power-gpios", + Package () {^FOO, 3, 0, 0}, + }, + } + }) + } + +For more information about the ACPI GPIO bindings see +Documentation/acpi/gpio-properties.txt. Platform Data -------------
Signature · 1 line
2.1.4
Quoted 6 lines · Mika Westerberg
With ACPI 5.1
_DSD(Device Specific Data) it is now possible to name functions just like Device Tree is doing. Make sure that the documentation mentions_DSDas the recommended way to describe GPIOs in ACPI systems.Reported-by Darren Hart <[email protected]>Signed-off-by Mika Westerberg <[email protected]>
Thanks Mika! Couple of nits below to help it read a little better.
Quoted 20 lines
---
Documentation/gpio/board.txt| 41
+++++++++++++++++++++++++++++++++++++----1 file changed, 37 insertions(+), 4 deletions(-)Documentation/gpio/board.txt +0
-0@@ -50,10 +50,43 @@ gpiod_is_active_low(power) will be true).ACPI
----Documentation/gpio/board.txt +0
-2-ACPI does not support function names for GPIOs. Therefore, only the "idx" -argument of gpiod_get_index() is useful to discriminate between GPIOsassigned
-to a device. The "con_id" argument can still be set for debugging purposes (itDocumentation/gpio/board.txt +1
-1-will appear under error messages as well as debug and sysfs nodes). +ACPI does also support function names for GPIOs in similar fashion than
Quoted 1 line
DT.
ACPI also supports function names for GPIOs in a similar fashion to DT.
Quoted 1 line
+The above DT example can be converted to corresponding ACPI version with
... to an equivalent ACPI description with
Quoted 1 line
+the help of
_DSD(Device Specific Data) which was introduced in ACPI 5.1:
s/ which was/, /
--
Darren
Quoted 41 lines
Documentation/gpio/board.txt +34
-0+ + Device (FOO) { + Name (_CRS, ResourceTemplate () { + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {15} // red + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {16} // green + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {17} // blue + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, + "\\_SB.GPI0") {1} // power + }) + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { + "led-gpios", + Package () { + ^FOO, 0, 0, 1, + ^FOO, 1, 0, 1, + ^FOO, 2, 0, 1, + } + }, + Package () { + "power-gpios", + Package () {^FOO, 3, 0, 0}, + }, + } + }) + } + +For more information about the ACPI GPIO bindings see +Documentation/acpi/gpio-properties.txt.Platform Data
-------------Signature · 1 line
2.1.4
Signature · 2 lines
Darren Hart Intel Open Source Technology Center