public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hilliard <james.hilliard1@gmail.com>
To: linux-gpio@vger.kernel.org
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] dt-bindings: gpio: document gpio-line usage
Date: Fri, 13 Feb 2026 15:32:02 -0700	[thread overview]
Message-ID: <20260213223204.2415507-2-james.hilliard1@gmail.com> (raw)
In-Reply-To: <20260213223204.2415507-1-james.hilliard1@gmail.com>

Document gpio-line child nodes for GPIO controller initialization
without line hogging.

Describe gpio-line-name semantics for both gpio-line nodes and gpio-hog
nodes, and update examples accordingly.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 .../devicetree/bindings/gpio/gpio.txt         | 47 ++++++++++++++-----
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
index b37dbb1edc62..cf591954eafd 100644
--- a/Documentation/devicetree/bindings/gpio/gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio.txt
@@ -199,28 +199,41 @@ gpio-controller@00000000 {
 		"poweroff", "reset";
 }
 
-The GPIO chip may contain GPIO hog definitions. GPIO hogging is a mechanism
-providing automatic GPIO request and configuration as part of the
-gpio-controller's driver probe function.
+The GPIO chip may contain child nodes used for line setup at probe time:
+- gpio-hog: reserves the GPIO line as a hog and configures it.
+- gpio-line: configures the GPIO line without reserving it as a hog.
 
-Each GPIO hog definition is represented as a child node of the GPIO controller.
-Required properties:
-- gpio-hog:   A property specifying that this child node represents a GPIO hog.
+Common properties for gpio-hog and gpio-line child nodes:
 - gpios:      Store the GPIO information (id, flags, ...) for each GPIO to
 	      affect. Shall contain an integer multiple of the number of cells
 	      specified in its parent node (GPIO controller node).
-Only one of the following properties scanned in the order shown below.
-This means that when multiple properties are present they will be searched
-in the order presented below and the first match is taken as the intended
-configuration.
 - input:      A property specifying to set the GPIO direction as input.
 - output-low  A property specifying to set the GPIO direction as output with
 	      the value low.
 - output-high A property specifying to set the GPIO direction as output with
 	      the value high.
-
-Optional properties:
-- line-name:  The GPIO label name. If not present the node name is used.
+	      When multiple line-state properties are present they are scanned
+	      in the order shown above and the first match is used.
+- gpio-line-name:
+	      Optional GPIO line name for the configured line.
+	      When present, it sets the line name for that line and overrides
+	      any existing name, including names assigned by the controller's
+	      "gpio-line-names". If not present, any existing name is left
+	      unchanged.
+
+gpio-hog specific properties:
+- gpio-hog:   A property specifying that this child node represents a GPIO hog.
+- line-name:  Consumer label used when requesting the hogged GPIO.
+	      If not present the node name is used.
+	      This is independent from "gpio-line-name".
+At least one line-state property ("input", "output-low", or "output-high")
+must be present for gpio-hog.
+
+gpio-line specific properties:
+- gpio-line:  A property specifying that this child node represents GPIO lines
+	      to configure without hogging.
+Line-state properties are optional for gpio-line.
+When no line-state property is present, the line direction/value is left as-is.
 
 Example of two SOC GPIO banks defined as gpio-controller nodes:
 
@@ -235,6 +248,14 @@ Example of two SOC GPIO banks defined as gpio-controller nodes:
 			gpios = <6 0>;
 			output-low;
 			line-name = "foo-bar-gpio";
+			gpio-line-name = "foo-bar-line";
+		};
+
+		line_c-init {
+			gpio-line;
+			gpios = <7 0>;
+			output-high;
+			gpio-line-name = "foo-baz-gpio";
 		};
 	};
 
-- 
2.43.0


  reply	other threads:[~2026-02-13 22:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13 22:32 [PATCH 1/2] gpiolib: of: add gpio-line node support James Hilliard
2026-02-13 22:32 ` James Hilliard [this message]
2026-02-14  9:07   ` [PATCH 2/2] dt-bindings: gpio: document gpio-line usage Krzysztof Kozlowski
2026-02-14 20:45     ` James Hilliard
2026-02-14 20:53       ` Krzysztof Kozlowski
2026-02-14  9:08 ` [PATCH 1/2] gpiolib: of: add gpio-line node support Krzysztof Kozlowski

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=20260213223204.2415507-2-james.hilliard1@gmail.com \
    --to=james.hilliard1@gmail.com \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@kernel.org \
    /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