From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) (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 744F2380FCE for ; Wed, 8 Jul 2026 14:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=130.236.254.3 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783519728; cv=none; b=VnEOpm3F4IIgSdaaDa8IMitmLc6SMTxD44GBT1Xz6WpSfTi8AVHO4yCseH19li84FrzkfAaV3QRpJ3E4jIQg0QMvtzZzxAo+RMsowqG2u2fY9eW1SRj9CMQ/NXEY0UyDooeRabRxhVBi9uyDtIbLXe5AScgFiFuvm9uMWvIUk5s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783519728; c=relaxed/simple; bh=7uY8CDFW1l8dlRLoKV7cnRCMIXHEROkr3AaueRLRVII=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Q06Y5AQHzTGpK69+sSg+R1HHdX/2Q1X3xmr4yu6ArY0cYXlZt2NZvhEKV6YN9+g4zOtpaW6h6Zg/U2YFzhoTrB6QSvUOgZePXhlbfCqu0yf0cIA9f1XY5WQ5EKY5io5y1Zgd1s6Fe6RGqnLtQ4TDhr1EgMTbjiwPngW7zSxeRPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lysator.liu.se; spf=pass smtp.mailfrom=lysator.liu.se; dkim=pass (2048-bit key) header.d=lysator.liu.se header.i=@lysator.liu.se header.b=gjDzAVdN; dkim=pass (2048-bit key) header.d=lysator.liu.se header.i=@lysator.liu.se header.b=NdsOLN6a; dkim=pass (2048-bit key) header.d=lysator.liu.se header.i=@lysator.liu.se header.b=GAJt69Ab; arc=none smtp.client-ip=130.236.254.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lysator.liu.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lysator.liu.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lysator.liu.se header.i=@lysator.liu.se header.b="gjDzAVdN"; dkim=pass (2048-bit key) header.d=lysator.liu.se header.i=@lysator.liu.se header.b="NdsOLN6a"; dkim=pass (2048-bit key) header.d=lysator.liu.se header.i=@lysator.liu.se header.b="GAJt69Ab" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lysator.liu.se; s=2026; t=1783519723; bh=7uY8CDFW1l8dlRLoKV7cnRCMIXHEROkr3AaueRLRVII=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gjDzAVdN0W2ePZtZbregQ/TwFbRpFYfTFc28446yrFHhoFE6Id2TGqRNvXRIBkJEg XrLb9yrONjz3nROjljRJN8E1GDtbcik9OZkk+1QVDcgLPAJSjTcdr1NEQocbyL46Z2 nzudpbB5ZJeygCOcfbZ04DzinERilU+XXolGM3jKMjKA/p98uaQ5O2PQ8Bzw4H9yFP DY0MnesmrV4dJQt81e2qr/XEkmgXPfAZUud5l9ytH1cPdzv3+YN05vj/wibntHuhI8 xepbaBVxTVATeUhohRI32a+klqtEHjxtp8mRDPQ/1togx1U5jqj0KAwXoH2+rzKnKx QaVgvOFIPOPfQ== Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id EF58C111E9 for ; Wed, 8 Jul 2026 16:08:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lysator.liu.se; s=2026; t=1783519722; bh=7uY8CDFW1l8dlRLoKV7cnRCMIXHEROkr3AaueRLRVII=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=NdsOLN6aveYqCLIw0+gimrXIi493id4CFhPLjaIQcE0S1MCdW5sdRKuvtopAV12SY Bw6KsVRtazk8v8wJltAOgMbDxU21QySymCdFlh8AO9a8Uz2ya8lRq5VnGoiwm5TOdG C7Wt4IvTD9KOHyH+NE9Hw1dM2+/nYLO87ZbjjIsZE4ypZysfAX8BnvYJicoXTeyWUQ WFA5PIeV1MqPJU5f9vwtn+61Q2uFUYPcA5JOoA7FBgk9gmyc0nqOIFYA7rFXSN/Wos 8Na961soYBli0xQPGJTfPdGwwjtP7ynQQP6z6+/Bjj2AUZOh0gOSEwOQITsuktj6lR DJAQFJndvVVPw== Received: by mail.lysator.liu.se (Postfix, from userid 1004) id D4889112A0; Wed, 8 Jul 2026 16:08:42 +0200 (CEST) X-Spam-Level: X-Spam-Score: -1.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lysator.liu.se; s=2026; t=1783519720; bh=7uY8CDFW1l8dlRLoKV7cnRCMIXHEROkr3AaueRLRVII=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GAJt69AbIUSD1rjU9jPeslLZafV7E422zAVkAr/U11WLh68IaFc46ueuhF0dIZXDT 0zDfJnpk/9qeYMJjoBj0iWdUvHbgtXAJR50s3f62+dROYIq/+hsc9BmVD5fL+z4X6O qlJIfl36TDgastOGn9/9Vg1uRjnvD36MhmEXFBDTKb/X5HUq2JHoNNI9to0vhslf3t UIYsagOs6Yndg7vetz1BSvpvJVOlNCE5OkBvzAMJBK2hMYwXwf9Akq2ESHZXj66/3c oP9+lvbsh03nuyx4ipBZ62Shu+6ntyMDxWJP2bV9v1fcAMj3Mu01fLKGEP1uyDfVKH 983rUwyMQfvTw== Received: from [192.168.2.172] (81-225-28-11-no2391.tbcn.telia.com [81.225.28.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id EC862111E7; Wed, 8 Jul 2026 16:08:39 +0200 (CEST) Message-ID: Date: Wed, 8 Jul 2026 16:08:39 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] mux: gpio-mux: add support for 4:1 2-channels mux To: Andrea Tomassetti , linusw@kernel.org Cc: johan+linaro@kernel.org, krzk@kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org References: <20260506123350.310564-1-andrea.tomassetti@sipearl.com> Content-Language: en-US, sv-SE From: Peter Rosin In-Reply-To: <20260506123350.310564-1-andrea.tomassetti@sipearl.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 > Reviewed-by: Linus Walleij 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