remarkable-linux/Documentation/acpi
Mika Westerberg 0d9a693cc8 gpio / ACPI: Add support for _DSD device properties
With release of ACPI 5.1 and _DSD method we can finally name GPIOs (and
other things as well) returned by _CRS. Previously we were only able to
use integer index to find the corresponding GPIO, which is pretty error
prone if the order changes.

With _DSD we can now query GPIOs using name instead of an integer index,
like the below example shows:

  // Bluetooth device with reset and shutdown GPIOs
  Device (BTH)
  {
      Name (_HID, ...)

      Name (_CRS, ResourceTemplate ()
      {
          GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly,
                  "\\_SB.GPO0", 0, ResourceConsumer) {15}
          GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly,
                  "\\_SB.GPO0", 0, ResourceConsumer) {27, 31}
      })

      Name (_DSD, Package ()
      {
          ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
          Package ()
	  {
              Package () {"reset-gpio", Package() {^BTH, 1, 1, 0 }},
              Package () {"shutdown-gpio", Package() {^BTH, 0, 0, 0 }},
          }
      })
  }

The format of the supported GPIO property is:

  Package () { "name", Package () { ref, index, pin, active_low }}

  ref - The device that has _CRS containing GpioIo()/GpioInt() resources,
        typically this is the device itself (BTH in our case).
  index - Index of the GpioIo()/GpioInt() resource in _CRS starting from zero.
  pin - Pin in the GpioIo()/GpioInt() resource. Typically this is zero.
  active_low - If 1 the GPIO is marked as active_low.

Since ACPI GpioIo() resource does not have field saying whether it is
active low or high, the "active_low" argument can be used here. Setting
it to 1 marks the GPIO as active low.

In our Bluetooth example the "reset-gpio" refers to the second GpioIo()
resource, second pin in that resource with the GPIO number of 31.

This patch implements necessary support to gpiolib for extracting GPIOs
using _DSD device properties.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-04 21:58:22 +01:00
..
apei ACPI, APEI, EINJ: Changes to the ACPI/APEI/EINJ debugfs interface 2013-12-17 16:04:22 -08:00
debug.txt ACPI: update debug parameter documentation 2008-11-07 21:45:29 -05:00
dsdt-override.txt ACPI / PM / Documentation: Replace outdated project links and addresses 2013-10-11 13:22:43 +02:00
enumeration.txt mfd: Add ACPI support 2014-09-26 08:24:05 +01:00
gpio-properties.txt gpio / ACPI: Add support for _DSD device properties 2014-11-04 21:58:22 +01:00
initrd_table_override.txt ACPI: Document ACPI table overriding via initrd 2012-09-30 18:03:41 -07:00
method-customizing.txt ACPI: Split out custom_method functionality into an own driver 2011-05-29 01:50:40 -04:00
method-tracing.txt ACPI: document method tracing hooks 2007-11-19 12:25:56 -05:00
namespace.txt ACPI / scan: Add acpi_device objects for all device nodes in the namespace 2013-11-22 21:54:37 +01:00
scan_handlers.txt ACPI / scan: Introduce struct acpi_scan_handler 2013-01-30 14:27:29 +01:00
video_extension.txt ACPI / video: update video_extension.txt for backlight control 2013-06-21 00:16:05 +02:00