From: Thomas Richard <thomas.richard@bootlin.com>
To: Jonas Jelonek <jelonek.jonas@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Peter Rosin <peda@axentia.se>,
Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] gpio: add gpio-line-mux driver
Date: Wed, 5 Nov 2025 14:26:42 +0100 [thread overview]
Message-ID: <b3a4e2b3-f360-4dee-815b-cee3b9095074@bootlin.com> (raw)
In-Reply-To: <20251105103607.393353-3-jelonek.jonas@gmail.com>
On 11/5/25 11:36 AM, Jonas Jelonek wrote:
> Add a new driver which provides a 1-to-many mapping for a single real
> GPIO using a multiplexer. Each virtual GPIO corresponds to a multiplexer
> state which, if set for the multiplexer, connects the real GPIO to the
> corresponding virtual GPIO.
>
> This can help in various usecases. One practical case is the special
> hardware design of the Realtek-based XS1930-10 switch from Zyxel. It
> features two SFP+ ports/cages whose signals are wired directly to the
> switch SoC. Although Realtek SoCs are short on GPIOs, there are usually
> enough the fit the SFP signals without any hacks.
>
> However, Zyxel did some weird design and connected RX_LOS, MOD_ABS and
> TX_FAULT of one SFP cage onto a single GPIO line controlled by a
> multiplexer (the same for the other SFP cage). The single multiplexer
> controls the lines for both SFP and depending on the state, the
> designated 'signal GPIO lines' are connected to one of the three SFP
> signals.
>
> Because the SFP core/driver doesn't support multiplexer but needs single
> GPIOs for each of the signals, this driver fills the gap between both.
> It registers a gpio_chip, provides multiple virtual GPIOs and sets the
> backing multiplexer accordingly.
>
> Due to several practical issues, this is input-only and doesn't support
> IRQs.
>
> Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
> ---
> MAINTAINERS | 6 ++
> drivers/gpio/Kconfig | 9 +++
> drivers/gpio/Makefile | 1 +
> drivers/gpio/gpio-line-mux.c | 129 +++++++++++++++++++++++++++++++++++
> 4 files changed, 145 insertions(+)
> create mode 100644 drivers/gpio/gpio-line-mux.c
>
Reviewed-by: Thomas Richard <thomas.richard@bootlin.com>
Best Regards,
Thomas
prev parent reply other threads:[~2025-11-05 13:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 10:36 [PATCH v4 0/2] add gpio-line-mux Jonas Jelonek
2025-11-05 10:36 ` [PATCH v4 1/2] dt-bindings: gpio: add gpio-line-mux controller Jonas Jelonek
2025-11-05 10:36 ` [PATCH v4 2/2] gpio: add gpio-line-mux driver Jonas Jelonek
2025-11-05 13:15 ` Bartosz Golaszewski
2025-11-05 13:23 ` Jonas Jelonek
2025-11-05 13:24 ` Bartosz Golaszewski
2025-11-05 14:19 ` Peter Rosin
2025-11-05 14:37 ` Jonas Jelonek
2025-11-05 15:37 ` Bartosz Golaszewski
2025-11-05 15:49 ` Jonas Jelonek
2025-11-05 13:28 ` Jonas Jelonek
2025-11-05 13:26 ` Thomas Richard [this message]
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=b3a4e2b3-f360-4dee-815b-cee3b9095074@bootlin.com \
--to=thomas.richard@bootlin.com \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=jelonek.jonas@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peda@axentia.se \
--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;
as well as URLs for NNTP newsgroup(s).