Devicetree
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Antoniu Miclaus <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
Date: Fri, 21 Nov 2025 23:54:00 +0100	[thread overview]
Message-ID: <0bda62bf-c0f1-49c8-2f86-8128b5c92a0c@axentia.se> (raw)
In-Reply-To: <20251121115750.20119-1-antoniu.miclaus@analog.com>

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

  parent reply	other threads:[~2025-11-21 22:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 13:44   ` Rob Herring (Arm)
2025-11-21 18:25     ` Conor Dooley
2025-11-21 11:57 ` [PATCH 2/2] mux: gpio: add support for ADG1712 quad SPST switch Antoniu Miclaus
2025-11-21 14:30 ` [PATCH 0/2] " David Lechner
2025-11-21 22:54 ` Peter Rosin [this message]
2025-11-26 14:44   ` Miclaus, Antoniu

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=0bda62bf-c0f1-49c8-2f86-8128b5c92a0c@axentia.se \
    --to=peda@axentia.se \
    --cc=antoniu.miclaus@analog.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --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 \
    --cc=srini@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