From nobody Sat Sep 26 08:00:24 2026 Received: from mx0a-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 34B0B49EC6E; Thu, 3 Sep 2026 12:01:59 +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=1788436921; cv=none; b=T0Dnwwa7uHef0CPnzkJzTB85ZVD480i6WM/TAJjeRZ0npNEV3pj+pXWw66SbkbaoVl6CNzItm8jYTtppQ//8lbWLIlwwJg/+9UbqYQEpZg0lgqdF1oO7Wd+mYkq6HtIPTEWwNpvXxqAeRR7fXZggMpsJIezvJY/3/YfrNAVw5s0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788436921; c=relaxed/simple; bh=SUPdCQ9y6smqEBkTRXfO7L9iuHWsQz6QNl0nLGK1rLY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=seCGWKZToZEmv2btAyXEDTCz2jCcjz6STbr4QCeUQQyc9gjjaU2cZTkTG5NkNJvvYn79WkYVKYmklzTjYq+XOQgqChKgB22k5KcoiOPcpd0z43jjsRcqcKyFR7FVrk9BXx1Uu0iKvWuotWh9AQeKZziNzblZdOsYY9tY7pHRB6c= 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=c7a3kP+S; 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="c7a3kP+S" Received: from pps.filterd (m0516787.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 683AKnXG1310658; Thu, 3 Sep 2026 08:01:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=SO2Eh qdXVuyjFuYaaFeApvFrp1DvhV3lKMVL+nf3JeU=; b=c7a3kP+SC8SMQoVE59BR/ W1L/3QeBuc2Q7MXeLOHuZt9UnmU+iZ+7mexJs6HcaJcfWwLWl0BgnfOgG3Zl2qs9 nrVAKxK7nzR/gXchnDo50h2eCvPbBgVjIV5Pc8tlSk+rLlNbuWM2LUmxOCvWzRpV gpNURGFL39cDin5krIq9Uo4mM2IWeduTHxFz8zMLmYRiena1hdlUZm2lMKQHUzMs et2sYkjsZh9+l124CkQd8mtSxAH6TATXoc4pKNCwSbWBl4is6Rx7fSzb2+5GjJBq vE5lti28jNxxI/oDTfZN0ExtWQ92oSgJJyU8R8RiCoBhB1xR33yqpPHMBgqKaS3K A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4ge0yqt1te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 08:01:54 -0400 (EDT) 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 683C1rp7003604 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Sep 2026 08:01:53 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) 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; Thu, 3 Sep 2026 08:01:53 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Thu, 3 Sep 2026 08:01:52 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Thu, 3 Sep 2026 08:01:52 -0400 Received: from HYB-e1y2fvUQ3cx.ad.analog.com ([10.32.225.204]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 683C1eKo016937; Thu, 3 Sep 2026 08:01:48 -0400 From: Janani Sunil Date: Thu, 3 Sep 2026 14:01:26 +0200 Subject: [PATCH v6 1/3] gpio: regmap: Use regmap_test_bits() for single bit reads Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260903-ad7768-gpio-v6-1-4254ef6c9b38@analog.com> References: <20260903-ad7768-gpio-v6-0-4254ef6c9b38@analog.com> In-Reply-To: <20260903-ad7768-gpio-v6-0-4254ef6c9b38@analog.com> To: Michael Walle , Linus Walleij , Bartosz Golaszewski CC: , , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Andy Shevchenko , "Janani Sunil" , Janani Sunil X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788436900; l=2016; i=janani.sunil@analog.com; s=20260903; h=from:subject:message-id; bh=SUPdCQ9y6smqEBkTRXfO7L9iuHWsQz6QNl0nLGK1rLY=; b=Tnf8dQOoZo9x3b92YnP6RGAEV4ldyUG0cl08yeOxzJ3nIECfjy8Z+B1lURPWqWDi2kJwb8tID oC4X+r+P4BoAL9cd3/EqgCeQ53zz/q8MldSTar5WAJVuHijlq2ytPie X-Developer-Key: i=janani.sunil@analog.com; a=ed25519; pk=0UJo4rLJeMHBMco/+wcMHzXI7nV8k1T72+XQlBNV4Rw= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: cW_QZ2Sm5Sd9qTOGbcsFP-YcdK0OvPm6 X-Authority-Analysis: v=2.4 cv=S93pBosP c=1 sm=1 tr=0 ts=6a9961b2 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=OmVn7CZJonkx5R5zMQLL:22 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=gAnH3GRIAAAA:8 a=h95pfnyYhxuxbSzySfwA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDEwNCBTYWx0ZWRfXyKaGOu4j/CcI p9JKR2A94ybGJyt6uk4D3tK5mmww7y7MWKZMZ0d+cOu44LPRDYbgsianpVk0XX8CV0EgYqRFDb2 o6etXkHfQL99X6czInHOH+mes8nyjkguSfyaiztnwV6y1a6qZMHdaIc6Ie84cJb9iC+pnkFiNmU dBuHGHxQwmTtUSbmT4q64yLAlyaAbOGqFH1OeO75qCg6IQ5Yp2ohnZwSJB1nKNZr2xE4c1fHhcy 0M4w43oV3Ba0Hd+NaKShViekRn5B4V1xJdJT2+nsqbn/i3FvX91SjT8Ije2dOkDl0w+n4gntC1b Dbsj2ztCELqAUPbl41xMrMEhcE3nzqIq9Mn+tuW3QUhQWVoBM4mejcRfWoI1Ii1M6qo1Cijk+WB N3tlc7qJjGtFjCy2vis7Wmgs1KoDnk/Sk5Df844+UW+QVldIo7dSYYrAZbbvNtEWLfZENyALEXY TWmCjGfDiImgKa8/vTg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDEwNCBTYWx0ZWRfX/TKrOpzq7t2r A7KQYRQsci1H0aO2spUdg6bMF90EvG3+aZu5neYd9Ivi5NrTZgYpYQl/b9weJiQondsO5TRJ9hv dpPcN/k9wxizjRmrhvs3nShLKl/hxbD6qox/XSd8PutMV7lsHLB5 X-Proofpoint-ORIG-GUID: cW_QZ2Sm5Sd9qTOGbcsFP-YcdK0OvPm6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-03_03,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030104 Use regmap_test_bits() when reading a single GPIO value from a normal register and when reading the direction bit. Reviewed-by: Linus Walleij Reviewed-by: Michael Walle Reviewed-by: Andy Shevchenko Signed-off-by: Janani Sunil --- drivers/gpio/gpio-regmap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index fb21396e1d02..ae6fa42b00a4 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -95,11 +95,11 @@ static int gpio_regmap_get(struct gpio_chip *chip, unsi= gned int offset) if (ret) return ret; =20 + if (gpio->reg_dat_base !=3D gpio->reg_set_base) + return regmap_test_bits(gpio->regmap, reg, mask); + /* ensure we don't spoil any register cache with pin input values */ - if (gpio->reg_dat_base =3D=3D gpio->reg_set_base) - ret =3D regmap_read_bypassed(gpio->regmap, reg, &val); - else - ret =3D regmap_read(gpio->regmap, reg, &val); + ret =3D regmap_read_bypassed(gpio->regmap, reg, &val); if (ret) return ret; =20 @@ -183,7 +183,7 @@ static int gpio_regmap_get_direction(struct gpio_chip *= chip, unsigned int offset) { struct gpio_regmap *gpio =3D gpiochip_get_data(chip); - unsigned int base, val, reg, mask; + unsigned int base, reg, mask; int invert, ret; =20 if (gpio_regmap_fixed_direction(gpio, offset)) { @@ -212,14 +212,14 @@ static int gpio_regmap_get_direction(struct gpio_chip= *chip, if (ret) return ret; =20 - ret =3D regmap_read(gpio->regmap, reg, &val); - if (ret) + ret =3D regmap_test_bits(gpio->regmap, reg, mask); + if (ret < 0) return ret; =20 - if (!!(val & mask) ^ invert) + if (ret ^ invert) return GPIO_LINE_DIRECTION_OUT; - else - return GPIO_LINE_DIRECTION_IN; + + return GPIO_LINE_DIRECTION_IN; } =20 static int gpio_regmap_try_direction_fixed(struct gpio_regmap *gpio, --=20 2.43.0 From nobody Sat Sep 26 08:00:24 2026 Received: from mx0a-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 34C1649F101; Thu, 3 Sep 2026 12:01:58 +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=1788436921; cv=none; b=qiXcUvl8uj82DLKS1VLJtNRF6mGwumhymel64XCzEm/tVWXKQlqnLtt96C4dPjZcq1gwGsLuYltf9fErd4Zfh9NXvKIAmVAQnr8KHJICD0RQdaoWpr44U0ToZavQm/VuLoYzM2mMsQgtryaEYVQFc/knKAWZgfmrRZkLD1mbWVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788436921; c=relaxed/simple; bh=W1oOhbMeJt2RiugorOqzzo0WowoEdh8EMVhpG1Pzy80=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Slq00nhdzF5Qyeuq8tLh19J5wRcxyEVB6fnhbaNNK2vduJafLO442lPlH+HMQYSLggg2KNuQh/PpvKo18AD2iiEF/fx2m1v6/9eFk5CIdJ/pEQ3uWnILy02AmjOR2zxIvwog0HLEmVMS3BouZcS8ZlPNISl6t/pKo+pOYPSHqVM= 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=xYAIe+Nh; 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="xYAIe+Nh" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 683AF9Bd1514814; Thu, 3 Sep 2026 08:01:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=ojs5a /on8aeVv7qhpOrAk0cJYJcxqIhpfMIgCmJ3dxs=; b=xYAIe+NhKCK/6wMfl7YYq ZalnC8kW6qxNEyhpRNtau7/DdNaKIAIGu7KBX2ylOpGnivoGXntBz4vdhbLc4+wg 3YUkH5+wewgLvFihelgqFRi9xsz5rj99STiggIyleLNii9KQRx8u8DJxnuSlnkCj ES0ayoHyG0JW3OjAqXHg0SkeqKqQLnmvGd8Utyh7k6Yj7VmZXemZ5wSpBPkKAfpO QNvO7YfK4d5rDntwjiW5GvCMj8Hk9lMpV0ixiD/OOvQTXI66XdQHNYSDhqZZ5vZj Aj8Pj4+N5necrrb3/imYD4VQh+sRJAl0vqI7Y8ME2kOnn25Ql3561/+a/H0cZ6Dt g== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4ge469gxh0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 08:01:55 -0400 (EDT) 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 683C1sX7003609 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Sep 2026 08:01:54 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) 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; Thu, 3 Sep 2026 08:01:54 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Thu, 3 Sep 2026 08:01:54 -0400 Received: from HYB-e1y2fvUQ3cx.ad.analog.com ([10.32.225.204]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 683C1eKp016937; Thu, 3 Sep 2026 08:01:50 -0400 From: Janani Sunil Date: Thu, 3 Sep 2026 14:01:27 +0200 Subject: [PATCH v6 2/3] gpio: regmap: Add optional runtime PM support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260903-ad7768-gpio-v6-2-4254ef6c9b38@analog.com> References: <20260903-ad7768-gpio-v6-0-4254ef6c9b38@analog.com> In-Reply-To: <20260903-ad7768-gpio-v6-0-4254ef6c9b38@analog.com> To: Michael Walle , Linus Walleij , Bartosz Golaszewski CC: , , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Andy Shevchenko , Janani Sunil , Janani Sunil X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788436900; l=6940; i=janani.sunil@analog.com; s=20260903; h=from:subject:message-id; bh=W1oOhbMeJt2RiugorOqzzo0WowoEdh8EMVhpG1Pzy80=; b=oR6kv4X4xLn5pcio+EqMTYqC6de7bt21jb8wCC987cnfSjxWgFpuEaXUlofQYop+Txrdr/3rj NKmioDQ8DUKA7KQxpwRKt/fuHW1f6SYIgt7A4YCit4ztuugXllipEC3 X-Developer-Key: i=janani.sunil@analog.com; a=ed25519; pk=0UJo4rLJeMHBMco/+wcMHzXI7nV8k1T72+XQlBNV4Rw= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: BSh_ZilyFAD2UMeZzchKw3_icalfx_qF X-Authority-Analysis: v=2.4 cv=LuCiDHdc c=1 sm=1 tr=0 ts=6a9961b3 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=uXIjobp8t2wMuQ0fPvqm:22 a=QyXUC8HyAAAA:8 a=gAnH3GRIAAAA:8 a=3fJ8ZLtifNgCll64qzMA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDEwNCBTYWx0ZWRfXw+WKhheRCLbs IZN05YlyWAEXlku1au5ZOkk1CraOVY+CtvCEBNOD3ADkKC6II7Vk9q6y0UxL3/JW/t+zXN59SwD 6d3kBIQvmJYNFzaXGACD5ydhBjGDMc8rBIU8q7SV9ye9QkSajoCj3NtaeI5sVHjAJrhWfNDB4/o lP9/wgaii5Rn0LcJJGUr6l8CyKkdvKH/9JPJHNwc1YK3lUF4OzpuJKjSA8r1B16siHpmxNCza65 kE57TITFqypdll91gIwuV31s9+7a2uo9vlXCj0XPitzyNTYcPpZ73COyr5urjkNt/p6w54BPQcg 9ODLYNg4iZy6djScT9yy7jjV2hSaUgKiM73urV4nAp9efItW3dHCSZ/S+dR0ORLk2u+aCp2H3U+ TTxKY7n4rN4a6hhorA5rHgZmIpLBw5YvwaLy6bONMmp5EAT4r/y9pzMaFhuu1Z0rS5y5h2oKPrv nFRZ4mcWNkSETRFz2gw== X-Proofpoint-ORIG-GUID: BSh_ZilyFAD2UMeZzchKw3_icalfx_qF X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDEwNCBTYWx0ZWRfX8L5sjJay4Yua S1m5PJt/iCRTW98h0eJmG7gyc6jzPvP4Sg1HxEnYaW55K28bir7sAK0Z88ZHpG+ZBBhxBkiPySM T64yXaKDAqL4PRoTshNiXpbFScxPqrtYFU0sSbGhSwVWqI7KrguH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-03_03,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 spamscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030104 Some gpio-regmap consumers share their regmap with a parent device that may be runtime suspended. GPIO register accesses must resume that device first. Add an optional pm_dev field and acquire it before register translation or access. Release it using runtime autosuspend after each operation. Keep the device active across the complete direction-output sequence and propagate failure when setting the initial output value. Reviewed-by: Andy Shevchenko Signed-off-by: Janani Sunil Reviewed-by: Linus Walleij Reviewed-by: Michael Walle --- drivers/gpio/gpio-regmap.c | 80 +++++++++++++++++++++++++++++++++++++++++= ---- include/linux/gpio/regmap.h | 2 ++ 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index ae6fa42b00a4..2f5f45b84cc9 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -6,11 +6,13 @@ */ =20 #include +#include #include #include #include #include #include +#include #include #include #include @@ -23,6 +25,8 @@ struct gpio_regmap { struct device *parent; struct regmap *regmap; + struct device *pm_dev; + struct gpio_chip gpio_chip; =20 int reg_stride; @@ -79,6 +83,33 @@ static int gpio_regmap_simple_xlate(struct gpio_regmap *= gpio, return 0; } =20 +static int gpio_regmap_runtime_get(struct gpio_regmap *gpio) +{ + if (!gpio->pm_dev) + return 0; + + return pm_runtime_get_active(gpio->pm_dev, RPM_TRANSPARENT); +} + +static void gpio_regmap_runtime_put(struct gpio_regmap *gpio) +{ + if (!gpio->pm_dev) + return; + + pm_runtime_put_autosuspend(gpio->pm_dev); +} + +DEFINE_GUARD(gpio_regmap_runtime, struct gpio_regmap *, + gpio_regmap_runtime_get(_T), gpio_regmap_runtime_put(_T)) +DEFINE_GUARD_COND(gpio_regmap_runtime, _try, + gpio_regmap_runtime_get(_T), _RET =3D=3D 0) + +#define GPIO_REGMAP_RUNTIME_ACQUIRE(_gpio, _var) \ + ACQUIRE(gpio_regmap_runtime_try, _var)(_gpio) + +#define GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(_var_ptr) \ + ACQUIRE_ERR(gpio_regmap_runtime, _var_ptr) + static int gpio_regmap_get(struct gpio_chip *chip, unsigned int offset) { struct gpio_regmap *gpio =3D gpiochip_get_data(chip); @@ -91,7 +122,13 @@ static int gpio_regmap_get(struct gpio_chip *chip, unsi= gned int offset) else base =3D gpio_regmap_addr(gpio->reg_set_base); =20 - ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_GET_OP, base, offset, ®= , &mask); + GPIO_REGMAP_RUNTIME_ACQUIRE(gpio, pm); + ret =3D GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + + ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_GET_OP, base, offset, + ®, &mask); if (ret) return ret; =20 @@ -114,7 +151,13 @@ static int gpio_regmap_set(struct gpio_chip *chip, uns= igned int offset, unsigned int reg, mask, mask_val; int ret; =20 - ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_SET_OP, base, offset, ®= , &mask); + GPIO_REGMAP_RUNTIME_ACQUIRE(gpio, pm); + ret =3D GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + + ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_SET_OP, base, offset, + ®, &mask); if (ret) return ret; =20 @@ -146,6 +189,11 @@ static int gpio_regmap_set_with_clear(struct gpio_chip= *chip, unsigned int base, reg, mask, value =3D 0; int ret; =20 + GPIO_REGMAP_RUNTIME_ACQUIRE(gpio, pm); + ret =3D GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + if (val) base =3D gpio_regmap_addr(gpio->reg_set_base); else @@ -208,7 +256,13 @@ static int gpio_regmap_get_direction(struct gpio_chip = *chip, return -ENOTSUPP; } =20 - ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_GET_DIR_OP, base, offset, = ®, &mask); + GPIO_REGMAP_RUNTIME_ACQUIRE(gpio, pm); + ret =3D GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + + ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_GET_DIR_OP, base, offset, + ®, &mask); if (ret) return ret; =20 @@ -262,7 +316,13 @@ static int gpio_regmap_set_direction(struct gpio_chip = *chip, return -ENOTSUPP; } =20 - ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_SET_DIR_OP, base, offset, = ®, &mask); + GPIO_REGMAP_RUNTIME_ACQUIRE(gpio, pm); + ret =3D GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + + ret =3D gpio->reg_mask_xlate(gpio, GPIO_REGMAP_SET_DIR_OP, base, offset, + ®, &mask); if (ret) return ret; =20 @@ -293,6 +353,11 @@ static int gpio_regmap_direction_output(struct gpio_ch= ip *chip, struct gpio_regmap *gpio =3D gpiochip_get_data(chip); int ret; =20 + GPIO_REGMAP_RUNTIME_ACQUIRE(gpio, pm); + ret =3D GPIO_REGMAP_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + /* * First check if this is gonna work on a fixed direction line, * if it doesn't (i.e. this is a fixed input line), then do not @@ -304,7 +369,9 @@ static int gpio_regmap_direction_output(struct gpio_chi= p *chip, return ret; } =20 - gpio_regmap_set(chip, offset, value); + ret =3D gpio_regmap_set(chip, offset, value); + if (ret) + return ret; =20 return gpio_regmap_set_direction(chip, offset, true); } @@ -399,6 +466,7 @@ struct gpio_regmap *gpio_regmap_register(const struct g= pio_regmap_config *config gpio->reg_clr_base =3D config->reg_clr_base; gpio->reg_dir_in_base =3D config->reg_dir_in_base; gpio->reg_dir_out_base =3D config->reg_dir_out_base; + gpio->pm_dev =3D config->pm_dev; =20 chip =3D &gpio->gpio_chip; chip->parent =3D config->parent; @@ -406,7 +474,7 @@ struct gpio_regmap *gpio_regmap_register(const struct g= pio_regmap_config *config chip->base =3D -1; chip->names =3D config->names; chip->label =3D config->label ?: dev_name(config->parent); - chip->can_sleep =3D regmap_might_sleep(config->regmap); + chip->can_sleep =3D config->pm_dev || regmap_might_sleep(config->regmap); chip->init_valid_mask =3D config->init_valid_mask; =20 chip->request =3D gpiochip_generic_request; diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h index 6f52c140e50d..6fe0877717cb 100644 --- a/include/linux/gpio/regmap.h +++ b/include/linux/gpio/regmap.h @@ -46,6 +46,7 @@ enum gpio_regmap_operation { * @parent: The parent device * @regmap: The regmap used to access the registers * given, the name of the device is used + * @pm_dev: (Optional) Device to use for runtime power management. * @fwnode: (Optional) The firmware node. * If not given, the fwnode of the parent is used. * @label: (Optional) Descriptive name for GPIO controller. @@ -117,6 +118,7 @@ enum gpio_regmap_operation { struct gpio_regmap_config { struct device *parent; struct regmap *regmap; + struct device *pm_dev; struct fwnode_handle *fwnode; =20 const char *label; --=20 2.43.0 From nobody Sat Sep 26 08:00:24 2026 Received: from mx0a-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 6C16D495057; Thu, 3 Sep 2026 12:02:01 +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=1788436923; cv=none; b=HIX7NW7xdxir08HeBGAF84G5D00QHdkO9orCpCb682GqZ4aplVFuleMt9ShgVYP1AqvQIVP+cKnOtXE6TZRYoC2GVwnG/aOS10JF3ZrI7CkzZXS3WfQtmDq04uoMqIys2dCiQix4EBpbFe+jdu+jKST7scqGOIGpdMNNv80odhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788436923; c=relaxed/simple; bh=JGL5jR92UgiJ5qOcl2z3V3h0bD0J9Sqx4CUdlvHMfyk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=phzCEe0oQLUaJ6sRSpIz76/3vb+8t82/gyrZoGtWH1q//5fuHSpdaec6mjk0cwN0jqsvKjaHOqTVDtHcfmB1BOHjJKNmVPBlzlWhFuRuSryyjrCnRoObX89izDneZSV6vru7jUGTuZiNw3ZasBA2TqpY5JadEpBk9VU4B70tDus= 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=j17K4uX0; 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="j17K4uX0" Received: from pps.filterd (m0516787.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 683ALF6V1311564; Thu, 3 Sep 2026 08:01:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=kl1oO LAynovMTuHwdcsFdulz5errubDS5VG2FFlY2b4=; b=j17K4uX0sRFo3GONw5M53 /RgQ5Mk1xHVOWzTNJOjYcZA2Km9BQRRj02d0E/wa5DYUpOZaTS/rkh4Gnhl3h8Ue iqLymsHpE+ALfRDw1uxxwg+e323JoOIUTTfbzxL3A5rHzvqACRjteUvGfCgsJdmH acbNoAVHUkCfz6/2hKK7cIFesugl688ohrOhxiJa5RFH9re3oIFtKZl/eEvQc73J Qis3kinlh/AmnlvuF7dPqbn0cdXq5EIhFmqTqqemAvKD495hRp9mSyNMfxNqxAMM MlHBU5y29jqTo/zP/UGY3ktLYuUPZnNkgTmgn3JQTwybOaB4qRaoksEI2Uq8bL9f w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4ge0yqt1tn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Sep 2026 08:01:57 -0400 (EDT) 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 683C1ueY003612 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Sep 2026 08:01:56 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) 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; Thu, 3 Sep 2026 08:01:56 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Thu, 3 Sep 2026 08:01:56 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Thu, 3 Sep 2026 08:01:56 -0400 Received: from HYB-e1y2fvUQ3cx.ad.analog.com ([10.32.225.204]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 683C1eKq016937; Thu, 3 Sep 2026 08:01:52 -0400 From: Janani Sunil Date: Thu, 3 Sep 2026 14:01:28 +0200 Subject: [PATCH v6 3/3] gpio: ad7768: Add AD7768 GPIO auxiliary driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260903-ad7768-gpio-v6-3-4254ef6c9b38@analog.com> References: <20260903-ad7768-gpio-v6-0-4254ef6c9b38@analog.com> In-Reply-To: <20260903-ad7768-gpio-v6-0-4254ef6c9b38@analog.com> To: Michael Walle , Linus Walleij , Bartosz Golaszewski CC: , , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Andy Shevchenko , "Janani Sunil" , Janani Sunil X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788436900; l=5658; i=janani.sunil@analog.com; s=20260903; h=from:subject:message-id; bh=JGL5jR92UgiJ5qOcl2z3V3h0bD0J9Sqx4CUdlvHMfyk=; b=LQSeSnYXCZ9MUW8FfHNB94m0Y5At3JdIlvLjnwLISdXtWxXmyiFU4lXVyEDCpbqstTISwGj+X ZZjzYlSZyf5A15gfIEYT/YrS1Y5+F3DGXwtPdyKflSq3p6PchF2hrcm X-Developer-Key: i=janani.sunil@analog.com; a=ed25519; pk=0UJo4rLJeMHBMco/+wcMHzXI7nV8k1T72+XQlBNV4Rw= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 8xjRcn-RbPRbIZdH969F15jb9joA3WJ5 X-Authority-Analysis: v=2.4 cv=S93pBosP c=1 sm=1 tr=0 ts=6a9961b5 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=OmVn7CZJonkx5R5zMQLL:22 a=QyXUC8HyAAAA:8 a=VwQbUJbxAAAA:8 a=gAnH3GRIAAAA:8 a=8fq82CzG31171KfXEYkA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDEwNCBTYWx0ZWRfXwDn61fC77rJv p3JfGzMj4ru1YgRHlpuiYNWgAyROmN+UFyT92K5noyyCAyJRcdvZZbn0k5KEUFsylK/EosUytJ8 wbjBK9k1AYcKW9XH1/AZflTixzvH+mke/axwNNcTjAEyrIsUehNGqOivK8KDrSucVB1br9/7GBc VWwMxEjcAcrJHWUAP+JYDA1nRJwNP+MgwxsXhVUekxByxpGY8LxaeOKMBJhznnIHmZj5tHfsCwe osVhwwmhxEKJjtEJSU8If8uIYNQfOr3eoqPKp9HXqVEcs644xAPoRt/SV4E11BNlaSlCyAbugL+ S8sTQ9ajxZ8UJsBd5wVrtkhA8ckGE2aWlcWrm38rFDM6VlaguWqkS5Ue9PfDpHb6laokqNdZUX8 0/wmXx1ILWar8To11qbS9gShCbrrkLkaP6xM6ESV9T8ETLdrhcWJ/uzbw4+Qw7WwczX9MWkYkDp 9nwvwRHtxCUD/8QtWhw== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDEwNCBTYWx0ZWRfXx1Bu0/Eds1OG +LwkCnGiRUYrBJBwQh+4e+x7a8//JCzEFLbNPbgFY+KKLtQjxv3LEJqkiRsRPeP86rF5RSFe2Rt 1e21alphm5ZLal/mE4E+kdwETjk80zSGiiRl+vIXa+VFGycpHtM/ X-Proofpoint-ORIG-GUID: 8xjRcn-RbPRbIZdH969F15jb9joA3WJ5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-03_03,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030104 The AD7768 provides five GPIOs controlled through registers shared with the parent IIO device. Register an auxiliary gpio-regmap driver and use the parent device for runtime PM. The device has separate input-state and output-latch registers. Add a reg_mask_xlate() callback that checks the line direction and reads the programmed output latch for output lines while retaining input-state reads for input lines. Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Janani Sunil --- drivers/gpio/Kconfig | 12 +++++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-ad7768.c | 122 +++++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 135 insertions(+) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index a48586bb8edb..07b7f8ab0ccb 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1818,6 +1818,18 @@ endmenu menu "Auxiliary Bus GPIO drivers" depends on AUXILIARY_BUS =20 +config GPIO_AD7768 + tristate "Analog Devices AD7768 GPIO support" + depends on AD7768 + depends on GPIOLIB + select GPIO_REGMAP + help + Say yes here to expose the AD7768 utility pins as GPIOs when the + device tree node is marked as a GPIO controller. + + To compile this driver as a module, choose M here: the module will be + called gpio-ad7768. + config GPIO_LTC4283 tristate "Analog Devices LTC4283 GPIO support" depends on SENSORS_LTC4283 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index dc9e6d643b5b..ce56e9b3f55d 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -27,6 +27,7 @@ obj-$(CONFIG_GPIO_104_IDI_48) +=3D gpio-104-idi-48.o obj-$(CONFIG_GPIO_104_IDIO_16) +=3D gpio-104-idio-16.o obj-$(CONFIG_GPIO_74X164) +=3D gpio-74x164.o obj-$(CONFIG_GPIO_74XX_MMIO) +=3D gpio-74xx-mmio.o +obj-$(CONFIG_GPIO_AD7768) +=3D gpio-ad7768.o obj-$(CONFIG_GPIO_ADNP) +=3D gpio-adnp.o obj-$(CONFIG_GPIO_ADP5520) +=3D gpio-adp5520.o obj-$(CONFIG_GPIO_ADP5585) +=3D gpio-adp5585.o diff --git a/drivers/gpio/gpio-ad7768.c b/drivers/gpio/gpio-ad7768.c new file mode 100644 index 000000000000..cac3a55e738d --- /dev/null +++ b/drivers/gpio/gpio-ad7768.c @@ -0,0 +1,122 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Analog Devices AD7768 GPIO auxiliary driver + * + * Copyright 2026 Analog Devices Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define AD7768_REG_GPIO_CONTROL 0x0E +#define AD7768_GPIO_UGPIO_ENABLE BIT(7) + +#define AD7768_REG_GPIO_WRITE 0x0F +#define AD7768_REG_GPIO_READ 0x10 + +#define AD7768_NUM_GPIOS 5 +#define AD7768_FILTER_GPIO 4 + +static int ad7768_gpio_init_valid_mask(struct gpio_chip *gc, + unsigned long *valid_mask, + unsigned int ngpios) +{ + if (ngpios > AD7768_FILTER_GPIO && + device_property_match_string(gc->parent->parent, "clock-names", + "mclk") < 0) + bitmap_clear(valid_mask, AD7768_FILTER_GPIO, 1); + + return 0; +} + +static int ad7768_gpio_reg_mask_xlate(struct gpio_regmap *gpio, + enum gpio_regmap_operation op, + unsigned int base, unsigned int offset, + unsigned int *reg, unsigned int *mask) +{ + struct regmap *regmap =3D gpio_regmap_get_drvdata(gpio); + int ret; + + *reg =3D base; + *mask =3D BIT(offset); + + if (op !=3D GPIO_REGMAP_GET_OP) + return 0; + + /* + * AD7768 has separate input-state and output-latch registers. For an + * output line, report the programmed value from the output latch; + * input lines continue to use the input-state register. + */ + ret =3D regmap_test_bits(regmap, AD7768_REG_GPIO_CONTROL, *mask); + if (ret < 0) + return ret; + if (ret) + *reg =3D AD7768_REG_GPIO_WRITE; + + return 0; +} + +static int ad7768_gpio_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct gpio_regmap_config config; + struct device *dev =3D &adev->dev; + struct device *parent; + struct regmap *map; + int ret; + + parent =3D dev->parent; + map =3D dev_get_regmap(parent, NULL); + if (!map) + return -ENODEV; + + PM_RUNTIME_ACQUIRE_AUTOSUSPEND(parent, pm); + ret =3D PM_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + + ret =3D regmap_set_bits(map, AD7768_REG_GPIO_CONTROL, AD7768_GPIO_UGPIO_E= NABLE); + if (ret) + return ret; + + config =3D (struct gpio_regmap_config) { + .parent =3D dev, + .regmap =3D map, + .label =3D dev_name(parent), + .ngpio =3D AD7768_NUM_GPIOS, + .reg_dat_base =3D AD7768_REG_GPIO_READ, + .reg_set_base =3D AD7768_REG_GPIO_WRITE, + .reg_dir_out_base =3D AD7768_REG_GPIO_CONTROL, + .pm_dev =3D parent, + .reg_mask_xlate =3D ad7768_gpio_reg_mask_xlate, + .init_valid_mask =3D ad7768_gpio_init_valid_mask, + .drvdata =3D map, + }; + + return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &config)); +} + +static const struct auxiliary_device_id ad7768_gpio_ids[] =3D { + { .name =3D "ad7768.gpio" }, + { } +}; +MODULE_DEVICE_TABLE(auxiliary, ad7768_gpio_ids); + +static struct auxiliary_driver ad7768_gpio_driver =3D { + .probe =3D ad7768_gpio_probe, + .id_table =3D ad7768_gpio_ids, +}; +module_auxiliary_driver(ad7768_gpio_driver); + +MODULE_AUTHOR("Janani Sunil "); +MODULE_DESCRIPTION("Analog Devices AD7768 GPIO auxiliary driver"); +MODULE_LICENSE("GPL"); --=20 2.43.0