linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-gpio@vger.kernel.org
Cc: rjw@rjwysocki.net, Linus Walleij <linus.walleij@linaro.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Rob Landley <rob@landley.net>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH 5/5] gpiolib / ACPI: document the GPIO descriptor based interface
Date: Tue,  1 Oct 2013 17:58:57 +0300	[thread overview]
Message-ID: <1380639537-23406-6-git-send-email-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <1380639537-23406-1-git-send-email-mika.westerberg@linux.intel.com>

In addition to the existing ACPI specific GPIO interface, document the new
descriptor based GPIO interface in Documentation/acpi/enumeration.txt, so
it is clear that this new interface is preferred over the ACPI specific
version.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 Documentation/acpi/enumeration.txt | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt
index aca4e69..48bb9ab 100644
--- a/Documentation/acpi/enumeration.txt
+++ b/Documentation/acpi/enumeration.txt
@@ -322,3 +322,25 @@ suitable to the gpiolib before passing them.
 
 In case of GpioInt resource an additional call to gpio_to_irq() must be
 done before calling request_irq().
+
+Note that the above API is ACPI specific and not recommended for drivers
+that need to support non-ACPI systems. The recommended way is to use
+the descriptor based GPIO interfaces. The above example looks like this
+when converted to the GPIO desc:
+
+	#include <linux/gpio/consumer.h>
+	...
+
+	struct gpio_desc *irq_desc, *power_desc;
+
+	irq_desc = gpiod_get_index(dev, NULL, 1);
+	if (IS_ERR(irq_desc))
+		/* handle error */
+
+	power_desc = gpiod_get_index(dev, NULL, 0);
+	if (IS_ERR(power_desc))
+		/* handle error */
+
+	/* Now we can use the GPIO descriptors */
+
+See also Documentation/gpio.txt.
-- 
1.8.4.rc3


  parent reply	other threads:[~2013-10-01 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 14:58 [PATCH 0/5] gpiolib: convert ACPI GPIO helpers to gpiod_ interfaces Mika Westerberg
2013-10-01 14:58 ` [PATCH 1/5] gpiolib / ACPI: move acpi_gpiochip_free_interrupts next to the request function Mika Westerberg
2013-10-11 10:52   ` Linus Walleij
2013-10-01 14:58 ` [PATCH 2/5] gpiolib / ACPI: convert to gpiod interfaces Mika Westerberg
2013-10-08  4:54   ` Alexandre Courbot
2013-10-08  8:45     ` Mika Westerberg
2013-10-08 10:36       ` Mika Westerberg
2013-10-08 16:26         ` Alexandre Courbot
2013-10-09  8:01           ` Mika Westerberg
2013-10-08 16:24       ` Alexandre Courbot
2013-10-09  7:58         ` Mika Westerberg
2013-10-09 16:36           ` Alexandre Courbot
2013-10-01 14:58 ` [PATCH 3/5] gpiolib / ACPI: add ACPI support for gpiod_get_index() Mika Westerberg
2013-10-01 14:58 ` [PATCH 4/5] gpiolib / ACPI: allow passing GPIOF_ACTIVE_LOW for GpioInt resources Mika Westerberg
2013-10-01 14:58 ` Mika Westerberg [this message]
2013-10-07 12:18 ` [PATCH 0/5] gpiolib: convert ACPI GPIO helpers to gpiod_ interfaces Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380639537-23406-6-git-send-email-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=acourbot@nvidia.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=rob@landley.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).