From: Peter Rosin <peda@lysator.liu.se>
To: Andrea Tomassetti <andrea.tomassetti@sipearl.com>, linusw@kernel.org
Cc: johan+linaro@kernel.org, krzk@kernel.org,
linux-kernel@vger.kernel.org, srini@kernel.org
Subject: Re: [PATCH v2] mux: gpio-mux: add support for 4:1 2-channels mux
Date: Wed, 8 Jul 2026 16:08:39 +0200 [thread overview]
Message-ID: <abdfb2eb-e632-427d-9d93-da379f7cf270@lysator.liu.se> (raw)
In-Reply-To: <20260506123350.310564-1-andrea.tomassetti@sipearl.com>
On 2026-05-06 14:33, Andrea Tomassetti wrote:
> Some gpio multiplexers, like TMUX1209, offer differential 4:1
> or dual 4:1 single-ended channels. No binding changes are needed
> because the DT binding already supports #mux-control-cells
> with values 0 and 1. So, similarly to what was already done by the
> adg792a driver, the gpio-mux driver has to take into account
> the #mux-control-cells property and allocate as many controllers as
> advised by it.
>
> As an example, in the DTS you can now define:
>
> tmux1209: mux-controller {
> compatible = "gpio-mux";
> #mux-control-cells = <1>;
>
> mux-gpios = <&gpio_expander 01 GPIO_ACTIVE_HIGH>,
> <&gpio_expander 02 GPIO_ACTIVE_HIGH>;
> };
>
> And use it like this:
>
> adcmux30: adcmux30 {
> compatible = "io-channel-mux";
> io-channels = <&adc1 4>;
> io-channel-names = "parent";
> #io-channel-cells = <1>;
> mux-controls = <&tmux1209 0>;
>
> channels = "S1A", "S2A", "S3A", "S4A";
> };
>
> adcmux31: adcmux31 {
> compatible = "io-channel-mux";
> io-channels = <&adc1 5>;
> io-channel-names = "parent";
> #io-channel-cells = <1>;
> mux-controls = <&tmux1209 1>;
>
> channels = "S1B", "S2B", "S3B", "S4B";
> };
>
> Signed-off-by: Andrea Tomassetti <andrea.tomassetti@sipearl.com>
> Reviewed-by: Linus Walleij <linusw@kernel.org>
Hi!
Sorry for the extremely late reply.
This patch is not needed and makes no sense at all. You should be
able to describe the hardware like below instead. I.e., no need for
an extra controller. The mux subsystem handles multiple clients to
the same mux controller as mux controllers are always shared.
tmux1209: mux-controller {
compatible = "gpio-mux";
#mux-control-cells = <0>;
mux-gpios = <&gpio_expander 01 GPIO_ACTIVE_HIGH>,
<&gpio_expander 02 GPIO_ACTIVE_HIGH>;
};
adcmux30: adcmux30 {
compatible = "io-channel-mux";
io-channels = <&adc1 4>;
io-channel-names = "parent";
#io-channel-cells = <1>;
mux-controls = <&tmux1209>;
channels = "S1A", "S2A", "S3A", "S4A";
};
adcmux31: adcmux31 {
compatible = "io-channel-mux";
io-channels = <&adc1 5>;
io-channel-names = "parent";
#io-channel-cells = <1>;
mux-controls = <&tmux1209>;
channels = "S1B", "S2B", "S3B", "S4B";
};
An extra controller would have been needed if it was different
gpios for mux A and B. But it's not. You cannot change mux A
without affecting mux B, so the mux controller absolutely must be
shared between A and B.
I hope that helps.
Cheers,
Peter
next prev parent reply other threads:[~2026-07-08 14:08 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 14:11 [PATCH RESEND] " Andrea Tomassetti
2026-05-05 8:23 ` Linus Walleij
2026-05-05 15:20 ` Andrea Tomassetti
2026-05-06 7:58 ` Linus Walleij
2026-05-06 12:33 ` [PATCH v2] " Andrea Tomassetti
2026-06-03 11:43 ` Andrea Tomassetti
2026-06-03 14:00 ` Krzysztof Kozlowski
2026-06-08 22:54 ` Linus Walleij
2026-06-17 13:09 ` Tommaso Merciai
2026-06-18 13:04 ` Linus Walleij
2026-06-18 13:27 ` Tommaso Merciai
2026-06-19 3:51 ` Krzysztof Kozlowski
2026-06-23 16:44 ` Tommaso Merciai
2026-06-24 8:59 ` Geert Uytterhoeven
2026-06-24 9:59 ` Krzysztof Kozlowski
2026-06-24 9:55 ` Krzysztof Kozlowski
2026-06-24 22:03 ` Linus Walleij
2026-06-24 22:11 ` Linus Walleij
2026-06-25 9:19 ` Nuno Sá
2026-06-29 19:27 ` Linus Walleij
2026-07-03 7:32 ` Michael Hennerich
2026-07-03 10:02 ` Miclaus, Antoniu
2026-07-03 13:19 ` Alvin Šipraga
2026-07-03 13:45 ` Lad, Prabhakar
2026-06-19 17:23 ` Srinivas Kandagatla
2026-06-30 15:08 ` Andrea Tomassetti
2026-07-03 8:10 ` Srinivas Kandagatla
2026-07-08 14:08 ` Peter Rosin [this message]
2026-06-25 9:32 Lad, Prabhakar
2026-06-25 9:43 ` Krzysztof Kozlowski
2026-06-25 9:49 ` Greg Kroah-Hartman
2026-06-25 9:59 ` Lad, Prabhakar
2026-06-29 19:24 ` Linus Walleij
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=abdfb2eb-e632-427d-9d93-da379f7cf270@lysator.liu.se \
--to=peda@lysator.liu.se \
--cc=andrea.tomassetti@sipearl.com \
--cc=johan+linaro@kernel.org \
--cc=krzk@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.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