[PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712

Antoniu Miclaus posted 2 patches 1 week, 3 days ago
[PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712
Posted by Antoniu Miclaus 1 week, 3 days ago
Add support for the Analog Devices ADG1712 quad SPST switch to the
existing GPIO multiplexer bindings. The ADG1712 contains four
independent single-pole/single-throw (SPST) switches, each controlled
by a dedicated GPIO pin.

Unlike traditional multiplexers that use GPIOs as binary-encoded
selectors, the ADG1712 treats each GPIO as a direct switch controller.
The mux state represents the combination of all four switches, with
values from 0-15 corresponding to different switch combinations.

For example, state 5 (binary 0101) represents:
- SW1: ON (GPIO0 = 1)
- SW2: OFF (GPIO1 = 0)
- SW3: ON (GPIO2 = 1)
- SW4: OFF (GPIO3 = 0)

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 .../devicetree/bindings/mux/gpio-mux.yaml     | 24 ++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mux/gpio-mux.yaml b/Documentation/devicetree/bindings/mux/gpio-mux.yaml
index ef7e33ec85d4..7c5784875683 100644
--- a/Documentation/devicetree/bindings/mux/gpio-mux.yaml
+++ b/Documentation/devicetree/bindings/mux/gpio-mux.yaml
@@ -17,9 +17,14 @@ description: |+
   multiplexer GPIO pins, where the first pin is the least significant
   bit. An active pin is a binary 1, an inactive pin is a binary 0.
 
+  For ADG1712, each GPIO directly controls one independent switch, and
+  the state represents the combination of all four switches (0-15).
+
 properties:
   compatible:
-    const: gpio-mux
+    enum:
+      - gpio-mux
+      - adi,adg1712
 
   mux-gpios:
     description:
@@ -100,4 +105,21 @@ examples:
             };
         };
     };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    // ADG1712 quad SPST switch controller
+    adg1712: switch-controller {
+        compatible = "adi,adg1712";
+        #mux-control-cells = <0>;
+
+        mux-gpios = <&gpio 10 GPIO_ACTIVE_HIGH>,
+                    <&gpio 11 GPIO_ACTIVE_HIGH>,
+                    <&gpio 12 GPIO_ACTIVE_HIGH>,
+                    <&gpio 13 GPIO_ACTIVE_HIGH>;
+
+        // Initial state: SW1=ON, SW2=OFF, SW3=ON, SW4=OFF (binary: 0101 = 5)
+        idle-state = <5>;
+    };
 ...
-- 
2.43.0
Re: [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712
Posted by Rob Herring (Arm) 1 week, 3 days ago
On Fri, 21 Nov 2025 11:57:31 +0000, Antoniu Miclaus wrote:
> Add support for the Analog Devices ADG1712 quad SPST switch to the
> existing GPIO multiplexer bindings. The ADG1712 contains four
> independent single-pole/single-throw (SPST) switches, each controlled
> by a dedicated GPIO pin.
> 
> Unlike traditional multiplexers that use GPIOs as binary-encoded
> selectors, the ADG1712 treats each GPIO as a direct switch controller.
> The mux state represents the combination of all four switches, with
> values from 0-15 corresponding to different switch combinations.
> 
> For example, state 5 (binary 0101) represents:
> - SW1: ON (GPIO0 = 1)
> - SW2: OFF (GPIO1 = 0)
> - SW3: ON (GPIO2 = 1)
> - SW4: OFF (GPIO3 = 0)
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
>  .../devicetree/bindings/mux/gpio-mux.yaml     | 24 ++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mux/gpio-mux.example.dtb: switch-controller (adi,adg1712): $nodename:0: 'switch-controller' does not match '^mux-controller(@.*|-([0-9]|[1-9][0-9]+))?$'
	from schema $id: http://devicetree.org/schemas/mux/mux-controller.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20251121115750.20119-2-antoniu.miclaus@analog.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712
Posted by Conor Dooley 1 week, 3 days ago
On Fri, Nov 21, 2025 at 07:44:57AM -0600, Rob Herring (Arm) wrote:
> 
> On Fri, 21 Nov 2025 11:57:31 +0000, Antoniu Miclaus wrote:
> > Add support for the Analog Devices ADG1712 quad SPST switch to the
> > existing GPIO multiplexer bindings. The ADG1712 contains four
> > independent single-pole/single-throw (SPST) switches, each controlled
> > by a dedicated GPIO pin.
> > 
> > Unlike traditional multiplexers that use GPIOs as binary-encoded
> > selectors, the ADG1712 treats each GPIO as a direct switch controller.
> > The mux state represents the combination of all four switches, with
> > values from 0-15 corresponding to different switch combinations.
> > 
> > For example, state 5 (binary 0101) represents:
> > - SW1: ON (GPIO0 = 1)
> > - SW2: OFF (GPIO1 = 0)
> > - SW3: ON (GPIO2 = 1)
> > - SW4: OFF (GPIO3 = 0)
> > 
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> > ---
> >  .../devicetree/bindings/mux/gpio-mux.yaml     | 24 ++++++++++++++++++-
> >  1 file changed, 23 insertions(+), 1 deletion(-)
> > 
> 
> My bot found errors running 'make dt_binding_check' on your patch:
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mux/gpio-mux.example.dtb: switch-controller (adi,adg1712): $nodename:0: 'switch-controller' does not match '^mux-controller(@.*|-([0-9]|[1-9][0-9]+))?$'
> 	from schema $id: http://devicetree.org/schemas/mux/mux-controller.yaml

There's a patch relaxing this restriction here:
https://lore.kernel.org/all/cb7c28ccf3a1b136e793b48720f816de7d5f75b2.1763737324.git.tommaso.merciai.xr@bp.renesas.com/

> 
> doc reference errors (make refcheckdocs):
> 
> See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20251121115750.20119-2-antoniu.miclaus@analog.com
> 
> The base for the series is generally the latest rc1. A different dependency
> should be noted in *this* patch.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit after running the above command yourself. Note
> that DT_SCHEMA_FILES can be set to your schema file to speed up checking
> your schema. However, it must be unset to test all examples with your schema.
>