Devicetree
 help / color / mirror / Atom feed
From: Antoniu Miclaus <antoniu.miclaus@analog.com>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Antoniu Miclaus <antoniu.miclaus@analog.com>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>
Subject: [PATCH v3 1/2] dt-bindings: switch: adg1712: add adg1712 support
Date: Mon, 17 Nov 2025 09:13:22 +0000	[thread overview]
Message-ID: <20251117091427.3624-2-antoniu.miclaus@analog.com> (raw)
In-Reply-To: <20251117091427.3624-1-antoniu.miclaus@analog.com>

Add devicetree bindings for adg1712 SPST quad switch.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Changes in v3:
- Move bindings from gpio/ to switch/ subsystem
- Remove gpio-controller interface
- Add 'switch-states' property for initial configuration
- Update description and example
---
 .../bindings/switch/adi,adg1712.yaml          | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/switch/adi,adg1712.yaml

diff --git a/Documentation/devicetree/bindings/switch/adi,adg1712.yaml b/Documentation/devicetree/bindings/switch/adi,adg1712.yaml
new file mode 100644
index 000000000000..eed142eb5b05
--- /dev/null
+++ b/Documentation/devicetree/bindings/switch/adi,adg1712.yaml
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/switch/adi,adg1712.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADG1712 quad SPST switch controller
+
+maintainers:
+  - Antoniu Miclaus <antoniu.miclaus@analog.com>
+
+description: |
+  Bindings for Analog Devices ADG1712 quad single-pole, single-throw (SPST)
+  switch controlled by GPIOs. The device features four independent switches,
+  each controlled by a dedicated GPIO input pin.
+
+  The switches are configured at probe time based on device tree properties
+  and cannot be changed from userspace after initialization.
+
+properties:
+  compatible:
+    const: adi,adg1712
+
+  switch-gpios:
+    description: |
+      Array of GPIOs connected to the IN1-IN4 control pins.
+      Index 0 corresponds to IN1 (controls SW1),
+      Index 1 corresponds to IN2 (controls SW2),
+      Index 2 corresponds to IN3 (controls SW3),
+      Index 3 corresponds to IN4 (controls SW4).
+    minItems: 4
+    maxItems: 4
+
+  switch-states:
+    description: |
+      Initial states for the four switches (SW1-SW4).
+      Each element corresponds to the desired state of the respective switch:
+      0 = switch disabled (open), 1 = switch enabled (closed).
+      If not specified, all switches default to disabled (0).
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    items:
+      minimum: 0
+      maximum: 1
+    minItems: 4
+    maxItems: 4
+
+required:
+  - compatible
+  - switch-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    adg1712: switch-controller {
+        compatible = "adi,adg1712";
+
+        switch-gpios = <&gpio 10 GPIO_ACTIVE_HIGH>,
+                       <&gpio 11 GPIO_ACTIVE_HIGH>,
+                       <&gpio 12 GPIO_ACTIVE_HIGH>,
+                       <&gpio 13 GPIO_ACTIVE_HIGH>;
+
+        /* Enable SW1 and SW3, disable SW2 and SW4 */
+        switch-states = <1 0 1 0>;
+    };
+...
-- 
2.43.0


  reply	other threads:[~2025-11-17  9:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17  9:13 [PATCH v3 0/2] Add ADG1712 SPST switch controller support Antoniu Miclaus
2025-11-17  9:13 ` Antoniu Miclaus [this message]
2025-11-19 13:45   ` [PATCH v3 1/2] dt-bindings: switch: adg1712: add adg1712 support Linus Walleij
2025-11-19 17:56   ` Conor Dooley
2025-11-19 21:22     ` Linus Walleij
2025-11-20  0:31       ` Conor Dooley
2025-11-20 23:19         ` Linus Walleij
2025-11-17  9:13 ` [PATCH v3 2/2] gpio: adg1712: add driver support Antoniu Miclaus
2025-11-17 14:46   ` Bartosz Golaszewski
2025-11-19 13:59   ` Linus Walleij
2025-11-17 15:06 ` [PATCH v3 0/2] Add ADG1712 SPST switch controller support Nuno Sá

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=20251117091427.3624-2-antoniu.miclaus@analog.com \
    --to=antoniu.miclaus@analog.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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