Documentation: gpio: Update ACPI part of the document to mention _DSD
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 1 Apr 2015 08:13:16 +0000 (11:13 +0300)
committerJonathan Corbet <corbet@lwn.net>
Sat, 4 Apr 2015 13:20:27 +0000 (15:20 +0200)
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.

Reported-by: Darren Hart <dvhart@linux.intel.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/gpio/board.txt

index 8b35f51fe7b6a3e8d11a2abc3104913794349cce..b80606de545ad809fb147688060b26b51af4d5e1 100644 (file)
@@ -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 also supports function names for GPIOs in a similar fashion to DT.
+The above DT example can be converted to an equivalent ACPI description
+with the help of _DSD (Device Specific Data), 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
 -------------
This page took 0.029271 seconds and 5 git commands to generate.