[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251009223501.570949-2-jelonek.jonas@gmail.com>
Date: Thu, 9 Oct 2025 22:35:00 +0000
From: Jonas Jelonek <jelonek.jonas@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: linux-gpio@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jonas Jelonek <jelonek.jonas@...il.com>
Subject: [RFC PATCH v1 1/2] dt-bindings: gpio: add gpio-split controller
Add dt-schema for a virtual gpio-split controller which exposes virtual
GPIOs for a shared GPIO controlled by a multiplexer, e.g. a gpio-mux.
The gpio-split controller is a gpio-controller, thus has mostly the same
semantics. However, it requires a mux-control to be specified upon which
it will operate.
Signed-off-by: Jonas Jelonek <jelonek.jonas@...il.com>
---
.../devicetree/bindings/gpio/gpio-split.yaml | 77 +++++++++++++++++++
1 file changed, 77 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-split.yaml
diff --git a/Documentation/devicetree/bindings/gpio/gpio-split.yaml b/Documentation/devicetree/bindings/gpio/gpio-split.yaml
new file mode 100644
index 000000000000..9a58c81da4fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-split.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/gpio-split.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GPIO split
+
+maintainers:
+ - Jonas Jelonek <jelonek.jonas@...il.com>
+
+description:
+ A virtual GPIO controller to provide virtual GPIOs backed by a single real
+ GPIO and a multiplexer. This controller may be used in case a real GPIO is
+ connected to multiple inputs/outputs and controlled by a multiplexer, and
+ another subsystem/driver is not able to work with multiplexer subsystem.
+
+properties:
+ compatible:
+ const: gpio-split
+
+ gpio-controller: true
+
+ "#gpio-cells":
+ const: 2
+
+ gpio-line-names: true
+
+ mux-controls:
+ maxItems: 1
+
+ ngpios: false
+
+ shared-gpio:
+ description:
+ GPIO that is shared by the virtual GPIOs and controlled via the mux.
+
+required:
+ - compatible
+ - gpio-controller
+ - mux-controls
+ - shared-gpio
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/mux/mux.h>
+
+ sfp_gpio_mux: gpio-mux {
+ compatible = "gpio-mux";
+ mux-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>,
+ <&gpio0 14 GPIO_ACTIVE_HIGH>;
+ #mux-control-cells = <0>;
+ idle-state = <MUX_IDLE_AS_IS>;
+ };
+
+ sfp1_gpio: sfp-gpio-1 {
+ compatible = "gpio-split";
+ gpio-controller;
+ #gpio-cells = <2>;
+
+ mux-controls = <&sfp_gpio_mux>;
+ shared-gpio = <&gpio0 19 GPIO_ACTIVE_HIGH>;
+
+ gpio-line-names = "SFP1_LOS", "SFP1_MOD_ABS", "SFP1_TX_FAULT";
+ gpio-0 {
+ mux-state = <0>;
+ };
+ gpio-1 {
+ mux-state = <1>;
+ };
+ gpio-2 {
+ mux-state = <3>;
+ };
+ };
--
2.48.1
Powered by blists - more mailing lists