Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>

authored by

Mika Westerberg and committed by
Jonathan Corbet
cfc50764 7085f6c3

+37 -4
+37 -4
Documentation/gpio/board.txt
··· 50 50 51 51 ACPI 52 52 ---- 53 - ACPI does not support function names for GPIOs. Therefore, only the "idx" 54 - argument of gpiod_get_index() is useful to discriminate between GPIOs assigned 55 - to a device. The "con_id" argument can still be set for debugging purposes (it 56 - will appear under error messages as well as debug and sysfs nodes). 53 + ACPI also supports function names for GPIOs in a similar fashion to DT. 54 + The above DT example can be converted to an equivalent ACPI description 55 + with the help of _DSD (Device Specific Data), introduced in ACPI 5.1: 56 + 57 + Device (FOO) { 58 + Name (_CRS, ResourceTemplate () { 59 + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, 60 + "\\_SB.GPI0") {15} // red 61 + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, 62 + "\\_SB.GPI0") {16} // green 63 + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, 64 + "\\_SB.GPI0") {17} // blue 65 + GpioIo (Exclusive, ..., IoRestrictionOutputOnly, 66 + "\\_SB.GPI0") {1} // power 67 + }) 68 + 69 + Name (_DSD, Package () { 70 + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), 71 + Package () { 72 + Package () { 73 + "led-gpios", 74 + Package () { 75 + ^FOO, 0, 0, 1, 76 + ^FOO, 1, 0, 1, 77 + ^FOO, 2, 0, 1, 78 + } 79 + }, 80 + Package () { 81 + "power-gpios", 82 + Package () {^FOO, 3, 0, 0}, 83 + }, 84 + } 85 + }) 86 + } 87 + 88 + For more information about the ACPI GPIO bindings see 89 + Documentation/acpi/gpio-properties.txt. 57 90 58 91 Platform Data 59 92 -------------