mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@googlemail.com>
To: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Alexander Shiyan" <shc_work@mail.ru>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Alexandre Courbot" <gnurou@gmail.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Christian Lamparter" <chunkeey@googlemail.com>
Subject: [RFC v4 8/8] gpio: dt-bindings: add gpio-mmio bindings
Date: Thu, 28 Apr 2016 11:05:18 +0200	[thread overview]
Message-ID: <262d58824524c19917e6bf760da1c8ea2b6a616c.1461806071.git.chunkeey@googlemail.com> (raw)
In-Reply-To: <cover.1461806071.git.chunkeey@googlemail.com>
In-Reply-To: <cover.1461806071.git.chunkeey@googlemail.com>

From: Álvaro Fernández Rojas <noltari@gmail.com>

This patch adds the device tree bindings for the gpio-mmio.
The gpio-mmio is already part of a the GPIO generic library.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
---
 .../devicetree/bindings/gpio/gpio-mmio.txt         | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-mmio.txt

diff --git a/Documentation/devicetree/bindings/gpio/gpio-mmio.txt b/Documentation/devicetree/bindings/gpio/gpio-mmio.txt
new file mode 100644
index 0000000..cc7f0b1
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.txt
@@ -0,0 +1,73 @@
+Bindings for the generic driver for memory-mapped GPIO controllers.
+
+Required properties:
+	- compatible: should be "linux,gpio-mmio"
+	- reg-names: must contain
+		"dat" - data register
+		may contain
+		"set" - data set register
+		"clr" - data clear register
+		"dirout" - direction output register
+		"dirin" - direction input register
+	- reg: address + size pairs describing the GPIO register sets;
+		order must correspond with the order of entries in reg-names
+	- #gpio-cells = must be set to 2
+	- gpio-controller: Marks the device node as a gpio controller.
+
+Optional properties:
+	- ngpio: specifies the number of gpio mapped in the register.
+	- big-endian: force big endian register accesses.
+	- big-endian-byte-order: assign GPIOs in reverse order.
+	- unreadable-reg-set: data set register is not readable.
+	- read-output-reg-set: cache value set for reads.
+	- unreadable-reg-dir: dirout/dirin register is not readable.
+	- no-output: GPIOs are read-only.
+
+The GPIO generic library provides support for memory-mapped GPIO
+controllers. The configuration is detected by which resources are present.
+The simplest form of a GPIO controller that the driver support is just a
+single "dat" register, where GPIO state can be read and/or written.
+However, the driver supports far more:
+	- 8/16/32/64 bits registers. The number of GPIOs is automatically
+	  determined by the width of the registers.
+	- GPIO controllers with clear/set registers.
+	- GPIO controllers with a single "dat" register.
+	- Big endian bits/GPIOs ordering.
+
+For setting GPIO's there are three configurations:
+	1. single input/output register resource (named "dat"),
+	2. set/clear pair (named "set" and "clr"),
+	3. single output register resource and single input resource
+	   ("set" and dat").
+
+For setting the GPIO direction, there are three configurations:
+	a. simple bidirectional GPIOs that requires no configuration.
+	b. an output direction register (named "dirout")
+	   where a 1 bit indicates the GPIO is an output.
+	c. an input direction register (named "dirin")
+	   where a 1 bit indicates the GPIO is an input.
+
+Examples:
+
+	/* Configuration for single input/output register
+	 * for eight simple bidirectional GPIOs.
+	 */
+	gpio_a_1 {
+		compatible = "linux,gpio-mmio";
+		reg = <0x18000000 0x1>;
+		reg-names = "dat";
+		#gpio-cells = <2>;
+		gpio-controller;
+	};
+
+	/* Configuration for set/clear pair registers with
+	 * 32 output direction register GPIOs.
+	 */
+	gpio_b_2 {
+		compatible = "linux,gpio-mmio";
+		reg = <0x18000000 0x4>, <0x18000010 0x4>,
+		      <0x18000004 0x4>, <0x18000008 0x4>;
+		reg-names = "dat", "set", "clr", "dirout";
+		#gpio-cells = <2>;
+		gpio-controller;
+	};
-- 
2.8.1

      parent reply	other threads:[~2016-04-28  9:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28  9:05 [RFC v4 0/8] gpio: add DT support for generic memory-mapped GPIOs Christian Lamparter
2016-04-28  9:05 ` [RFC v4 1/8] gpio: generic: fix GPIO_GENERIC_PLATFORM is set to module case Christian Lamparter
2016-04-28  9:05 ` [RFC v4 2/8] gpio: rename gpio-generic.c into gpio-mmio.c Christian Lamparter
2016-04-29 14:14   ` Linus Walleij
2016-04-28  9:05 ` [RFC v4 3/8] gpio: generic: add DT support for generic memory-mapped GPIOs Christian Lamparter
2016-04-28  9:58   ` Andy Shevchenko
2016-04-28 23:39     ` Christian Lamparter
2016-04-28  9:05 ` [RFC v4 4/8] gpio: clps711x: integrate cirrus clps711x into gpio-mmio Christian Lamparter
2016-04-28  9:05 ` [RFC v4 5/8] gpio: ge: integrate GE's FPGA GPIO " Christian Lamparter
2016-04-28  9:05 ` [RFC v4 6/8] gpio: moxart: integrate MOXA ART GPIO driver " Christian Lamparter
2016-04-28  9:05 ` [RFC v4 7/8] gpio: ts4800: integrate TS4800 " Christian Lamparter
2016-04-28  9:05 ` Christian Lamparter [this message]

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=262d58824524c19917e6bf760da1c8ea2b6a616c.1461806071.git.chunkeey@googlemail.com \
    --to=chunkeey@googlemail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gnurou@gmail.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=noltari@gmail.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shc_work@mail.ru \
    /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

all inboxes | Powered by JetHome®