From patchwork Tue Mar 31 11:43:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 456592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 92B2314009B for ; Tue, 31 Mar 2015 22:43:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbbCaLnX (ORCPT ); Tue, 31 Mar 2015 07:43:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:48350 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753891AbbCaLnT (ORCPT ); Tue, 31 Mar 2015 07:43:19 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 31 Mar 2015 04:43:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,500,1422950400"; d="scan'208";a="688225948" Received: from black.fi.intel.com ([10.237.72.86]) by fmsmga001.fm.intel.com with ESMTP; 31 Mar 2015 04:43:16 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id C1609D8; Tue, 31 Mar 2015 14:43:15 +0300 (EEST) From: Mika Westerberg To: Linus Walleij Cc: Alexandre Courbot , Jonathan Corbet , "Rafael J. Wysocki" , Darren Hart , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, Mika Westerberg Subject: [PATCH] Documentation: gpio: Update ACPI part of the document to mention _DSD Date: Tue, 31 Mar 2015 14:43:15 +0300 Message-Id: <1427802195-221906-1-git-send-email-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.1.4 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 Signed-off-by: Mika Westerberg --- Documentation/gpio/board.txt | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/Documentation/gpio/board.txt b/Documentation/gpio/board.txt index 8b35f51fe7b6..b68cfa8a6865 100644 --- a/Documentation/gpio/board.txt +++ b/Documentation/gpio/board.txt @@ -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 -------------