From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DAF62E88B3; Wed, 5 Nov 2025 13:26:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762349212; cv=none; b=Nnptg7VDLdONCuPIIm0tyBurCxsDZVR8pvZoe7dUSfikEIyNCI9EcrWRPsQk2m6ooVV9d8J5MxfPPuetJhATpo0WpvL1PoEcxMrcN0As6SGaHyUCGTLeg3+k8wQsGtmUvi1OZqcS8lvFug5/UffHcsDNifKGs7Y+J5cXCGANefc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762349212; c=relaxed/simple; bh=IHY6rytRQpqzPhB2aiYR+C+4jwVndLV36Pc4ex8HYhs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=d5PgJfz2gVt0UyXxUDuPkun1fBB+ZhMyjVbJD3+0tC8LqmZnNNthT6fmKHRlNiPJuiRCOd5O8PP5My2UrYmcsLXe9GEwLRbAAcMsBm4/1TC6AEDdrFg4LQImazkNP3wSAxYUYczlrC0KU/3z3k2E+yiTsuqdoNoVqdl90KRtIN4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=YL7Kibw+; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="YL7Kibw+" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 7F3481A18B5; Wed, 5 Nov 2025 13:26:46 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5483860693; Wed, 5 Nov 2025 13:26:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AFF1C102F1EE5; Wed, 5 Nov 2025 14:26:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762349205; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=uifLZp4U9pUGvLsbQU1oTJDlQ22nTkkVAsDheTV04iY=; b=YL7Kibw+BnpbXzqfm8VIkUr1qfC80eLiaXq695de/aSgs1/ct4ycRtw8ZL2nzEMDeFLvVo rZrlMevg47Q4XjUAIh/ljxfQPEGosNcd/0fPzsCdnauF4qw2pf6akyxrZUVcgVi9irKG3f l3KrgjWDHoQ/NEUVkiKaNS75pbaDeQFTqeAnUZAeiHV7g5y9+hOKuPJ3H4WklzINbyGr1w RvKwbVLUrv1HDNT9YLADSKW7TRt2cCHJLTmomXl0cy3JbRbk2GSUTgtbiDZkQqOOCAeWGN kKL90Q7U0snJqLEh0eiNYttF9q0j+wxzR0fju2ywQqAIml3NsnP2EpbPYjgXEw== Message-ID: Date: Wed, 5 Nov 2025 14:26:42 +0100 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/2] gpio: add gpio-line-mux driver To: Jonas Jelonek , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Rosin , Geert Uytterhoeven Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20251105103607.393353-1-jelonek.jonas@gmail.com> <20251105103607.393353-3-jelonek.jonas@gmail.com> Content-Language: en-US From: Thomas Richard In-Reply-To: <20251105103607.393353-3-jelonek.jonas@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 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 > --- > 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 Best Regards, Thomas