From nobody Sat Feb 7 07:25:58 2026 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 7EDCD330D26; Fri, 23 Jan 2026 14:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180342; cv=none; b=Zg1VfIWBgVZm8MU2WEOYAeZPx2uCRlRMmNhEOApArh85PauZjJpWigILlTYWtuXJqZBbXkS9S6TW1VSW2OVQptdkZ+0xl4MaOQH2GY8CCFpsV5N8bE5yzsVBvSOHif8slD8u3s0HeIOQ21kmDrCKvoVKmrDpbR45oOzJV0Cb+fM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180342; c=relaxed/simple; bh=XXL182o8si66jMP0KiYp7YMRne1IJKyXxEet/d5l6wg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VeNsvHxmxSvsxvTt6NAtTUW/tenTpmVIChoUCspWcs9Rcpb/tpa6l4qwlzbxINBrwoX7r6L1Wps08isI52/WP5p7qtQagzkGnLAI5CzMouTNZ22VJSsrQMiRM/iPCN+Oa4WYVtaYB0gqoMPK9zPpE4+sMd9zNgH81BVZGa9tHLA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=t35ajPmc; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="t35ajPmc" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60NANemq691146; Fri, 23 Jan 2026 09:58:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=AfOz1 qDK9Y1mLSTHkh8KRvWrNVppfCcFHPuCKhpk2YQ=; b=t35ajPmcctBDSIBuHLMNJ /dgR2lx278wdUOQZIoP+7un6Ib15YqEtS+hJIm0tHiQqJXhYML3OG9c5CTTN6T2x ujrOHFJ24M16HPRv3MYbS1u5BDtInqtCNEby+Dlwk+ilEuRDHkUn/7coPCU8xpOO +uCIitJAIOOVsedRMRUxBXV5mK3oBGcWD23mougq7fc2Fu9W0WNnnpp5kT1QPSKH 4jnD83rqCHurHwZB+qNwZ632yIkxxs4S3VhHrpYCwJ6+iV3nJeGYn0HHdkaoO9Nv Ge9zKtaBZKYRdqa9rsv9lo/Wxb8IZsBQIGWHaxLgNVdvU2VFsP/ETjBZDOf2k2iK Q== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 4bv76ssa7f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jan 2026 09:58:45 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 60NEwiME028311 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Jan 2026 09:58:44 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 23 Jan 2026 09:58:44 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Fri, 23 Jan 2026 09:58:44 -0500 Received: from HYB-b1tGeUj4GP1.ad.analog.com (HYB-b1tGeUj4GP1.ad.analog.com [10.48.65.212]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 60NEwLVb012602; Fri, 23 Jan 2026 09:58:38 -0500 From: Antoniu Miclaus To: Peter Rosin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Antoniu Miclaus , Srinivas Kandagatla , Bartosz Golaszewski , Johan Hovold , David Lechner , , Subject: [PATCH v5 1/2] dt-bindings: mux: gpio-mux: add enable-gpios support Date: Fri, 23 Jan 2026 16:57:31 +0200 Message-ID: <20260123145743.75705-2-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260123145743.75705-1-antoniu.miclaus@analog.com> References: <20260123145743.75705-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: g9jFSNTvTkrQU0m_bER8PiMIaaAWs9Xb X-Proofpoint-GUID: g9jFSNTvTkrQU0m_bER8PiMIaaAWs9Xb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTIzMDExNyBTYWx0ZWRfXwNJBQk95d9/B L/Iy5w0cJ1FrIIE2oeUQLm/j9L8WzIMN7xFXBpzxbC1SXQbPMIHm0tZ097/a58YsRwKpeisD/yq 2SmCCJ6zk6R1rD2SQ8FqILGnE1udQnMGwIrsLmXXuEHctPJafCypHFWZeCes4tImTsQs2u3c/jH gw8IVvtWAf7jOluX4rfDx8ay+Pf3bHp92l6GUCSAE40iuDDTTolA5KuwXPoL5GaiuBGdVIhEV81 6j4OZwfLePGZYlHDZdOs0TOYWaWENFohShjxQ4UBNgUWoDa5TeTmgf/JXQt+MyO2op8CfNVHRSp dW2A1AnAed1AYvlvjZ8EEoS8qiPq8OAmTJItEZfscybZjtJ4SRakBKfcS7mv4hqNTW2byOUXO+h txVCUCQNYfh5DGHF2HOl3nUY95fqOcDJjq0tIe0Nnsi8CZFbPrjkmIl8iLag0a+hZU1IJ7lx6B7 45M7sgFg0aAZvWNGfsw== X-Authority-Analysis: v=2.4 cv=J/CnLQnS c=1 sm=1 tr=0 ts=69738ca5 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gAnH3GRIAAAA:8 a=Hkm-oAngvxE-1qugaQYA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-23_02,2026-01-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 spamscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601230117 Content-Type: text/plain; charset="utf-8" Add support for an optional enable GPIO that allows the multiplexer to be disabled before changing address lines and re-enabled after, preventing glitches during channel transitions. This is useful for devices like the Analog Devices ADG2404 (4:1 mux) that benefit from enable control to ensure clean channel switching. Signed-off-by: Antoniu Miclaus Acked-by: Conor Dooley --- Changes in v5: - Expand enable-gpios description to explain high-impedance (high-Z) behavior when mux is disabled - Describe analog multiplexer use case where downstream capacitance maintains signal level during brief disconnection - Remove separate ADG2404 example, add enable-gpios to existing example --- .../devicetree/bindings/mux/gpio-mux.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/mux/gpio-mux.yaml b/Document= ation/devicetree/bindings/mux/gpio-mux.yaml index ef7e33ec85d4..798e0a73d77b 100644 --- a/Documentation/devicetree/bindings/mux/gpio-mux.yaml +++ b/Documentation/devicetree/bindings/mux/gpio-mux.yaml @@ -17,6 +17,9 @@ description: |+ multiplexer GPIO pins, where the first pin is the least significant bit. An active pin is a binary 1, an inactive pin is a binary 0. =20 + This binding supports GPIO-controlled multiplexers such as the Analog + Devices ADG2404 (4:1 mux with enable control). + properties: compatible: const: gpio-mux @@ -25,6 +28,18 @@ properties: description: List of gpios used to control the multiplexer, least significant bit= first. =20 + enable-gpios: + description: | + Optional GPIO to enable the multiplexer. When present, the mux is + disabled before changing address lines and re-enabled after. This + prevents glitches where an unintended channel could be briefly activ= ated + during address line transitions. When disabled, all outputs enter a + high-impedance (high-Z) state rather than holding their previous val= ue. + This is suitable for analog multiplexers where downstream capacitance + maintains the signal level during the brief disconnection. + Required for MUX_IDLE_DISCONNECT idle-state. + maxItems: 1 + mux-supply: description: Regulator to power on the multiplexer. @@ -59,6 +74,7 @@ examples: =20 mux-gpios =3D <&pioA 0 GPIO_ACTIVE_HIGH>, <&pioA 1 GPIO_ACTIVE_HIGH>; + enable-gpios =3D <&pioA 2 GPIO_ACTIVE_HIGH>; }; =20 adc-mux { --=20 2.43.0 From nobody Sat Feb 7 07:25:58 2026 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 5DF1232C92A; Fri, 23 Jan 2026 14:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180344; cv=none; b=AtIyGp8AK/O83N81ieql9gSmUS8HVnvLw+ZwtKLUHEy6S6MLoAIOHnY5O7GGz9nmXUqghZPsAI4U7q2I0os5hxuns6o0UoBPwk+O+gFjm8Gk7JsPazkfHkmAlfYrlG0ARarDcBjNjG+NWYXB1bK+KbMs8lreSgHtau8sYicDV9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180344; c=relaxed/simple; bh=xE7n0qOoFfL7nDYSiS33i5d1sPOYKyXf0hnnzdD+IrI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ey7CG4DrHOR/t3FHgIuzrr/Kcyoq6RTmqrxBXblqaOfOv7rmukoE++QrcZzoZMAAJcVei/h1BWwLPRVqvWbMUnK6fpnA8dk9WMofGJXHZ1hGi8dbGE5i94C0RqyaI0v7dOeDvwoYn7R5lFNnD7g/iy5qyv9cVX1ia5gEFUOMI+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=nOV5FBc4; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="nOV5FBc4" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60NANemu691146; Fri, 23 Jan 2026 09:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=pyUcR feX+Zouoxl7wZdsN6kx/KtiN11FSLKiLhSeiBE=; b=nOV5FBc42/z3pk+OCE9xb ZUzA/6cg2i+9rH3DwQ/igwsHn/ofVBBztY3Tl1BsnZoT4c2enBiuF90ChyykSS5T c3LfXPHSt2pjAtrzYPjhP9AM2jmyI8QKW492t2El1kBb/Al8MOjkhET/omjtPfpj Q6EN/dvNSBlut6gavOZtEfHVEZ/yHgAof2yakLOpC3YcNPP/iopR0YNUOMTVDefm 62YndHzBnOW05cQDCMbGKf9QeCe5pZl+WyoD5jKNi0738JgD7CccjBDPikiQt1wr lErBHkpVBNhw8XHt8/kParxGyLzyXjTu0Da698r6nr4kqlBQyJ3F0z/rptPF+B0Y Q== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 4bv76ssa7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jan 2026 09:58:47 -0500 (EST) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 60NEwkWO028328 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Jan 2026 09:58:46 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 23 Jan 2026 09:58:46 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Fri, 23 Jan 2026 09:58:46 -0500 Received: from HYB-b1tGeUj4GP1.ad.analog.com (HYB-b1tGeUj4GP1.ad.analog.com [10.48.65.212]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 60NEwLVc012602; Fri, 23 Jan 2026 09:58:42 -0500 From: Antoniu Miclaus To: Peter Rosin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Antoniu Miclaus , Srinivas Kandagatla , Bartosz Golaszewski , Johan Hovold , Linus Walleij , David Lechner , , Subject: [PATCH v5 2/2] mux: gpio-mux: add support for enable GPIO Date: Fri, 23 Jan 2026 16:57:32 +0200 Message-ID: <20260123145743.75705-3-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260123145743.75705-1-antoniu.miclaus@analog.com> References: <20260123145743.75705-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: hW8MhPup2KNdZYk2vVH3JceqowppJiMn X-Proofpoint-GUID: hW8MhPup2KNdZYk2vVH3JceqowppJiMn X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTIzMDExOCBTYWx0ZWRfX2N7Ys8hgb2lY xhv/aIeKoEYNuHSsHOkMzSCYrYZH0dUCk+p+BsU/DkkQEPHhtlInMjuXiIdK3C9kT8os7Q5BnsS H9KGSSxndIZ0jod0xJbRAkVARnfAq0fz8SPQYYAMwYuyJXOhmiEmitx2SWXdbejZiJTMTjlKjdY QrvTTQCFxMjRe6ro1T6YXVe+ACHzangFa8OIZYWiL7xi5C9Vj62l/9hsP4EgiHh8150i+5MUika 1JIBbIqTkx9q+L99DMa3hu0RfDEOcpsZ0mtHEy+quYNajvRJtNk6IFfnHhbdNWfKka2SHtZZ3pW 5EahXPdjJOwzayiRae7uS3m905X7b/j6LosxgMyG11WuhA4Pq81umXJeqJXtcXclhiXcH7au6MR ampAVjebRSux8CZ+8OYZwq8YjcwJxn5ZN+BndV56n/eR8/sZW0y/jrlL2CrOdGEWhrKxYS0T61Y bo6aHpzk/tFLAtflG9g== X-Authority-Analysis: v=2.4 cv=J/CnLQnS c=1 sm=1 tr=0 ts=69738ca8 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gAnH3GRIAAAA:8 a=AY8K-kA47ILn5Hm1wlYA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-23_02,2026-01-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 spamscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601230118 Content-Type: text/plain; charset="utf-8" Add support for an optional enable GPIO to the gpio-mux driver. This allows the mux to be disabled before changing address lines and re-enabled after, preventing glitches that could briefly activate unintended channels during transitions. The enable GPIO is optional and the driver maintains backward compatibility with existing gpio-mux users. Signed-off-by: Antoniu Miclaus --- Changes in v5: - Enhance code comment to explain high-impedance (high-Z) state when mux is disabled - Add context about downstream capacitance maintaining signal level for analog multiplexers --- drivers/mux/gpio.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c index 4cc3202c58f3..b95d2c7a53ca 100644 --- a/drivers/mux/gpio.c +++ b/drivers/mux/gpio.c @@ -19,6 +19,7 @@ =20 struct mux_gpio { struct gpio_descs *gpios; + struct gpio_desc *enable; }; =20 static int mux_gpio_set(struct mux_control *mux, int state) @@ -27,10 +28,31 @@ static int mux_gpio_set(struct mux_control *mux, int st= ate) DECLARE_BITMAP(values, BITS_PER_TYPE(state)); u32 value =3D state; =20 + if (state =3D=3D MUX_IDLE_DISCONNECT) { + if (mux_gpio->enable) + gpiod_set_value_cansleep(mux_gpio->enable, 0); + return 0; + } + + if (mux_gpio->enable) { + /* + * Disable the mux before changing address lines to prevent + * glitches where an unintended channel could be briefly + * activated during the transition. When disabled, all mux + * outputs enter high-impedance (high-Z) state. For analog + * signals, downstream capacitance typically maintains the + * signal level during this brief disconnection. + */ + gpiod_set_value_cansleep(mux_gpio->enable, 0); + } + bitmap_from_arr32(values, &value, BITS_PER_TYPE(value)); =20 gpiod_multi_set_value_cansleep(mux_gpio->gpios, values); =20 + if (mux_gpio->enable) + gpiod_set_value_cansleep(mux_gpio->enable, 1); + return 0; } =20 @@ -71,9 +93,20 @@ static int mux_gpio_probe(struct platform_device *pdev) WARN_ON(pins !=3D mux_gpio->gpios->ndescs); mux_chip->mux->states =3D BIT(pins); =20 + mux_gpio->enable =3D devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW= ); + if (IS_ERR(mux_gpio->enable)) + return dev_err_probe(dev, PTR_ERR(mux_gpio->enable), + "failed to get enable gpio\n"); + ret =3D device_property_read_u32(dev, "idle-state", (u32 *)&idle_state); if (ret >=3D 0 && idle_state !=3D MUX_IDLE_AS_IS) { - if (idle_state < 0 || idle_state >=3D mux_chip->mux->states) { + if (idle_state =3D=3D MUX_IDLE_DISCONNECT) { + if (!mux_gpio->enable) { + dev_err(dev, + "invalid idle-state (MUX_IDLE_DISCONNECT requires enable-gpios)\n"); + return -EINVAL; + } + } else if (idle_state < 0 || idle_state >=3D mux_chip->mux->states) { dev_err(dev, "invalid idle-state %u\n", idle_state); return -EINVAL; } --=20 2.43.0