* [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712
2025-11-21 11:57 [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST switch Antoniu Miclaus
@ 2025-11-21 11:57 ` Antoniu Miclaus
2025-11-21 13:44 ` Rob Herring (Arm)
2025-11-21 11:57 ` [PATCH 2/2] mux: gpio: add support for ADG1712 quad SPST switch Antoniu Miclaus
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Antoniu Miclaus @ 2025-11-21 11:57 UTC (permalink / raw)
To: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Linus Walleij, Bartosz Golaszewski, Srinivas Kandagatla,
Antoniu Miclaus, Johan Hovold, David Lechner, devicetree,
linux-kernel, linux-gpio
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
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712
2025-11-21 11:57 ` [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712 Antoniu Miclaus
@ 2025-11-21 13:44 ` Rob Herring (Arm)
2025-11-21 18:25 ` Conor Dooley
0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring (Arm) @ 2025-11-21 13:44 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Peter Rosin, Conor Dooley, Linus Walleij, linux-gpio,
Krzysztof Kozlowski, Srinivas Kandagatla, devicetree,
Johan Hovold, Bartosz Golaszewski, linux-kernel, David Lechner
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712
2025-11-21 13:44 ` Rob Herring (Arm)
@ 2025-11-21 18:25 ` Conor Dooley
0 siblings, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2025-11-21 18:25 UTC (permalink / raw)
To: Rob Herring (Arm)
Cc: Antoniu Miclaus, Peter Rosin, Conor Dooley, Linus Walleij,
linux-gpio, Krzysztof Kozlowski, Srinivas Kandagatla, devicetree,
Johan Hovold, Bartosz Golaszewski, linux-kernel, David Lechner
[-- Attachment #1: Type: text/plain, Size: 2410 bytes --]
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.
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mux: gpio: add support for ADG1712 quad SPST switch
2025-11-21 11:57 [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST switch Antoniu Miclaus
2025-11-21 11:57 ` [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712 Antoniu Miclaus
@ 2025-11-21 11:57 ` Antoniu Miclaus
2025-11-21 14:30 ` [PATCH 0/2] " David Lechner
2025-11-21 22:54 ` Peter Rosin
3 siblings, 0 replies; 8+ messages in thread
From: Antoniu Miclaus @ 2025-11-21 11:57 UTC (permalink / raw)
To: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Linus Walleij, Bartosz Golaszewski, Srinivas Kandagatla,
Antoniu Miclaus, Johan Hovold, David Lechner, devicetree,
linux-kernel, linux-gpio
Add support for the Analog Devices ADG1712 quad single-pole/
single-throw (SPST) switch to the existing GPIO multiplexer driver.
The existing gpio-mux driver architecture handles this properly.
The mux state (0-15) represents all possible combinations of the four
independent switches.
State mapping examples:
- State 0 (0000): All switches OFF
- State 5 (0101): SW1=ON, SW2=OFF, SW3=ON, SW4=OFF
- State 15 (1111): All switches ON
This integration allows ADG1712 to leverage the existing mux framework
for switch control while reusing all existing gpio-mux infrastructure
without any code changes beyond adding the compatible string.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/mux/gpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c
index 4cc3202c58f3..b363ad5a605b 100644
--- a/drivers/mux/gpio.c
+++ b/drivers/mux/gpio.c
@@ -40,6 +40,7 @@ static const struct mux_control_ops mux_gpio_ops = {
static const struct of_device_id mux_gpio_dt_ids[] = {
{ .compatible = "gpio-mux", },
+ { .compatible = "adi,adg1712", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mux_gpio_dt_ids);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST switch
2025-11-21 11:57 [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST switch Antoniu Miclaus
2025-11-21 11:57 ` [PATCH 1/2] dt-bindings: mux: gpio-mux: add support for ADG1712 Antoniu Miclaus
2025-11-21 11:57 ` [PATCH 2/2] mux: gpio: add support for ADG1712 quad SPST switch Antoniu Miclaus
@ 2025-11-21 14:30 ` David Lechner
2025-11-21 22:54 ` Peter Rosin
3 siblings, 0 replies; 8+ messages in thread
From: David Lechner @ 2025-11-21 14:30 UTC (permalink / raw)
To: Antoniu Miclaus, Peter Rosin, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Linus Walleij, Bartosz Golaszewski,
Srinivas Kandagatla, devicetree, linux-kernel, linux-gpio
On 11/21/25 5:57 AM, Antoniu Miclaus wrote:
> This series adds support for the Analog Devices ADG1712 quad single-pole/
> single-throw (SPST) switch to the existing GPIO multiplexer driver.
>
> The ADG1712 contains four independent 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.
>
> However, the existing gpio-mux driver architecture handles this perfectly
> by treating the mux state (0-15) as representing all possible combinations
> of the four independent switches. The existing mux_gpio_set() function uses
> gpiod_multi_set_value_cansleep() which treats the state as a bitmap,
> setting each GPIO according to the corresponding bit position.
>
> For example:
> - State 0 (0000): All switches OFF
> - State 5 (0101): SW1=ON, SW2=OFF, SW3=ON, SW4=OFF
> - State 15 (1111): All switches ON
>
> This approach allows the ADG1712 to leverage the existing mux framework
> for switch control while reusing all existing gpio-mux infrastructure
> without any code changes beyond adding the compatible string.
>
This doesn't sound like a mux at all. It sounds like a solid state
relay.
So it probably doesn't need bindings or a driver. You can just use
the gpio that controls it directly since the output will always
follow the gpio state. (And if the 65 ns delay is an issue, there
is "gpio-delay".)
Using a gpiod array gives the same convenience of being able to
use a value 0-15 to control the state of all 4 at the same time if
needed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST switch
2025-11-21 11:57 [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST switch Antoniu Miclaus
` (2 preceding siblings ...)
2025-11-21 14:30 ` [PATCH 0/2] " David Lechner
@ 2025-11-21 22:54 ` Peter Rosin
2025-11-26 14:44 ` Miclaus, Antoniu
3 siblings, 1 reply; 8+ messages in thread
From: Peter Rosin @ 2025-11-21 22:54 UTC (permalink / raw)
To: Antoniu Miclaus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Linus Walleij, Bartosz Golaszewski, Srinivas Kandagatla,
David Lechner, devicetree, linux-kernel, linux-gpio
Hi!
2025-11-21 at 12:57, Antoniu Miclaus wrote:
> [You don't often get email from antoniu.miclaus@analog.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> This series adds support for the Analog Devices ADG1712 quad single-pole/
> single-throw (SPST) switch to the existing GPIO multiplexer driver.
>
> The ADG1712 contains four independent 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.
>
> However, the existing gpio-mux driver architecture handles this perfectly
> by treating the mux state (0-15) as representing all possible combinations
> of the four independent switches. The existing mux_gpio_set() function uses
> gpiod_multi_set_value_cansleep() which treats the state as a bitmap,
> setting each GPIO according to the corresponding bit position.
>
> For example:
> - State 0 (0000): All switches OFF
> - State 5 (0101): SW1=ON, SW2=OFF, SW3=ON, SW4=OFF
> - State 15 (1111): All switches ON
>
> This approach allows the ADG1712 to leverage the existing mux framework
> for switch control while reusing all existing gpio-mux infrastructure
> without any code changes beyond adding the compatible string.
No, this is just wrong. If you were to treat the four SPST switches
as some kind of a edge case muxes, they would need to be represented
as four *independent* mux controllers. What you have done when you
tied the four gpios together like this would be appropriate for
a single SP16T mux. Which is not exactly what you have...
So, this series abuses the mux design and is therefore rejected.
Sorry.
Side note, representing the four switches as muxes works perfectly
w/o adding an explicit compatible. Just use four nodes compatible
with "gpio-mux" with a single gpio each. But of course, this foils
the synchronized update property, which I suspect is important, but
that's not a problem the mux subsystem can be expected to solve.
Cheers,
Peter
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST switch
2025-11-21 22:54 ` Peter Rosin
@ 2025-11-26 14:44 ` Miclaus, Antoniu
0 siblings, 0 replies; 8+ messages in thread
From: Miclaus, Antoniu @ 2025-11-26 14:44 UTC (permalink / raw)
To: Peter Rosin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Linus Walleij, Bartosz Golaszewski, Srinivas Kandagatla,
David Lechner, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Hi Peter,
> -----Original Message-----
> From: Peter Rosin <peda@axentia.se>
> Sent: Saturday, November 22, 2025 12:54 AM
> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>; 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>; Srinivas Kandagatla <srini@kernel.org>; David
> Lechner <dlechner@baylibre.com>; devicetree@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-gpio@vger.kernel.org
> Subject: Re: [PATCH 0/2] mux: gpio: add support for ADG1712 quad SPST
> switch
>
> [External]
>
> Hi!
>
> 2025-11-21 at 12:57, Antoniu Miclaus wrote:
> > [You don't often get email from antoniu.miclaus@analog.com. Learn why
> this is important at
> https://urldefense.com/v3/__https://aka.ms/LearnAboutSenderIdentificatio
> n__;!!A3Ni8CS0y2Y!496DlFUidna4Sqh1tbK2ZFR26RJOQIejUdeLkSt5BuIzZtJ4
> xlzAiFZGcByaa6NZLNbT4B2rkPxtCyNH_Vo$ ]
> >
> > This series adds support for the Analog Devices ADG1712 quad single-pole/
> > single-throw (SPST) switch to the existing GPIO multiplexer driver.
> >
> > The ADG1712 contains four independent 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.
> >
> > However, the existing gpio-mux driver architecture handles this perfectly
> > by treating the mux state (0-15) as representing all possible combinations
> > of the four independent switches. The existing mux_gpio_set() function uses
> > gpiod_multi_set_value_cansleep() which treats the state as a bitmap,
> > setting each GPIO according to the corresponding bit position.
> >
> > For example:
> > - State 0 (0000): All switches OFF
> > - State 5 (0101): SW1=ON, SW2=OFF, SW3=ON, SW4=OFF
> > - State 15 (1111): All switches ON
> >
> > This approach allows the ADG1712 to leverage the existing mux framework
> > for switch control while reusing all existing gpio-mux infrastructure
> > without any code changes beyond adding the compatible string.
>
> No, this is just wrong. If you were to treat the four SPST switches
> as some kind of a edge case muxes, they would need to be represented
> as four *independent* mux controllers. What you have done when you
> tied the four gpios together like this would be appropriate for
> a single SP16T mux. Which is not exactly what you have...
>
> So, this series abuses the mux design and is therefore rejected.
> Sorry.
>
> Side note, representing the four switches as muxes works perfectly
> w/o adding an explicit compatible. Just use four nodes compatible
> with "gpio-mux" with a single gpio each. But of course, this foils
> the synchronized update property, which I suspect is important, but
> that's not a problem the mux subsystem can be expected to solve.
>
Thanks for the explanation!
Would it still make sense to have an adi,adg1712.yaml binding,
(under /mux or /switch) even if it just documents the proper way
to use this chip (four separate gpio-mux nodes)?
I'm thinking from a user perspective - someone with an ADG1712
on their board will search for "adg1712" in the docs and find nothing.
A dedicated binding could just show the correct approach with a
working example for users.
Regards,
> Cheers,
> Peter
^ permalink raw reply [flat|nested] 8+ messages in thread