From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A535F25B1D8 for ; Fri, 15 Aug 2025 09:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248962; cv=none; b=I1TipEbJLK5ZNY+GoVLnJueEwNDnrXcbp4vRRQAkC4x9s2DpYZLopd0i5CaI/Dj14qaUwkUwINCaqQfwqM1vMCaMWGcgoq5C1DFckgYaMulBUNy+Ir+96Q9ESp/7QxI5oPi1MT7yLrc8qEuwx5mE6/+DCP7SyHIj7IHJ6dj74Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248962; c=relaxed/simple; bh=FCHL/kjtWeV0+j9xlgMQg6HU/vJCfHILk378t4N4z30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gUyOUxtpOYXqc6f1T/+cT6NaBGOYnJIJ6X5TUyHlvniMMH83vsmCN6sv4dPNt/P4ugXXFkiT5zlwhsFia4Kpa/HHtQGiSpVILvj2mwqR1tBIWjDKXUYaUxmtR0bGvPs+mfTEC49wWoj1cnZmhN6I20ZeL2+kAfCfSXhR3mgbB2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=IXJX5EWD; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="IXJX5EWD" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3b9e4193083so1552513f8f.3 for ; Fri, 15 Aug 2025 02:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248958; x=1755853758; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jWxB7D3jJyBkITTYt/u8P0qX4HLXnEbcjEWeuCzP8c8=; b=IXJX5EWDcMdjcEK5M69gkT1xYHHrzrKxkhezxH/2ugp5ICDTE6XZOtCVnXN1f2R++k TvuFjbRCgoDcSVI6exrdEP5d13l7LIDCyINN3B2dlk+c73P+B0ntq/jeCgxKyR4q0+nW 4vPVPGxXqI6t8FjWIzKjP0B2Kx1IYSCgyVcy6cGzGLcC0skPvy06Fl1RWS90Il3JTo58 dtUzTpjmiroiUx7xgwBj6gObKOw5ljiNn9e8UFT/YpiihzUNgyiyVIrZA1C8F367CD8p nC97vsspsd4wfGEvhcT3Mp7fr6WEuVRTdEb5BSl5JlFaVtbqSn+EINmESlW9SFDC+UgQ 76aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248958; x=1755853758; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jWxB7D3jJyBkITTYt/u8P0qX4HLXnEbcjEWeuCzP8c8=; b=MWs1DKVsfKqvUHnBcvCDgcXQM1qPDt+EM0feZ88XqaDxip6YG/mL1cneRTOsE+PtBX 1u29ELhQevCSBriAofrKWaRJ6B4dxUut+LmuE0iOkb3vk1HCvkWKSCxiGDO4lRDJjuXI OYDWtmPKIzeGYv5YHQK8q4ljiOzkWi6c3obVhZzOeMSPOFnZguddYUYPGOm/8oZc6dyg OgqpbKvaF1nfz6BqQocFUTT4023pAMcNG2aRxLjvyTQBgpGvj/Qnv2AxirLABzHMVqN4 cbNu+Y9v2ikNM3iUvemw11MofqyOjRb93awUBHBoE7/BCgNQmQ52RcuvMjCvC1KJNSTU yzjQ== X-Forwarded-Encrypted: i=1; AJvYcCUcnD/rnXFv+M0FY2zhhaKYA7Nray5fFOfe8Q3GJMBRz2xDAD3ilqnB0oxrw6Q1Pj4HFCfrAWlSudozFbM=@vger.kernel.org X-Gm-Message-State: AOJu0YxMDbNRf0+Xf0jM8BxA60J6O1pPOJZorK2UONrQsZPz6OYLp+1Y 3UJwbKZI6sFOXddiF2puqpl3rOA57xy95kOxIV6su0Re385c43lJB89QqM1x8huKbKQ= X-Gm-Gg: ASbGncujHmepLHw3lfY1IV4JQC+yteLk3nSDMDpojPLoIXnEUS00/te1uJF/0tv7dsV NjC5NzDs5RAXYsgQhBYGBhhkoSlhdXBIXGLQlgGpKKMl8K17Ddf0brvmAfP9H00NqZ1riAjez0J gSsU6ioRRsWe8e0jvARFWlMPICitKX4aUtwIBTvJXwb2aCWcW0UQ8DxKuVBGEpRmt2OjiCI8WaB u/z3zwMSigCoicBW+EhVQn6lwmM1UhSy5LsQUuuErZru7AU15m3NZBb7p8I7NUV31n0Owq/uMjc XStsfFfxikUgubKzXUyDWBuUdLoc5UTsDU59TXAfEcwFUfXSzkH3WTPcD+YMn6daFB5bVkKDAyf 1yjxYCIRiXSOURQeNXQ== X-Google-Smtp-Source: AGHT+IGnCJeDOqE3G4r581ayfk7huZyQHMOX+PmOKQXkUeS7zf7iEj9jqH6oiGPuorRj19lkyqveSA== X-Received: by 2002:a5d:5d11:0:b0:3b7:810f:6caf with SMTP id ffacd0b85a97d-3bb68a1874amr1166149f8f.32.1755248957733; Fri, 15 Aug 2025 02:09:17 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:17 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:03 +0200 Subject: [PATCH v5 01/15] devres: provide devm_kmemdup_const() 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: <20250815-pinctrl-gpio-pinfuncs-v5-1-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2111; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=yGM1a+aC0va5PQYzRl7VigwSABEcy8VUGQM8wt+k8EA=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk2b9jhbpZSR4bPSrpRtG6g+7NeYTvJmeHom mkeMTq5AUSJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75NgAKCRARpy6gFHHX ckzrD/9dpMT6eFmPjEdr9qjjRqAOs5l02AiDkl3dHtrzFi9yMxxW2FtEtRuxPAhpHPVWiHPN07r 0RROaKlAKF++hEfZYnZedgxj3QWia5uQqkTZGIk1C6yktsS//GQGe0diPUrRMbSsMNANL6SA3Nx S4wRM4tUkMPqKt23QdTH5TWkZhIsNDbuDR8Zj4iNO/Oe9tiVLXFbPOslY91hsYRIOx+29AVkUu0 nfRh3+Be+5nBAQc73pr8bf0gR8TwhJtXlQ4oMq6OGzCUWMZs0cTeSGFiQdzL6oP9De/SWcMCMPO 3XA0BNI12lUneQ4UuYedE1N0KElf76XPTEx2UrholVQN+5KpqruqPKypec/HgHGhpMQv0ywBWUO kkjEJiumlJd7SzYJ+Cl7t9foAdOHlVGbHrSwhNNAsZ6NP4umioBGxWb3qFwna55mgCL1R1YynSo KPOx6RPkda84XsjOzlOwSqAPBufV3AON+YIKuJBUmKqGk5ba2nja9OqTYjlQEHBOeN2QmF05iUK z+4I82/CtLqSGznLLQbzoJu3sRwnPRgEc1iZEg8oYC/4IqFC6/noCf4YYYvIA7C03q+RTCyPCRn z465BIQ5H0TfkwTOj4sYbbMsTcq7N2mrfE+fqMp4J4jUxTAhjOXedXvSYOIXvvmYPQxWMphF+EQ nh1EvmLIpVJ9QHA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Provide a function similar to devm_strdup_const() but for copying blocks of memory that are likely to be placed in .rodata. Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- drivers/base/devres.c | 21 +++++++++++++++++++++ include/linux/device/devres.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index ff55e1bcfa30057849a352c577bd32f1aa196532..c948c88d395607ff511ffa6eb0a= 75b7847ab9239 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -1117,6 +1117,27 @@ void *devm_kmemdup(struct device *dev, const void *s= rc, size_t len, gfp_t gfp) } EXPORT_SYMBOL_GPL(devm_kmemdup); =20 +/** + * devm_kmemdup_const - conditionally duplicate and manage a region of mem= ory + * + * @dev: Device this memory belongs to + * @src: memory region to duplicate + * @len: memory region length, + * @gfp: GFP mask to use + * + * Return: source address if it is in .rodata or the return value of kmemd= up() + * to which the function falls back otherwise. + */ +const void * +devm_kmemdup_const(struct device *dev, const void *src, size_t len, gfp_t = gfp) +{ + if (is_kernel_rodata((unsigned long)src)) + return src; + + return devm_kmemdup(dev, src, len, gfp); +} +EXPORT_SYMBOL_GPL(devm_kmemdup_const); + struct pages_devres { unsigned long addr; unsigned int order; diff --git a/include/linux/device/devres.h b/include/linux/device/devres.h index ae696d10faff4468a41f37b5d5fd679d4ff11997..8c5f57e0d613492fd0b2ec97dd3= 84181608192fc 100644 --- a/include/linux/device/devres.h +++ b/include/linux/device/devres.h @@ -80,6 +80,8 @@ void devm_kfree(struct device *dev, const void *p); =20 void * __realloc_size(3) devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp); +const void * +devm_kmemdup_const(struct device *dev, const void *src, size_t len, gfp_t = gfp); static inline void *devm_kmemdup_array(struct device *dev, const void *src, size_t n, size_t size, gfp_t flags) { --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C427B2BE7AF for ; Fri, 15 Aug 2025 09:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248966; cv=none; b=KwH7mP3QUpYPkYc4FGJDjPZtDVRylspcTd+ICrhaDlUHY55z9Gzs7iFApiiSvyc8yrxgCX07P6TXHxgaJSkAcUgigYbSXrC+tCYGu7269NA3+JrEq4BHaZKihD7DMTl5XncncY2mKfPcRpn7+Z1eW7W7J8x3fln7RIk+lEb8V64= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248966; c=relaxed/simple; bh=WIEQvxtdRthB6856r4HUV03c0VDMli/mjsj8od8S8wU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vw7iN25AQL4zyktdvztAs+Wgep5gjCcwoLHgrrl1oOy1DkMW3rAWUC+mSOk3HGLN0qVhs/UQ1y8GEIFyjlO2Vc3D8cDd7o9hUzWBVbNcJBsirFvleaGDF02mUuwMSlsxigrB0lmjPdqHzdX/BQXIKvPh8wgNibWMOa/Hzp5EvmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=swYKEGcN; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="swYKEGcN" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-45a20c51c40so3938695e9.3 for ; Fri, 15 Aug 2025 02:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248960; x=1755853760; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PTEYsyiptWWjSso4TZTiEeMehJGAEz0s92KPugL0Mwk=; b=swYKEGcN/egRYVelxDq4qQ4fZiInj/8Ig2r9gILmvk+EN2gipTszRXc+qZ9nDDKYs0 ADDlDaE2keimw45rp+7/uuYbT+Er8Ie7day93kol3KE8wP4zmpPQJabtoNIbdClj881a YP4Nt4X4wSTfBH76GmVFLE4q9L0iDWj04HCF6vZql394MIHQjTKvtBajKK5M+hpvFwa2 erARMnu5hLT56Z15gBLvqT+9NcRF6BsftrsAyCzt1UXWICfmY3kaWIjBC2luYIZI+/4U JzW/IIfaH8SgmpgHTRt8VBarRc8eR4nrYYOx5IqbbHsZMSbBfXN0PIiNrpTZygJTxq3w DVVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248960; x=1755853760; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PTEYsyiptWWjSso4TZTiEeMehJGAEz0s92KPugL0Mwk=; b=OkjagJN5muFQRdhEE2YE3cVNb0qmtDdvL/krbxkjvfTX4d5ZALqobIqdu9kJ+l2guj nM4UIt4HfiJ7RFpd65MBDE5xle3lk7Y1IEbnYQj0YGUyMdxGwXJbNP6neryTFFPE17x6 SdLt1ovgnyRRuDjlcAqcY89tCX6eMkzvD6PeJ5RY58uAlzaFpNpUTsGtvy8F+yUeppe0 EauopNmv+ZDK+G0YqMOdkmySggdjbAoqGndFW75p5uaWJqm4tjSUmOok/gp5g2CrcY7r AUI7dcotFy2e82yUm0JMSR+rd/p0XZgGT8jpPsvcLZkdh30y6UMoZdLGsXt1ZLo9g/PO O87g== X-Forwarded-Encrypted: i=1; AJvYcCWPgF14wqBIs2iyuMJJPySoQYzMcaPQg2Hdg7JaTkyoez81f3GuMTdEIawfg0ABm2CtWV0uhgTFn2c4MpQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzY5SbWEy8cPj1DOf0XRzXArD4HcLr488geGtPj6PCGVu3GaSfj xnZL1rQbjqStchwJuIWYQeJzteQgiwqq92aXVjhM5X+9AYdGDVDXo2DOpAOvZHd519I= X-Gm-Gg: ASbGncsBn4gEJcLXl5O4LVYEBIrzzyN668vodnurqb23Lva2eanSXgTe/0mawn0/KM+ 9jz8VoFDlpyyJSJQOn0KKmS6vn5t7PQAjikgJS3u/MCLep0on++KxFdPzoKo8h+rPreRvwNWqe2 gQQ/c9KnUMKpK1ToqskPJydv5aOU6Uxul9yRZwb9aUDU/zW65h8j07pWwiC6pLNCxD1mA7R6bY3 rVUXc6uq6UsqmbAtobSGBo6q1aIntclvu/20XCwXTbP6IRVOmRjCX0Z0vK80wKLY80Rzw4iGaor 4ZrfNoWNUPz20Ow6kZ1Dm7YtZRI91PvYZSsS5AKiT1UtLU7S5jJqGwiNts7Flxt4UU9Y4bNexZ4 zoxZhOcGDf4isTwsh1w== X-Google-Smtp-Source: AGHT+IGuafEDk2fUEQZW8KQxsUxoxuS3rrKRRLnSrxZzWpectV45Eo45G/o23FjXP2Wlz7Hukpjj7g== X-Received: by 2002:a05:600c:458d:b0:453:8bc7:5cbb with SMTP id 5b1f17b1804b1-45a218575cdmr12294135e9.25.1755248959721; Fri, 15 Aug 2025 02:09:19 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:19 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:04 +0200 Subject: [PATCH v5 02/15] pinctrl: ingenic: use struct pinfunction instead of struct function_desc 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: <20250815-pinctrl-gpio-pinfuncs-v5-2-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=8989; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=ngwvMKiL7WjeArNFSdBs/AB2ylnC/fm8iV0Ni8uhrlY=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk2tcCKZ9S8bHWzstarqLTKTQ1YHnUbV92qt Qb2VsamRP2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75NgAKCRARpy6gFHHX ck8UD/0SuZ1lRn709uM94ELQ72NHYzpEjQtAM1QFRsNdAYuKoJOvHR364Fj3HhkJd+zCrUp2Fry +ZhqLaNDtcJRXi1guJPKFuBw4hvA89fdoQ//Ji5sBF53l09eteQmfQkSZ9cThUuqb2ppQNrYg44 Uw4SQi59wIEjNkFcCYmIyGi41ZLTjWLkTqEEaHYAvXtnckyS4dLq0u9JmxGlvZAqO2gzhZSJj9v H4jgBrzkSytyTLgC7Aoy1Ju/+fjgpvCvtJexa+QgAUk48BQQ+zS8k3FlS3nZrKbeXo2J22IX9I/ x9hgdRao6lACMKXTsVVsLyzt2kQTPya2dr+NWOvuvJJgoK84111q5NYsNGvC25tGN3Ndj4XECpx zaMsN9OT7tWOAF6oQbtQs+tOg3FdD7BmW3CjFvi/r/j4/JJAdC0zp7S80TP+yWQJyR12NJxhgRl bNkFazTTH376z0uBVticwi6kKpfaQ17JYnYGH/op9YKw8yUgnv7rJc+HIsXz+AJS8U3sWSBXLyU vRLs/hlpZVM7nClvIR/bjL4h4xKl/dFzH7xUq5WB8Mu7zgllTIg2XPgznTS4I91Y9Iq3J7IGzRq DRr9xrWrp2X0YEM1881AG9tbg22WDeuvO+aPGY7m6KSFgNR3+mLQCq0KBikOArR7KN0yRdAm7dz fywtlYsuxDVymgw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct function_desc is a wrapper around struct pinfunction with an additional void *data pointer. This driver doesn't use the data pointer. We're also working towards reducing the usage of struct function_desc in pinctrl drivers - they should only be created by pinmux core and accessed by drivers using pinmux_generic_get_function(). Replace the struct function_desc objects in this driver with smaller struct pinfunction instances. Acked-by: Paul Cercueil Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinctrl-ingenic.c | 45 +++++++++++++++++------------------= ---- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index 2900513467fa4e2e9374946fc9c7a30d48aef9eb..af9d2f3081859bc4b22f6820f3b= 3753eba36f959 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -96,11 +96,8 @@ .data =3D (void *)func, \ } =20 -#define INGENIC_PIN_FUNCTION(_name_, id) \ - { \ - .func =3D PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_group= s)), \ - .data =3D NULL, \ - } +#define INGENIC_PIN_FUNCTION(_name_, id) \ + PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)) =20 enum jz_version { ID_JZ4730, @@ -128,7 +125,7 @@ struct ingenic_chip_info { const struct group_desc *groups; unsigned int num_groups; =20 - const struct function_desc *functions; + const struct pinfunction *functions; unsigned int num_functions; =20 const u32 *pull_ups, *pull_downs; @@ -263,7 +260,7 @@ static const char *jz4730_pwm1_groups[] =3D { "pwm1", }; static const char *jz4730_mii_groups[] =3D { "mii", }; static const char *jz4730_i2s_groups[] =3D { "i2s-data", "i2s-master", "i2= s-slave", }; =20 -static const struct function_desc jz4730_functions[] =3D { +static const struct pinfunction jz4730_functions[] =3D { INGENIC_PIN_FUNCTION("mmc", jz4730_mmc), INGENIC_PIN_FUNCTION("uart0", jz4730_uart0), INGENIC_PIN_FUNCTION("uart1", jz4730_uart1), @@ -370,7 +367,7 @@ static const char *jz4740_pwm5_groups[] =3D { "pwm5", }; static const char *jz4740_pwm6_groups[] =3D { "pwm6", }; static const char *jz4740_pwm7_groups[] =3D { "pwm7", }; =20 -static const struct function_desc jz4740_functions[] =3D { +static const struct pinfunction jz4740_functions[] =3D { INGENIC_PIN_FUNCTION("mmc", jz4740_mmc), INGENIC_PIN_FUNCTION("uart0", jz4740_uart0), INGENIC_PIN_FUNCTION("uart1", jz4740_uart1), @@ -474,7 +471,7 @@ static const char *jz4725b_pwm3_groups[] =3D { "pwm3", = }; static const char *jz4725b_pwm4_groups[] =3D { "pwm4", }; static const char *jz4725b_pwm5_groups[] =3D { "pwm5", }; =20 -static const struct function_desc jz4725b_functions[] =3D { +static const struct pinfunction jz4725b_functions[] =3D { INGENIC_PIN_FUNCTION("mmc0", jz4725b_mmc0), INGENIC_PIN_FUNCTION("mmc1", jz4725b_mmc1), INGENIC_PIN_FUNCTION("uart", jz4725b_uart), @@ -606,7 +603,7 @@ static const char *jz4750_pwm3_groups[] =3D { "pwm3", }; static const char *jz4750_pwm4_groups[] =3D { "pwm4", }; static const char *jz4750_pwm5_groups[] =3D { "pwm5", }; =20 -static const struct function_desc jz4750_functions[] =3D { +static const struct pinfunction jz4750_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4750_uart0), INGENIC_PIN_FUNCTION("uart1", jz4750_uart1), INGENIC_PIN_FUNCTION("uart2", jz4750_uart2), @@ -771,7 +768,7 @@ static const char *jz4755_pwm3_groups[] =3D { "pwm3", }; static const char *jz4755_pwm4_groups[] =3D { "pwm4", }; static const char *jz4755_pwm5_groups[] =3D { "pwm5", }; =20 -static const struct function_desc jz4755_functions[] =3D { +static const struct pinfunction jz4755_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4755_uart0), INGENIC_PIN_FUNCTION("uart1", jz4755_uart1), INGENIC_PIN_FUNCTION("uart2", jz4755_uart2), @@ -1106,7 +1103,7 @@ static const char *jz4760_pwm6_groups[] =3D { "pwm6",= }; static const char *jz4760_pwm7_groups[] =3D { "pwm7", }; static const char *jz4760_otg_groups[] =3D { "otg-vbus", }; =20 -static const struct function_desc jz4760_functions[] =3D { +static const struct pinfunction jz4760_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4760_uart0), INGENIC_PIN_FUNCTION("uart1", jz4760_uart1), INGENIC_PIN_FUNCTION("uart2", jz4760_uart2), @@ -1444,7 +1441,7 @@ static const char *jz4770_pwm6_groups[] =3D { "pwm6",= }; static const char *jz4770_pwm7_groups[] =3D { "pwm7", }; static const char *jz4770_mac_groups[] =3D { "mac-rmii", "mac-mii", }; =20 -static const struct function_desc jz4770_functions[] =3D { +static const struct pinfunction jz4770_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4770_uart0), INGENIC_PIN_FUNCTION("uart1", jz4770_uart1), INGENIC_PIN_FUNCTION("uart2", jz4770_uart2), @@ -1723,7 +1720,7 @@ static const char *jz4775_mac_groups[] =3D { }; static const char *jz4775_otg_groups[] =3D { "otg-vbus", }; =20 -static const struct function_desc jz4775_functions[] =3D { +static const struct pinfunction jz4775_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4775_uart0), INGENIC_PIN_FUNCTION("uart1", jz4775_uart1), INGENIC_PIN_FUNCTION("uart2", jz4775_uart2), @@ -1976,7 +1973,7 @@ static const char *jz4780_dmic_groups[] =3D { "dmic",= }; static const char *jz4780_cim_groups[] =3D { "cim-data", }; static const char *jz4780_hdmi_ddc_groups[] =3D { "hdmi-ddc", }; =20 -static const struct function_desc jz4780_functions[] =3D { +static const struct pinfunction jz4780_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4770_uart0), INGENIC_PIN_FUNCTION("uart1", jz4770_uart1), INGENIC_PIN_FUNCTION("uart2", jz4780_uart2), @@ -2211,7 +2208,7 @@ static const char *x1000_pwm3_groups[] =3D { "pwm3", = }; static const char *x1000_pwm4_groups[] =3D { "pwm4", }; static const char *x1000_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x1000_functions[] =3D { +static const struct pinfunction x1000_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1000_uart0), INGENIC_PIN_FUNCTION("uart1", x1000_uart1), INGENIC_PIN_FUNCTION("uart2", x1000_uart2), @@ -2341,7 +2338,7 @@ static const char *x1500_pwm2_groups[] =3D { "pwm2", = }; static const char *x1500_pwm3_groups[] =3D { "pwm3", }; static const char *x1500_pwm4_groups[] =3D { "pwm4", }; =20 -static const struct function_desc x1500_functions[] =3D { +static const struct pinfunction x1500_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1500_uart0), INGENIC_PIN_FUNCTION("uart1", x1500_uart1), INGENIC_PIN_FUNCTION("uart2", x1500_uart2), @@ -2562,7 +2559,7 @@ static const char * const x1600_pwm7_groups[] =3D { "= pwm7-b10", "pwm7-b21", }; =20 static const char * const x1600_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x1600_functions[] =3D { +static const struct pinfunction x1600_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1600_uart0), INGENIC_PIN_FUNCTION("uart1", x1600_uart1), INGENIC_PIN_FUNCTION("uart2", x1600_uart2), @@ -2779,7 +2776,7 @@ static const char *x1830_pwm6_groups[] =3D { "pwm6-c-= 17", "pwm6-c-27", }; static const char *x1830_pwm7_groups[] =3D { "pwm7-c-18", "pwm7-c-28", }; static const char *x1830_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x1830_functions[] =3D { +static const struct pinfunction x1830_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1830_uart0), INGENIC_PIN_FUNCTION("uart1", x1830_uart1), INGENIC_PIN_FUNCTION("sfc", x1830_sfc), @@ -3225,7 +3222,7 @@ static const char *x2000_mac0_groups[] =3D { "mac0-rm= ii", "mac0-rgmii", }; static const char *x2000_mac1_groups[] =3D { "mac1-rmii", "mac1-rgmii", }; static const char *x2000_otg_groups[] =3D { "otg-vbus", }; =20 -static const struct function_desc x2000_functions[] =3D { +static const struct pinfunction x2000_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x2000_uart0), INGENIC_PIN_FUNCTION("uart1", x2000_uart1), INGENIC_PIN_FUNCTION("uart2", x2000_uart2), @@ -3449,7 +3446,7 @@ static const struct group_desc x2100_groups[] =3D { =20 static const char *x2100_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x2100_functions[] =3D { +static const struct pinfunction x2100_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x2000_uart0), INGENIC_PIN_FUNCTION("uart1", x2000_uart1), INGENIC_PIN_FUNCTION("uart2", x2000_uart2), @@ -4571,11 +4568,9 @@ static int __init ingenic_pinctrl_probe(struct platf= orm_device *pdev) } =20 for (i =3D 0; i < chip_info->num_functions; i++) { - const struct function_desc *function =3D &chip_info->functions[i]; - const struct pinfunction *func =3D &function->func; + const struct pinfunction *func =3D &chip_info->functions[i]; =20 - err =3D pinmux_generic_add_pinfunction(jzpc->pctl, func, - function->data); + err =3D pinmux_generic_add_pinfunction(jzpc->pctl, func, NULL); if (err < 0) { dev_err(dev, "Failed to register function %s\n", func->name); return err; --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0391F2D0C64 for ; Fri, 15 Aug 2025 09:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248967; cv=none; b=CckOqd6PjEfeVUOob5O62XEFkBo0mA5sN4Ty9CFrWrlYb/GqAblP4736CywAczIdtbTpBwrv6c3YHdTbPTg/eYJCaRuWXyrwAhYFsRLResQ3V4OAI/Z4gG/Bf8i99hu0nzekfIWPBA5PsnXyFl3XA2EFlaly2/gcDB9qavV0flQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248967; c=relaxed/simple; bh=eVcvBqQdVPNTqpfIQ1uOcWvSP+NDojr9eRpy6to1igk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LbwGAYn1azqGhB4vaSaEv1iE9YRLYzaVn8gbPzeiJmVYTA1VhX0cuOW8jEP8OyGJA5piBHW77+F/PfyNd1Vo+aN4IGmF/m9TJ08gxnmoRRgtOPE5RfGXfU098bVaI5sQhb1B71NSb9cTLa1/hRheptyP0h17wb9Ks/IFVLtZEbU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=jCFTkev2; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="jCFTkev2" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-3b9dc52c430so899444f8f.0 for ; Fri, 15 Aug 2025 02:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248961; x=1755853761; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ojzj3QqHYKTtweaj0hMdOf0hJWBOPE6yGgnAHCkCHqs=; b=jCFTkev2Plk8bz3re/jzfwWra49a9eF2rAdrkhtgY8gPB+PwMjkGC3i7Au+9USLmCS Ev947Ex2n92fNal2AzgxKjTxTUvxDgy41mDkkgodu8RRgxMKu6pOStf8qZBRNkOU0qFt Dwy9W/Ff3Mt9n09hiX2lbAk+dsvmuA1hsxlIReCIo1xLqfFZrMCgmJWrvIlLN7IUXUhb 0pc5Vb9SZeznSTST6BIMgoISCn86l48bQBOML09TkDRtQMNUJi1Bh0g3PZLkgBpI4DIQ uiKFfwomuBlg27MvsXn6528X8KUiptK7sAKu4zCZFPZpXcllypdIiEWoydlmmN6GV+B1 RaaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248961; x=1755853761; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ojzj3QqHYKTtweaj0hMdOf0hJWBOPE6yGgnAHCkCHqs=; b=wfwlnlojWQ58awIaf4Hlfkuf8bTgD4z6clV5c/sI7uDVkM5Hx+AMXyVnPPB0+ZEsun PvEv2lQxfo6vBGnyHGONudjuLyPGMB1tcFN7wPNn4wN+1wXfwGVp6jVR0k591orHu+nf W72FkCgHE0Ogn1CDho42eNZ/XtnMm7BzYO73oYxTuC8qSZzwiIIp/EhvQakH8wGpkyMR oP5+KNvRClCZeFfFcsSJ/BpWKGST7H2SkAS0yCugaukAjDjyM+Q+pP1FhL1TkAZq/cho 0PKKXE8/kFFeVYRWkPbYvOoPFGYHb1TQHRsHBVDnlztCR9lwPm8aPgtOC0SHVM0NdpTY Pw/w== X-Forwarded-Encrypted: i=1; AJvYcCXAT8llrNs5JePzeobudbtU41hGiB9Kpz04n4I02CgJ89zwKLaeQ0eW14JP0C4xkadj3o0T9LiMyDSTEns=@vger.kernel.org X-Gm-Message-State: AOJu0YyIIYcJtcV+jy707R3b3ewW2XVmlzN+qo9QDgFCM/D3kmW2ZRDO kfghzZF7o316n/QfyG4XBzmGvhFIy4OIntvzq3JA+z5qkrkgsyeuaZ3d1RzBzZb6A/0= X-Gm-Gg: ASbGnctf2CtOKTtqtHAg+AHpggJ1KACrO30+ZMWSex4uuFJ75gweRDpBY55YBqcn4tL AFjy24LriFFXj69HrOZPYT4Of4VKdewClhckdci9ook697Y9WnAt+4HQiUEAuTONzR/qr4pOHMP SEQlFbmFmO6KHZTj/FqtCvsV774syVFkCJJ3nmRDjRfe7ylGCcIumKPKOPF/xHoaSHbDn+Q/KWA 4Zyoj9crlL7bP6fK07mZw9fEh7KDkeyFWPDAudsCGhZucF+mMIvtsOmHknEZ5/LFpHWsGRqwzeg WxKHIYW0GEVBg3riyWcyiMBgOgMYOJQhjS+HMrZxYgZHsnf4e7ZrIDuB+ldrDcWK70pMsREczDD rclia/bdUNe+PMzXr1A== X-Google-Smtp-Source: AGHT+IGtmJEYn4U7YmpLO/UnNwJ6EK4RcP2OJYWSbB46JlVxedVPjM8m1PM2GiWKy64gcAhtC/Ebng== X-Received: by 2002:a5d:5d07:0:b0:3b7:9c28:f846 with SMTP id ffacd0b85a97d-3bb68fdd74dmr1039764f8f.44.1755248961432; Fri, 15 Aug 2025 02:09:21 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:21 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:05 +0200 Subject: [PATCH v5 03/15] pinctrl: airoha: replace struct function_desc with struct pinfunction 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: <20250815-pinctrl-gpio-pinfuncs-v5-3-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2038; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=Q2YZTvBFgTu9mhuvELDYkYIT0089SG8/1kg34izHMkM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk3wzetzN7ylJyavj+6V+c1QQuTYpigZ2o4z l90cHMgWUaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75NwAKCRARpy6gFHHX cnvxD/0Ve0I/ieyHdgZy9d8hX4H7/zjce73ldaR9BK31igi4keB/jOhJI9WaD35KudjwoaUzGzw jgISznL+LSmsieGquZ8+gBRfeDFsk/QkyYOG8K5axtVVBr5cN6yvlPqE/3RsS+N+YTgyNuGbLz3 3D0Kvx0W/BbHBYyiXduuXF0w47ZAanPPQIeTTrF2XJiwoFinOe9POqsFSEH1DnmaToCgV45o6uv XSFDNLIp+Xagtc/kXU3cGEPdgSqKK1eYR6znpNollDIzo08v+FU9a8dgAshxGM8OzP0F41sD1oj uVAI95wnWjHnUI+ljFBaGnnfo4fBgC/HqrxNMWogKyTUPZLR7IA9jvGoNOs4EEBDGL8GRCUfiMF KyL7e6DpCArbWK2HEuBRlZKngzG0Oa8V9FSW8EmH5qdI0soJjorpMeZXpmlMeRELL/NOoJZAhY2 nFfZvCfD1+NjIN3pugMpjt8A/DRMSOLMoplZdIiG0tpHth5Qz+TmjQ4o642CundaDH99bRBb7yo 4JM20LonHqzGzEqmyQ646wKUBqzowVpaLSC34ilA9XcwWx+OhyylRqAsH4mQf2VQEB0iko2OJxb X3jX4SHTXbdKXaoel6+wXODnpMTOBXpFUcWMHQLRNdqjv7BRt25Q9Eq+BqDBJtgXr/2udIPVNkE dmGtDLVs1fKVjTw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct function_desc is a wrapper around struct pinfunction with an additional void *data pointer. This driver doesn't use the data pointer. We're also working towards reducing the usage of struct function_desc in pinctrl drivers - they should only be created by pinmux core and accessed by drivers using pinmux_generic_get_function(). Replace the struct function_desc objects in this driver with smaller struct pinfunction instances. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/mediatek/pinctrl-airoha.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/me= diatek/pinctrl-airoha.c index 5f1ec9e0de213d587b68f41d3458cf504ee1b21f..eb6cd27955fbe462f479fbe92c7= 85588caee5ebd 100644 --- a/drivers/pinctrl/mediatek/pinctrl-airoha.c +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c @@ -35,13 +35,8 @@ =20 #define PINCTRL_FUNC_DESC(id) \ { \ - .desc =3D { \ - .func =3D { \ - .name =3D #id, \ - .groups =3D id##_groups, \ - .ngroups =3D ARRAY_SIZE(id##_groups), \ - } \ - }, \ + .desc =3D PINCTRL_PINFUNCTION(#id, id##_groups, \ + ARRAY_SIZE(id##_groups)), \ .groups =3D id##_func_group, \ .group_size =3D ARRAY_SIZE(id##_func_group), \ } @@ -334,7 +329,7 @@ struct airoha_pinctrl_func_group { }; =20 struct airoha_pinctrl_func { - const struct function_desc desc; + const struct pinfunction desc; const struct airoha_pinctrl_func_group *groups; u8 group_size; }; @@ -2908,11 +2903,11 @@ static int airoha_pinctrl_probe(struct platform_dev= ice *pdev) =20 func =3D &airoha_pinctrl_funcs[i]; err =3D pinmux_generic_add_pinfunction(pinctrl->ctrl, - &func->desc.func, + &func->desc, (void *)func); if (err < 0) { dev_err(dev, "Failed to register function %s\n", - func->desc.func.name); + func->desc.name); return err; } } --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B378272E6A for ; Fri, 15 Aug 2025 09:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248970; cv=none; b=El1hSm/KYAGyRM9GzAiJF0C07XWeAAWfGBcddW49NNyj2H669TFfPFOQopUyBzJiCe09x0O7Itk9ep2HZnj/yG70exRXIabbsYfOYvQ0azuQ0oAU6v58FD/fmZWtjMxWR4kMdF7idMdIo1mS3maZ0iQlY6qh5/ZxUH+fMpsuI6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248970; c=relaxed/simple; bh=AqBljAHcu9SEs+fMf1cVNWEroJaNcsABmNRiWlNYjLc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=txI7L4J7QaVreBZPoPzKqTXfHTa36NAqYix58V+TVkwOrSYwg8RgVNEan7ZxxFy+epImkNmfvGbgz0BsOSlEzgCX92CkcpU9YAe6ZNXBjnMMGjvZxjSGEXPTONSIenCNUFA3T3mC66XUlEXaEMyBwIBPvKYgicfsRzN19o5bYd4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=wMU6dzkX; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="wMU6dzkX" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3b9e414252dso907167f8f.3 for ; Fri, 15 Aug 2025 02:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248963; x=1755853763; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AxPihWEE9okM75l8p7+ohG5rL5D7+pdcAJ7iXomcZQ8=; b=wMU6dzkXi/qrBlyKM2ISCYREaM0l/Oj3X9WOdYgn8DxQ9DGxySmcSIf6isiaC+Syee /Ow8jY+oG7uzPMbDqnzC99z6cVz24JYOJ12xYbXkillkbndVh9onyDRtq6Hj/0B0EPTA NCCCJ8u0/dR6TNbcjTjUJnA4c1LjVdy1jmNssBTQ+MO8aRFX0E/sWhXxwf6hJK1o8SKj dRj1bFqkDyINo1sB/6Yki7R0e8TDhyHV8DXhEJT/tmPY2/Rwu8pGC8uEQ4U+JHuWGx+T k1G3xywo1DlTA6OIMA1dbvsBhmSmqWL6PIYhTv/hxxVgBbBaqvKUb77MrwtHIY9eKUrH a1pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248963; x=1755853763; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AxPihWEE9okM75l8p7+ohG5rL5D7+pdcAJ7iXomcZQ8=; b=Mk/iLXsawgZ0cbE/pNgsavvFUoU2kooL8PUrR2CsRCdgGZU2lATmocLmuL10f1se6h dkpZGD5X+kih6so2DDy6NXGg0+Zc/gbH6cVDkZ0mhFsD8gLo06f0Qmwi/eIbC7wxjx1X M1D44Fbxj55pp7RqK7TsrAzfTij+IyxJItsSk4pU3SqTvJegWHEcf7RYEJEMwBQUyulT GWOgw2UOQUhw2QK9g6fltFeVTExdCvQLIf5/ZPxVAx2kByVmNHBATMZLzSAuMCi/a0oF TqsAQiiruTZ/dkcfdNptS0w/bsomlcvvgRH8iCFYlBHYlCaJVCgc4HVx43kNhWCbI8ZW Ds4A== X-Forwarded-Encrypted: i=1; AJvYcCWVuPTt6646JpNJ7330UZwuJgBGmrSqQN9+w2bCSjS4wRty6FK18tYIV1Ev1ygZl0VsHEp51VqdG7Dep5E=@vger.kernel.org X-Gm-Message-State: AOJu0YyP+VlhFaTUAMz0eZEeS1I61EYs5TXJPcK1MZWkYYVNdQzst7E9 uWZNCGwgRrWJRTev5axtgsWrHG03FzMpRzfJQLWCWp0MOvXxz7AIZd4EmK5QHd5kZCg= X-Gm-Gg: ASbGncvM4A4o189onsI8ZTVN2S5dEKFFMehYwZK7IJjVR5qXYhv0AJ4nZWoTLkQKGpJ MaFlgaYyTw1sBgOxleKFiJYUg7e+4Ji0vwAM2Qgtz26yRdeuXVqtoMRCJv/5Kzi1wkPdMnzY7Ns S7VQ4e+WELCtAjwYBe22HKQTktdbyiZsNOpQY91ewr4+w9epzw63j8GvpigCn0ls36iOVQI/Xih /hpUztUQUGvBR8iDyESDPe8UNxqrySpC2Ry3HlB2Z76txWHiRAkIKnzs6HWew7PLOTjIoA/6DwW F9Rmcc1xvd2QUWDfko5YiSGfWfK/Oz2H0qkbSKwWB3rvkUguMYUxX9geT3o/cWm3dDeNYVZjQ+m tc6uMYGFqTp9u39jcDQ== X-Google-Smtp-Source: AGHT+IGUAXDLykutIpMPqR2CWw0jGljeultUDjNsFBqLcnpk3VzMMU1IX8ETkYGEQbzDEFH8gkziRw== X-Received: by 2002:a05:6000:18ac:b0:3b7:fbe3:66bb with SMTP id ffacd0b85a97d-3bb694ae9cdmr917909f8f.50.1755248963081; Fri, 15 Aug 2025 02:09:23 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:22 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:06 +0200 Subject: [PATCH v5 04/15] pinctrl: mediatek: mt7988: use PINCTRL_PIN_FUNCTION() 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: <20250815-pinctrl-gpio-pinfuncs-v5-4-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Chen-Yu Tsai X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2921; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=79i9CgDBpTwy0KAMS4vozziB177zSWYhoWrySFXqKM4=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk3DYcWcJpYjc33UdaGFLmDUkrwfiB7Cee3H F0qycSGYn2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75NwAKCRARpy6gFHHX co6kEACQTpYK55/OPgc7yEK07WFy41u732QgiT+adm0VgMyxXTaDg3lfMIGivUSairqhrEA9JW+ 09eDY5n36AeV+A12kqPw8HD35KZbHbtTuoMuHMk8P+d8gMiFVuEMv3adO2lTScoCulcZlBDOtv0 CE5E0kuD2RYWyiaDmsg4aMFCmrfKpA9uME09G9HtIMoR8quMRxZlpfvhLiOzU9tzn295FegYp+z eivL1my4FBTBszxeaQACTxWk9EcZm02fWxThXV78fuTHu5KcO9JBMiBhjp0IU1IMHsAuCU6KjjA PbZPnhp8foSt884XPFcFoF8Im2Pb3mFU7ej/3rozL+EoeYzM0mpAHCgurzi069Z/BCt61kpOM4v DLmQtREGwtgi1VHfLgTDVr+I2+6lyeAdtS70adO8lUvhssi+8nePshV7zWw/cE+sq86eQdx7ppk T4tfE5W0K8ZxeEEl+X3tM/O/wsnyN9fRU5QqfwC2Rr/nC3+sEjeazf3tjn3xBN/pDul6IJpRo2W 5Ser3RMdQd1a1WxD3wSOdrJdQWXgvjC3+ZEUGE8kQg8lh71EdKNPagZZ4a5H9cDHZfe4o8ZlFjl v4E2HQ2i4+hiRfpZlEG24sQIZhSOFo9nfY9riA6rOJSMosbGFdQfJHPUtUCSC2EazYpbBXD/YJv Xoc8bWRKcVnJQ2w== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski We have a dedicated initializer macro for defining pin functions for mediatek drivers so use it here. Reviewed-by: Chen-Yu Tsai Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/mediatek/pinctrl-mt7988.c | 42 ++++++++++++---------------= ---- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7988.c b/drivers/pinctrl/me= diatek/pinctrl-mt7988.c index 68b4097792b88356babe4368db7d0f60194e7309..55c8674d8d66f12d2f2246c2150= 56d4e51296a9b 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7988.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7988.c @@ -1465,32 +1465,22 @@ static const char * const mt7988_usb_groups[] =3D { }; =20 static const struct function_desc mt7988_functions[] =3D { - { { "audio", mt7988_audio_groups, ARRAY_SIZE(mt7988_audio_groups) }, - NULL }, - { { "jtag", mt7988_jtag_groups, ARRAY_SIZE(mt7988_jtag_groups) }, - NULL }, - { { "int_usxgmii", mt7988_int_usxgmii_groups, - ARRAY_SIZE(mt7988_int_usxgmii_groups) }, - NULL }, - { { "pwm", mt7988_pwm_groups, ARRAY_SIZE(mt7988_pwm_groups) }, NULL }, - { { "dfd", mt7988_dfd_groups, ARRAY_SIZE(mt7988_dfd_groups) }, NULL }, - { { "i2c", mt7988_i2c_groups, ARRAY_SIZE(mt7988_i2c_groups) }, NULL }, - { { "eth", mt7988_ethernet_groups, ARRAY_SIZE(mt7988_ethernet_groups) }, - NULL }, - { { "pcie", mt7988_pcie_groups, ARRAY_SIZE(mt7988_pcie_groups) }, - NULL }, - { { "pmic", mt7988_pmic_groups, ARRAY_SIZE(mt7988_pmic_groups) }, - NULL }, - { { "watchdog", mt7988_wdt_groups, ARRAY_SIZE(mt7988_wdt_groups) }, - NULL }, - { { "spi", mt7988_spi_groups, ARRAY_SIZE(mt7988_spi_groups) }, NULL }, - { { "flash", mt7988_flash_groups, ARRAY_SIZE(mt7988_flash_groups) }, - NULL }, - { { "uart", mt7988_uart_groups, ARRAY_SIZE(mt7988_uart_groups) }, - NULL }, - { { "udi", mt7988_udi_groups, ARRAY_SIZE(mt7988_udi_groups) }, NULL }, - { { "usb", mt7988_usb_groups, ARRAY_SIZE(mt7988_usb_groups) }, NULL }, - { { "led", mt7988_led_groups, ARRAY_SIZE(mt7988_led_groups) }, NULL }, + PINCTRL_PIN_FUNCTION("audio", mt7988_audio), + PINCTRL_PIN_FUNCTION("jtag", mt7988_jtag), + PINCTRL_PIN_FUNCTION("int_usxgmii", mt7988_int_usxgmii), + PINCTRL_PIN_FUNCTION("pwm", mt7988_pwm), + PINCTRL_PIN_FUNCTION("dfd", mt7988_dfd), + PINCTRL_PIN_FUNCTION("i2c", mt7988_i2c), + PINCTRL_PIN_FUNCTION("eth", mt7988_ethernet), + PINCTRL_PIN_FUNCTION("pcie", mt7988_pcie), + PINCTRL_PIN_FUNCTION("pmic", mt7988_pmic), + PINCTRL_PIN_FUNCTION("watchdog", mt7988_wdt), + PINCTRL_PIN_FUNCTION("spi", mt7988_spi), + PINCTRL_PIN_FUNCTION("flash", mt7988_flash), + PINCTRL_PIN_FUNCTION("uart", mt7988_uart), + PINCTRL_PIN_FUNCTION("udi", mt7988_udi), + PINCTRL_PIN_FUNCTION("usb", mt7988_usb), + PINCTRL_PIN_FUNCTION("led", mt7988_led), }; =20 static const struct mtk_eint_hw mt7988_eint_hw =3D { --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4EF72D3225 for ; Fri, 15 Aug 2025 09:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248971; cv=none; b=OiJ5xBWjB8auKD46RzYp6HQFJZiBs9kxtyWDNJPx1h0+X1nzn29J+XuZ4IfElLW/DMle0gAUWKzVqn83sJ/nA/9lkIoGqN505pP+VRQCjDhwKpQ7zlE6Z5NTKczyc25i0k4e0OVoKAcq52c/h5oPHd6YaBpthMsZRa4ut7S7ACM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248971; c=relaxed/simple; bh=CSmJ0hfP8RAK5IyMLaW7Q3B8iAjyvA/90HhyhsBSBCA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YEXmF+g0L+k/YPg6Hdme5BKiEtJ2XYRQtp+zXQSPSvUZy3+9ClfvV4FQB7kD+Y4h7RgOVNU7tpHc0NwOfIytULl1y1BYNNckbhnq2p+A4uWkhsG1ou25L+Kz5OADk6rMOJ8KhmGPe6HgxNwb7xQUcyUCN8MR1cznkoj0RNeFUeE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=WwtJK5uG; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="WwtJK5uG" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3b9d41bfa35so1462380f8f.0 for ; Fri, 15 Aug 2025 02:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248965; x=1755853765; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lc0/t4Iv6hjqG5kcGiM2/0kFYGiYqDN1ZHyY/21Fkb0=; b=WwtJK5uG0kG1i6jcsGCEZ5nDEQKc0RTOSoheaMvknQq+acd62NCw4WYO9NGR2DNE8D KBv5wVD4EpylrZVR+cK8DHrRZa6CeRUpP+AMD9swwTlRBpzqimxjZVym+3x0w8h9cOkX EqTY4MW71YwbdfKngtIesqcJAqcK2z3BVNyUxOgPgsdc0HmX2jLJMQyKGNYC1G0TwMX0 9DpV5qpqyyI3ziI4kXQUqopAib7e+Q87jzgMrSKei8xWHluLfo6aobu68E3KcYUbN6+p KJO2U+YnVagaoWzMjy+BjAZESW+s2/TkT3zZVFycRnaxQVRvzKYhn3f66olDscEOjNEI uTWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248965; x=1755853765; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lc0/t4Iv6hjqG5kcGiM2/0kFYGiYqDN1ZHyY/21Fkb0=; b=K0HxqaHbEkDy168sHmFyZlVIAspYdWsH0zleCU6O+5GosPfln0CJj58Rz8WJn3WIO/ e8fc4oxTJw3917p1RNfN+xsS60B4q7xdIfv1LynUhGqakPGvS4agJBK7IC/6AkfAp0p4 nGgbF2/wyFlHinXo9/2mfeGeAgDcFSKH4HnPCVv3NglaK/jArGy2FbG0q4ASLfNNHkuW BIPnSwpy2SgzrjNrHZpNaN5rjSIJJV9IKz2mEl8FOW/NIE8ikMEvANLltiU1hKBd8Rpc lqxlNjsrUSAC6isjCuTSla4uXlWKvSRg0zhDKsSJ62EwfxDfDcxS+gWqdkQyHqGaBhu1 /M4g== X-Forwarded-Encrypted: i=1; AJvYcCWHPv7b2h7cjIxUAeha8h4x/e0dGskUHHLPKcQFp0mzMHN2iVsXbmdKjd7Qf9FVlsigRAgDiyGfPJmYADg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6XREtEWJaxM+OUBtTHlniC2nQaeFTG8g4XrxSlche695ao57p gReYr1fNhFnpZSqT+h2jbJFW8GYKgXzlo513Mi3ciczxm0QbT1+db5BYXo0Han0PUxg= X-Gm-Gg: ASbGncv8/HXTHD01k4zWrBUS08LoiUuOSVgHoB3ZXcuk1uZ43UKNCrfEMrDdMJtadvj v3ziX7LzOOJyLUF3J7xUjDjvIqVu5ddgkGhGeFUD1V4wyZiE2fxqZonQ9LR3MaEd3Ev3772f9aA k86jyh+VQHBmffZR3p1EnMsOJmUgZYX41y6zW/ZD7em3ilQRhD9hXMe10VmZbgEd9iDze1VV7XP lRBAa/nM0QPKwsyxJxBHbmHD9F3rK8vj1t1+EzEOjtwKllzFGyIGYpPFieKY76aswfNUlVyi5gl /iv+9J5YBZkAsBZUlxgLX8+ZtWTXSNZ2qdUV6GF4UIQkwYIydwAQ9uDZj2XgrVTLh/4JK49L/Wn raYHqGAss6XNX0ly/sA== X-Google-Smtp-Source: AGHT+IH+JR178EPgAqIUUl1evmTTr1x2K4MvNmipyWtFLoqUSeH9zZZUWgL1QLgHWs1/dDUsekziEw== X-Received: by 2002:a05:6000:4383:b0:3b8:dabe:bd8b with SMTP id ffacd0b85a97d-3bb68a185bdmr1038820f8f.27.1755248964740; Fri, 15 Aug 2025 02:09:24 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:24 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:07 +0200 Subject: [PATCH v5 05/15] pinctrl: mediatek: moore: replace struct function_desc with struct pinfunction 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: <20250815-pinctrl-gpio-pinfuncs-v5-5-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Chen-Yu Tsai X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=7850; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=9BKGEvZq/gbYunbAXK1ZCTf6DpFoadfRkbzoE0vKzXo=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk3Pz4bZWLjCq9OyRjq8qSpMxa5kXSom7+Nn 9lVVbxSSICJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75NwAKCRARpy6gFHHX cgEEEADAOXrKLcmzOeYsONGvgBthO2HBAzQ+lHZSBTn2F4QfTiqTjYSCWNaboTo5PtgNThVrvQh q03BXKYFwL/7IMjsYlfsEvqd1EOZoAIZ4Jl4C+aPyR+gR+R6PiEP11HwNQqR1YYfYeebhhwZFnV PGUV3D1w79KrlhgzsufjmSW+c+YQ5WJZDMLqeF2ZEIexXPNTd4PX1GEQ/BItpda3fLlt9jdHGIn w/jhWZRzo0GJ7s96NhRyV935oS+cUacE8lQc4dU+mr3QHDktqexVN8WK9jUWelV84TnQ+urZSSU /G3E3j4GoUHaVtTJ/PdG2S+zWzrkeG++Qb/2lj7zaGKCEB9cftBmPP0atTegNaETtXqvMOvMkuo 6SyVCsGKxrPp6ee1wWtdEE7ferKv3Dn+lsozfP6rY0I66SoAdKGwsTNH4lFNo7FbZW/eal1TAE4 U1YWk3ZKnzLVI9f9dr4gebddux/zek7590VjrED7EbsHk08bxR5uKGYwzqpP7UcnMM4oTCpaD/+ +woGV9bb+PXmDDOzculdAJhPzGNlUSmRO9yqDjCbL3dcWPPjEO6TdXmZWI/0vg8dZ7OBAzI+1Ej 9QoidEbK+PWSuHQ1Oqt+9XFZODd2wRU2JiJ+s/PxtwTBjJdnr+XNmcem/7B6LbT5baypfHI3KPX MeYcfhyRNgbpsow== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct function_desc is a wrapper around struct pinfunction with an additional void *data pointer. This driver doesn't use the data pointer. We're also working towards reducing the usage of struct function_desc in pinctrl drivers - they should only be created by pinmux core and accessed by drivers using pinmux_generic_get_function(). Replace the struct function_desc objects in this driver with smaller struct pinfunction instances. Reviewed-by: Chen-Yu Tsai Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/mediatek/pinctrl-moore.c | 6 ++---- drivers/pinctrl/mediatek/pinctrl-moore.h | 7 ++----- drivers/pinctrl/mediatek/pinctrl-mt7622.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7623.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7629.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7981.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7986.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7988.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h | 2 +- 9 files changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/med= iatek/pinctrl-moore.c index 6e4f6c07a509326a8a7e88b2dc32635b22e7b965..982b9887521d036538f67e9919d= e444693c458c0 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -622,11 +622,9 @@ static int mtk_build_functions(struct mtk_pinctrl *hw) int i, err; =20 for (i =3D 0; i < hw->soc->nfuncs ; i++) { - const struct function_desc *function =3D hw->soc->funcs + i; - const struct pinfunction *func =3D &function->func; + const struct pinfunction *func =3D hw->soc->funcs + i; =20 - err =3D pinmux_generic_add_pinfunction(hw->pctrl, func, - function->data); + err =3D pinmux_generic_add_pinfunction(hw->pctrl, func, NULL); if (err < 0) { dev_err(hw->dev, "Failed to register function %s\n", func->name); diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.h b/drivers/pinctrl/med= iatek/pinctrl-moore.h index 229d19561e229c77714e5fccb3d4fb68eacc77fd..fe1f087cacd0446e40628cb4fa3= 5a135496ca848 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.h +++ b/drivers/pinctrl/mediatek/pinctrl-moore.h @@ -43,11 +43,8 @@ .data =3D id##_funcs, \ } =20 -#define PINCTRL_PIN_FUNCTION(_name_, id) \ - { \ - .func =3D PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_group= s)), \ - .data =3D NULL, \ - } +#define PINCTRL_PIN_FUNCTION(_name_, id) \ + PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)) =20 int mtk_moore_pinctrl_probe(struct platform_device *pdev, const struct mtk_pin_soc *soc); diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7622.c b/drivers/pinctrl/me= diatek/pinctrl-mt7622.c index 2dc1019910662a2a52e81f277a10a32bd83b33d4..d5777889448aab86e82fa6821fd= ea0d30a5a7246 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7622.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7622.c @@ -822,7 +822,7 @@ static const char *mt7622_uart_groups[] =3D { "uart0_0_= tx_rx", "uart4_2_rts_cts",}; static const char *mt7622_wdt_groups[] =3D { "watchdog", }; =20 -static const struct function_desc mt7622_functions[] =3D { +static const struct pinfunction mt7622_functions[] =3D { PINCTRL_PIN_FUNCTION("antsel", mt7622_antsel), PINCTRL_PIN_FUNCTION("emmc", mt7622_emmc), PINCTRL_PIN_FUNCTION("eth", mt7622_ethernet), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7623.c b/drivers/pinctrl/me= diatek/pinctrl-mt7623.c index 3e59eada2825277b3d7500cb1f2cf740242a4a8b..69c06c2c0e21e4ce785f6553925= 4eb070bff9a0d 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7623.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7623.c @@ -1340,7 +1340,7 @@ static const char *mt7623_uart_groups[] =3D { "uart0_= 0_txd_rxd", "uart3_rts_cts", }; static const char *mt7623_wdt_groups[] =3D { "watchdog_0", "watchdog_1", }; =20 -static const struct function_desc mt7623_functions[] =3D { +static const struct pinfunction mt7623_functions[] =3D { PINCTRL_PIN_FUNCTION("audck", mt7623_aud_clk), PINCTRL_PIN_FUNCTION("disp", mt7623_disp_pwm), PINCTRL_PIN_FUNCTION("eth", mt7623_ethernet), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7629.c b/drivers/pinctrl/me= diatek/pinctrl-mt7629.c index 98142e8c98011d17339da74f61d6f917372dfcd5..cc0694881ac9dc536db0e46eefe= 5eb7359735a60 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7629.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7629.c @@ -384,7 +384,7 @@ static const char *mt7629_wdt_groups[] =3D { "watchdog"= , }; static const char *mt7629_wifi_groups[] =3D { "wf0_5g", "wf0_2g", }; static const char *mt7629_flash_groups[] =3D { "snfi", "spi_nor" }; =20 -static const struct function_desc mt7629_functions[] =3D { +static const struct pinfunction mt7629_functions[] =3D { PINCTRL_PIN_FUNCTION("eth", mt7629_ethernet), PINCTRL_PIN_FUNCTION("i2c", mt7629_i2c), PINCTRL_PIN_FUNCTION("led", mt7629_led), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7981.c b/drivers/pinctrl/me= diatek/pinctrl-mt7981.c index 83092be5b614cc164590fe5ec2b756fe6579b263..6216c2e057f6499b32741b6bd3a= 4854878c061c9 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7981.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7981.c @@ -977,7 +977,7 @@ static const char *mt7981_ethernet_groups[] =3D { "smi_= mdc_mdio", "gbe_ext_mdc_mdi "wf0_mode1", "wf0_mode3", "mt7531_int", }; static const char *mt7981_ant_groups[] =3D { "ant_sel", }; =20 -static const struct function_desc mt7981_functions[] =3D { +static const struct pinfunction mt7981_functions[] =3D { PINCTRL_PIN_FUNCTION("wa_aice", mt7981_wa_aice), PINCTRL_PIN_FUNCTION("dfd", mt7981_dfd), PINCTRL_PIN_FUNCTION("jtag", mt7981_jtag), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7986.c b/drivers/pinctrl/me= diatek/pinctrl-mt7986.c index 5816b5fdb7ca918486f57a890f73543b3198c728..2a762ade9c35505505c932b6fea= 75fa0cf77d961 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7986.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7986.c @@ -878,7 +878,7 @@ static const char *mt7986_uart_groups[] =3D { static const char *mt7986_wdt_groups[] =3D { "watchdog", }; static const char *mt7986_wf_groups[] =3D { "wf_2g", "wf_5g", "wf_dbdc", }; =20 -static const struct function_desc mt7986_functions[] =3D { +static const struct pinfunction mt7986_functions[] =3D { PINCTRL_PIN_FUNCTION("audio", mt7986_audio), PINCTRL_PIN_FUNCTION("emmc", mt7986_emmc), PINCTRL_PIN_FUNCTION("eth", mt7986_ethernet), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7988.c b/drivers/pinctrl/me= diatek/pinctrl-mt7988.c index 55c8674d8d66f12d2f2246c215056d4e51296a9b..9569e8c0cec15fb6a4a8e359d64= 83fa163487b0c 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7988.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7988.c @@ -1464,7 +1464,7 @@ static const char * const mt7988_usb_groups[] =3D { "drv_vbus_p1", }; =20 -static const struct function_desc mt7988_functions[] =3D { +static const struct pinfunction mt7988_functions[] =3D { PINCTRL_PIN_FUNCTION("audio", mt7988_audio), PINCTRL_PIN_FUNCTION("jtag", mt7988_jtag), PINCTRL_PIN_FUNCTION("int_usxgmii", mt7988_int_usxgmii), diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h b/drivers/pin= ctrl/mediatek/pinctrl-mtk-common-v2.h index 36d2898037dd041ebc7e06526ebc085eb42f2828..fa7c0ed49346486ba32ec615aa2= b3483217f5077 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h @@ -238,7 +238,7 @@ struct mtk_pin_soc { unsigned int npins; const struct group_desc *grps; unsigned int ngrps; - const struct function_desc *funcs; + const struct pinfunction *funcs; unsigned int nfuncs; const struct mtk_eint_regs *eint_regs; const struct mtk_eint_hw *eint_hw; --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E95432D0632 for ; Fri, 15 Aug 2025 09:09:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248973; cv=none; b=SvygMnOmIt0APLkPuBYcCj3+z4FYH43vnLYflz7vIxiv5DO6diKSTpbS53c06uzp+9bXOeLuQi1irPNuT7K00BREkfpV19Hho5uFp+vTJm29B4DlSbolkExTDgvfMCTwvJ+e6Cjpr3wxMf6OKWvUUrO2twEN8eswSG4b05FzLdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248973; c=relaxed/simple; bh=NN8N64azTZ6Tm9oD0O4UPA4GBXyAY9HuPJ1OulPwzrQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sVzJYUPiKhrx61/eWkAFEJ8xRc0t1iM/tsDytSVnh7R7Cw9qO2x7lbxf5VBdwrTuHRKUGPa5QcJDOWcMTT95DwQGIuX47YoC1R0Vlq4fAsDT5RRJOLdr8/MYpV5S3KAxO39/COyK4sN/omC1aYOkGsvjb/i7rHXGFfjdQIbTjBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=swdsSh3s; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="swdsSh3s" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-45a1b0b42d5so12670265e9.2 for ; Fri, 15 Aug 2025 02:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248966; x=1755853766; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EnhxaXfLWBAe5wxXyN7EB4a4qBStRGqZ5wQqNK1Gqy0=; b=swdsSh3s3SU12RtjPYT5MUtEhMLtTBTUL/EzJgufM8flszYOOxCBTaSXLGfOV1wfI9 Pp90nuHhbGoYDXLv0IxJUQBvYOYHCAdH/GzRA5nIvUfgrqPFiQxfrDNyhIpyH5W+5UoY flB+OkFxhJ9ZkvULHtyuTMu4N6koOQEcuvFCeLE0jg2gTmQaxYQtIcpm6JyPN2uvhyjq TcnwJTD6WdaY6E5OVcD0TuanwQqE5Yd4kcUuD4JXlUZaaXiomP9IoCvL1vEZ4G2zD7d7 AP+wMRCBwiRKYyw0IwoMANY87qHyv/wG9nKJ0HjsG4+6SOhdPpTux7r1vV/7MeveDHW6 pTSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248966; x=1755853766; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EnhxaXfLWBAe5wxXyN7EB4a4qBStRGqZ5wQqNK1Gqy0=; b=Gai7Ak7qC+8m6GREvRQ+3UBYZFDNmrAsGnFlrsC76o+u5CiRT5aOHlu1PAfAmo7apb P2Nr/xeHPuwFE/F5ogaeUk2/SvHOqW0gO7K7cmHowmETfBfr7tonu4N/9BnS0fwBabNI Q8kWk/9EY3nNPbUMhRaRwEOU3sSHIt1ubhwSInGxBvY85wh/MFhIuYvs734RC49SSdHt CCGnAl44B6j9pThj/42M846B/l3HdL3KUEjj0gHsQue/h/x8zrSNllUNy2bw8jLbWU7l MNPq75YcAIzyRW1HBs22buYm25K8mpwCPhSnDIcGTakuBb5um6GVR1IHbtRfRsb1S6MS Xb+A== X-Forwarded-Encrypted: i=1; AJvYcCU7zoujX+C+GX0ovc8523NZZZRb3ijd6sIQrR1svdcvK4BOIyygLxRcr+D6AMajiUvZk1r6hESlI8hy17k=@vger.kernel.org X-Gm-Message-State: AOJu0YxNxXQ7d9F6fZ8OlsUDZQJI0o9pjcVwggbd1FmyvQ7p2jtC2sT7 K4suxMrLs6rSwv4CuUJtsIIAaSTt757eqCpr9bGHLb5smVmt2VBk8VHCl5Gc3uLZgmc= X-Gm-Gg: ASbGncs2yDXCYqh6+r9lUaItInKwxSUD2QhtRWpTz/tZDed0OaT5Dm2hgczvhoTgorb BTGr4cosl0PUa6upM1HNL1pQirMeNIL5yuIJyb77gGizZUVAd4QL2fYFuuWG+vLoUSBnjMj36mB xA71gtfXUHeKTQ5esdAsAgA48TPcaNVOe/RuAFeO8TC7dUTQ7jwS/7AGm5Ktm5+sZoh8oBTyFKl jm36G6XkmkXwWsmj2SvwXG5o7MonR2f99k8MdfHQy0WDPy27e//drVAnqoCLROLwKWWMHk7xuoK Fbmg2UU9MRx34396shSayFhzS+9r8AZMbxe8JroVcZnYDXLm4GkOHfMSohr5ySQfcUytlJmtsAn ezsxRHAYP2nt6B6kaFg== X-Google-Smtp-Source: AGHT+IGrKalxRH2emMVFhJl/BSNAcO1PZ0/C3WQ9SuFSJDnEC4sffp01HAuXZ7aewRxm96m4CMiqDw== X-Received: by 2002:a05:600c:45c8:b0:459:d667:1842 with SMTP id 5b1f17b1804b1-45a2180461fmr14807625e9.12.1755248966340; Fri, 15 Aug 2025 02:09:26 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:25 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:08 +0200 Subject: [PATCH v5 06/15] pinctrl: imx: don't access the pin function radix tree directly 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: <20250815-pinctrl-gpio-pinfuncs-v5-6-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3088; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=FuPiesxsrAA0Rn9DkOactcvX9/BHBoNthgyhyXGEhH0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk3rpCdQt6oBLFE3JhUek7wpG6X1F3lNHhRD 1xBSnpghMSJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75NwAKCRARpy6gFHHX crmbEADXui3pd5txQPs5OswgHt+SSwhRPgY5VgbCuLzFGwr/2pud+3IwLJwQv32sg5biLycFPIS tgqKV2jg1ezhF3AuxuIS6nCEBUC25Q4ocf7Z5bIG1PaVNj4kx8CSRz3xaBNqzSIggrfzcGSDKRV vkfdoThbQz1qBjCZIGDtAxHee64mmlelkG9kaF77q9JSRcOTZX6A/dACXHIDwKOuyzV2Uvm1CQZ ElBeUIRyu4lx9a7VMF/jP6aewEJE2p1wugJvkvSI91B+YhvnkPrqA/QqGzYrxlHqflJy98WygLu VlPXlUsXqP5POoIbK6S3GDkQCnr22v9vHBTmkOmJ1H1flKtn+0JuYy8JwUFHe3h22Dl0ChZU1LS 95/YKWnICS0nBiAFltHYmCDB1oIqxpBTQ16DUA5SSIcy+8aUUVJbvJafN7qVlBjOxUFIujaietr CGqK52H8fm5AmTAOmZ3WaCns5oKr+XuL+/h5SpO+GfhHrfeOF3DNb/EI2Y1jpV8t7GGsBzWu6W/ Uo2gOtnoUPeWQEEW8J0qn9wdPXQc6uep1CXJVXcOOOZYG5XCIWOs+2CQm9FXoxOvfTaYa85+cwq t19ujQgkGk9zToTdGziHLee8zGBTKfXUwoa2g5obhZ0lJVJ7RLtUYDhq9oSn1tU9lVBWfPBWx/H CIIk4Htmm9oBG1A== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The radix tree containing pin function descriptors should not be accessed directly by drivers. There are dedicated functions for it. I suppose this driver does it so that the memory containing the function description is not duplicated but we're going to address that shortly so convert it to using generic pinctrl APIs. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/freescale/pinctrl-imx.c | 38 +++++++++++------------------= ---- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index 18de31328540458b7f7e8e2e539a39d61829deb9..d5d42c9ad5fe9dcf7c25ad39368= 8e714b02db678 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -580,33 +580,34 @@ static int imx_pinctrl_parse_functions(struct device_= node *np, u32 index) { struct pinctrl_dev *pctl =3D ipctl->pctl; - struct function_desc *func; + struct pinfunction *func; struct group_desc *grp; const char **group_names; + int ret; u32 i; =20 dev_dbg(pctl->dev, "parse function(%d): %pOFn\n", index, np); =20 - func =3D pinmux_generic_get_function(pctl, index); + func =3D devm_kzalloc(ipctl->dev, sizeof(*func), GFP_KERNEL); if (!func) - return -EINVAL; + return -ENOMEM; =20 /* Initialise function */ - func->func.name =3D np->name; - func->func.ngroups =3D of_get_child_count(np); - if (func->func.ngroups =3D=3D 0) { + func->name =3D np->name; + func->ngroups =3D of_get_child_count(np); + if (func->ngroups =3D=3D 0) { dev_info(ipctl->dev, "no groups defined in %pOF\n", np); return -EINVAL; } =20 - group_names =3D devm_kcalloc(ipctl->dev, func->func.ngroups, - sizeof(*func->func.groups), GFP_KERNEL); + group_names =3D devm_kcalloc(ipctl->dev, func->ngroups, + sizeof(*func->groups), GFP_KERNEL); if (!group_names) return -ENOMEM; i =3D 0; for_each_child_of_node_scoped(np, child) group_names[i++] =3D child->name; - func->func.groups =3D group_names; + func->groups =3D group_names; =20 i =3D 0; for_each_child_of_node_scoped(np, child) { @@ -614,10 +615,9 @@ static int imx_pinctrl_parse_functions(struct device_n= ode *np, if (!grp) return -ENOMEM; =20 - mutex_lock(&ipctl->mutex); - radix_tree_insert(&pctl->pin_group_tree, - ipctl->group_index++, grp); - mutex_unlock(&ipctl->mutex); + ret =3D pinmux_generic_add_pinfunction(pctl, func, NULL); + if (ret < 0) + return ret; =20 imx_pinctrl_parse_groups(child, grp, ipctl, i++); } @@ -669,18 +669,6 @@ static int imx_pinctrl_probe_dt(struct platform_device= *pdev, } } =20 - for (i =3D 0; i < nfuncs; i++) { - struct function_desc *function; - - function =3D devm_kzalloc(&pdev->dev, sizeof(*function), - GFP_KERNEL); - if (!function) - return -ENOMEM; - - mutex_lock(&ipctl->mutex); - radix_tree_insert(&pctl->pin_function_tree, i, function); - mutex_unlock(&ipctl->mutex); - } pctl->num_functions =3D nfuncs; =20 ipctl->group_index =3D 0; --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11BCF2D1900 for ; Fri, 15 Aug 2025 09:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248975; cv=none; b=KTfNvDLusLyKr0bligffgCW1n+qOxb4uLwlNpLCukWE4dh4c/+p77DhbARHK4NXYfkTgAP/YUGa/tlKCRkHgrN6IYKkeiFeZChoSumLInCKdA64KVTcfuablb7T7ZYhFIPRSqW8K6jwDcOYbSptwkGMUEYtIvXTbQEsyJ7Syhjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248975; c=relaxed/simple; bh=8LckYYbv7wEiVDCoVOTbwt+nYJz1zV0AkW539eEIzwQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q2Cw3GJC+rq9GJNRqEiCybVKbPABcscVNvaD8fVhYcxWaeGY4yx1o43lTMsXAYzY1HPock76O+HWAtmfyA1a9YnOhOxBkDq1oH8DT17dmHQu5RzIgHL/5SPFwDgWxRX4Fk1pU4xOV+zRj8EAlAqBzBNDVpDnvhvjDKX1fR6SdWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=lM5FrsUA; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="lM5FrsUA" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-45a1b0990b2so10728235e9.2 for ; Fri, 15 Aug 2025 02:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248968; x=1755853768; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rcnhHIb6eNEwdjxZYrigpF4SQxNgYqLi3t6s+DqhmIc=; b=lM5FrsUAZ/iISpG3qH9ZcIwprw9a5mb+dMU/g6T6QSymbTgFeTxAkspSvMpcpse1vX e7JoFpggf74TCyxb5FdkCnvLW3j2g18xAcE2qJ3vvChrPhog8VNXh0xJ7VFdHYFy7ERr EGBxg0aNma3d6CIMpENev5u4bMuV21t/RsaW0Jqp9hWEakUJNOrkfU7GWOLSPHwGM35g BA32azQjH4cGCKMs3D/efysAK7DDheWxS4YH0CiaA/KkQ6uGEFsIFXdoEpWidxCJL46n z7MoS5/mHxaFU6lUzDNrbMp6+OxrzlbN1+ROiJA9XiFvXOJSI98PHx8P4mLyapK7X3fc zJvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248968; x=1755853768; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rcnhHIb6eNEwdjxZYrigpF4SQxNgYqLi3t6s+DqhmIc=; b=hbJ50CqH0UEyAzGqFokaiIHeTizzyzLSsxswsRxIzX6NCpu80oTcSfsa2lBk5BaluR IKmH1TF9efQF1pWKWHfjb4HntkM3k0ooMzDfJANXUtmrS2SberwPkS6DHUcy7nSo73Fg ZJuDHQXBWTOvN0usLZu40pkTvmhZvECbnRxBt7aEySu4X/GBidmyhnb8p4yOnYgSk18G tzg1mB9ffpAPuJhC98kDIIfDoshNgMtx8+QvF2E/O48dqJD7EAY19PGYB9z3fs9Ku8dl xlRUSBqYUIKL07tSGW7IK92ZEFGRwFU8bujZyqi6GFD1hnPkGZnjs/8L1ggVIT4IujrP TgrA== X-Forwarded-Encrypted: i=1; AJvYcCXjIX9p+LQF6is0dfgw+KHASLi/cxlJnhfe+1669PDBPc7Mn0Ql1uYyTwr/tOu1zrw8epT4Z/arD6NrjJQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyeD2GBD4ldU5Z1ftzMTDaW9Jg1sEm0vR7OXyrNiIci4mPbLaQF h55rPCrhK7yLHxwNi6A39JOGENhFkayFU8UocgFXsKdwqnA7R8fYQNlDmpQc6IrfY4Q= X-Gm-Gg: ASbGncvsrll/shFyRfLGkDDVqcfsJQouTs93dVe52pXuADuqOYi34L8fe4yoI42S9OQ mygHfoiyMthYgQngWSA05inhi/+n7x8uu+xRVhpth/EtdlrJ//GnsEm2cRO4grAyjnT75CTSeWS 5kBYlfZI+XymZP6cLEu7jWOwjNdLWuXSv/Sqz66tgj561pXyr8wWtKl3bmGANQsgcYcL94LppzV fD5oA7eyTWnkOwS4pgjb0mkSnUnMDwt5L4+EWvMP7iK9pND+Rx9dFp4GoB7eJUyXK0DBUOsx7Q9 sXXvOY9j/cA6E4b1/56vcoBCFIzS6CTLM0TAw9LTnDlfxXOkoMg+l4lzFJqpz+Wm8lqIZk1pQ5P aF/77TMsXxX/OuvGpDw== X-Google-Smtp-Source: AGHT+IECk334T6DAR4a8TS6EmWlh7UZ1cAoTGRWibGBdabTMKZmowz1e9Ft1rEqZaj0/xx+92lKCEg== X-Received: by 2002:a05:600c:3596:b0:458:add2:d4b4 with SMTP id 5b1f17b1804b1-45a21803ebdmr13438335e9.12.1755248968009; Fri, 15 Aug 2025 02:09:28 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:27 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:09 +0200 Subject: [PATCH v5 07/15] pinctrl: keembay: release allocated memory in detach path 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: <20250815-pinctrl-gpio-pinfuncs-v5-7-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1867; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=qPaUa8oAewMMgl8vCYU8JU6h4WrDoK89nonD2PTBKh4=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk49vTvI4Yqki2vhfowvJ8itgBed07OfvWWP 1IW0D/2sAiJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OAAKCRARpy6gFHHX co8/D/9RViTI69yJDAM4EMnxpBHjTbkjgLCo5+12MdD6irQvlPH7WAMDEHdgXHTfPuZCBslRHDn F681CDNXek0ARfTKOVwzdElXzOuvo5lfXVhpGWSo6l/hIEvn/8FvOQKWjbblDOQBRaPA4kW/SsT PX0h2zSSKtBSPAgqPlNsj3Hrjk02z5swiKfVNby/Rf75Gmt3jrn1gicqYNy4XvAdvk8MfssoZ67 ILV1I34DYFex70AWKbHeILC0np2n1j0JNkhqPrZW98Pb8Fs0D2ZBVUAWwSBYZHOTEJvcetF0ptk hgBOxHPAlBP1/ZOqzemRwR6dI9QFVOBr7WXCBrHngAGalo4je2J0NXKdLUKMdxskRm4eC4yalT9 vRvVjU/79HbKWhgGWCMMx5Yqu4cn8xAgkTtnpB382uQCJA33DiwPkovDMv+sdXi6PT3XORi6b2C dw4oNnImVUmuboHfeuZ2yL1MBZjfbpanOwrJp9ctvS1yWQHZG5n42OosyJncBXExsKHd+EdepP7 UdKsNk5KwjnxNWyAi4y2GVvTE9N8ZJNJlbjNuGv2CIE2tr7kd/JRzZaj8hvlYwXIdp0un3ZUhX8 ut8bcXSn36AAFe5iXHWX0OLQHgarcKs4M1EDx+6cfYjBM8lnOjLezxbetYfeTZSYpZEZMac2O3I zIs9a+PBsdnaHXg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Unlike all the other allocations in this driver, the memory for storing the pin function descriptions allocated with kcalloc() and later resized with krealloc() is never freed. Use devres like elsewhere to handle that. While at it - replace krealloc() with more suitable devm_krealloc_array(). Note: the logic in this module is pretty convoluted and could probably use some revisiting, we should probably be able to calculate the exact amount of memory needed in advance or even skip the allocation altogether and just add each function to the radix tree separately. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinctrl-keembay.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-ke= embay.c index 60cf017498b32a9f36a1f8608e372951c2b8f12a..6aefcbc31309995ec1e235416b4= 0aab3e4a073a9 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -1603,7 +1603,8 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) * being part of 8 (hw maximum) globally unique muxes. */ kpc->nfuncs =3D 0; - keembay_funcs =3D kcalloc(kpc->npins * 8, sizeof(*keembay_funcs), GFP_KER= NEL); + keembay_funcs =3D devm_kcalloc(kpc->dev, kpc->npins * 8, + sizeof(*keembay_funcs), GFP_KERNEL); if (!keembay_funcs) return -ENOMEM; =20 @@ -1634,7 +1635,9 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) } =20 /* Reallocate memory based on actual number of functions */ - new_funcs =3D krealloc(keembay_funcs, kpc->nfuncs * sizeof(*new_funcs), G= FP_KERNEL); + new_funcs =3D devm_krealloc_array(kpc->dev, keembay_funcs, + kpc->nfuncs, sizeof(*new_funcs), + GFP_KERNEL); if (!new_funcs) { kfree(keembay_funcs); return -ENOMEM; --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B09B2D738D for ; Fri, 15 Aug 2025 09:09:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248979; cv=none; b=W+VzJoG26fxfCICZCU3YPXp35qB+DJG9Aek57CTzKhHRun4eP2Yd49oG48f9Zz/Qz+u/lN1a074ghtkMd7MD9pEF3L0a84bCQfDGIN1fZ1qIM/tXFNR+hCkpI9PEgfSElDha6Ylut/hVglmeTEnFYQW4IC2XvYFqG6/AmId93Aw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248979; c=relaxed/simple; bh=HSTxkhC3WyBFM1G4jv4j8GQuTAWxbn2e8t0aXkOzg+Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V3MbzGx1lfvh2fVGbqezm3rjYnCiKbbrfpGByv8q58fnKkdLqOD6gg55Ze+0lAIEFt1SH3uIAjXRSumUo/mXyTrySvFWamrKQ7AKdlg1tk6FoGAmLceG5MsMsGYI0io8MN1HkS1wVq15zVg7xhYybOIBVCGeRjnkSQlVUZdMJew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ze+NKNg7; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ze+NKNg7" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-45a1b05a59fso11723255e9.1 for ; Fri, 15 Aug 2025 02:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248970; x=1755853770; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Sg6yGo5rWgbm4nmbYQkhIExx2oT2rNxy+gO58coC/aU=; b=ze+NKNg7MAVoYEpAs9cqRkqpt7tPvRqQn5J8w0Ph4MYNHJQbInwYGtMH1VHKAo8KKZ UX8FAqckxv/iW6LGkK1PMNIRC5LRkh2AnUVM/u8N7sy+7X+gtjp8KkWAVEkYMdX6iNfT a5UgkU0nyLa0RA5ByICi8QVLQexrMGSDb4pFyyS+uOJPfgQivsE2RwWpsPkUYxrdCk+/ 9g0DTmFZmEvNeSxaqCN3F64z8aHo5/cf0GGFDhihPUtY7EZ41Rviafe0623jqSbLNbVG WFFv00w6AwiAmCjzbqgasAX7QDE56whswRSZlr1cj8Ncp5Siq33EqFzIjAS1UEXWHXBw X/Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248970; x=1755853770; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sg6yGo5rWgbm4nmbYQkhIExx2oT2rNxy+gO58coC/aU=; b=KadGakaAJpcrBvOxgS71AbRflO8K/CGqAdiLXXccUSYsPhNnb4g1EQ8JY6HGFNJl6o J/4TxLwhyQg73o1oKUvk9HJFBmpNoC+krrQEeaxmksZenR5O2gT0KFbaueL8z5JTg1Pf sScii6zsvr4vXk0rcgzJzk9GjatoIJuoVNjN3LENQHHS845sjY0opnPk/2dDLDiSmTHy MW3KE5rQx5+lpDYOsGT9fNJ+bIH4XsqAYfjnxAfF+Hzk6FXeOF4ELMqcSJfiboM7LxYM UFNfyTeP2UM8rTqwl4KchOcVdN+aP1SL9mMZQ9iET0Q9b/F5KolZW3l0WNe7fgklpV5K lqyw== X-Forwarded-Encrypted: i=1; AJvYcCW2EeDxouaBLT02z4pcVUke4l2izJ94j3pGYuogiCm3dp35gFKE7PFpu7il3Dv1pW7SPc/b+h9gkOSdOkQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzIDszvZk48j+6Gvo77/GUe/tAIvHGblJcqGATTtKheIdibKXbk cslISPqVvFcCWDFK6cW/ZhYPhIZfBw9DDnNvynajbXn1rWkYqmwSsKN/GLnkQgpTWqk= X-Gm-Gg: ASbGnctDeeIj02YH74UApb4SdjWRnWjQOwU/7WArBlcHqbo3dreGhhWyhoPgHL7Hl0J u14d9G7/5fAuF/zDdzy0Gnusm9I4ZwKOfgeb3KCikZG/WlHumNay1GsUbYfb/AztfRdeYLkdMsC ZsyfAJiV7xWqKM6OnTcVpShNvfYGiCoKgIyTIKuZXmkrA5mj8t+NzUcHZ+N3URcXyt4FX3yrSSU 2/fPbHXURoqP0h+vnU8GP46KLo3yzeuVhTiyNUC0+RyocZu6x/njvXEBckXdhSQINGVeCXu+g6s Am57vFkLAONnFWf8uuEjVK2IMCrBwRjXQbmYlrWJ6aRQLpNJzUU+3Nu5netTPJOR6bMFc8a10zW O1nPaANM26Rzqiti4iA== X-Google-Smtp-Source: AGHT+IEuSRLd3B0h4SE3RR2S2yHycoqFTSLj7jDNuZgFZPq4txV7qE0+ov1t4k8bQpePbvf3meSvDg== X-Received: by 2002:a05:600c:5286:b0:459:db80:c2ce with SMTP id 5b1f17b1804b1-45a21e7f2e8mr9560235e9.7.1755248969664; Fri, 15 Aug 2025 02:09:29 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:29 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:10 +0200 Subject: [PATCH v5 08/15] pinctrl: keembay: use a dedicated structure for the pinfunction description 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: <20250815-pinctrl-gpio-pinfuncs-v5-8-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2974; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=HD9TOJpRmpG6enieox3SLEnzfmanpdaE65mOB6T5MYc=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk4AelBkHWJWZSjBIznNV8JlLBDYLHWXKinX +GiHJ5uogmJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OAAKCRARpy6gFHHX codHEACM4UcW4XmQxoTdvJG0sbAVF+QyQHCaGbqkMyiyny6aH7RK2tq8Xl6yZSAoDRX9DIkdLsV cjvfs0JZcnSCGBsxTN0eEICrrspOHQJRa0Wz7f9MKd9Mfp7PkVGQBphWEZafv185lvBfoQYn10/ KMtkOfMe5hOMHj/bH0r2Pc+DV6X5sEMdx/LSX4oRC8+cpTqF3s+mMLqSOrQN1alY6PnM/461gt2 eI0f1lIQyiWLUH6ciwIJP9DWMIWGmXQP+TPp+em65RkBCAYoqFmoeyXOlz2RCO8St5K6+fuqAFp 5nFyEPiGfSr/wntSpNNNoZNz0fVOdELEgqJ0275bDqBW5cek9dhFtaO6MFMvPn1FGP7wpac46ie ZX0acGHA+eBIISkExKYmPTBWlX4UNY3tLCaHgedPbnTVe/8blQMS+jtcmlT8N0vTDcLPocFUqVm m98XIN8qONHj6xwZHnc05CyexQgealE1ZYeYBYHkpC/2FWyUzIpZ0dnN2HiEpj8H2J0+PoZ1l8A ZguDBgwMeJJF1j0ZYFn4ZZKDu8zgJoZeGsNcp1BnOb0+ALnGFfMwsfTeOg4e6NiqXThqwizkUXp 0ln7J9lak+xaWe5YElclyG7HeWIY7RLTvgOSJd+mhwsTItLmpI417ypQDquLMvaUrdEKVlQwWyM 1H1INlqKY1Feo3g== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct function_desc is a wrapper around struct pinfunction with an additional void *data pointer. We're working towards reducing the usage of struct function_desc in pinctrl drivers - they should only be created by pinmux core and accessed by drivers using pinmux_generic_get_function(). This driver uses the data pointer so in order to stop using struct function_desc, we need to provide an alternative that also wraps the mux mode which is passed to pinctrl core as user data. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinctrl-keembay.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-ke= embay.c index 6aefcbc31309995ec1e235416b40aab3e4a073a9..e78c8b3ec245aad56e3e74a26d2= 7c41ba4a98281 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -135,6 +135,11 @@ struct keembay_pin_soc { const struct pinctrl_pin_desc *pins; }; =20 +struct keembay_pinfunction { + struct pinfunction func; + u8 mux_mode; +}; + static const struct pinctrl_pin_desc keembay_pins[] =3D { KEEMBAY_PIN_DESC(0, "GPIO0", KEEMBAY_MUX(0x0, "I2S0_M0"), @@ -1556,13 +1561,13 @@ static int keembay_pinctrl_reg(struct keembay_pinct= rl *kpc, struct device *dev) } =20 static int keembay_add_functions(struct keembay_pinctrl *kpc, - struct function_desc *functions) + struct keembay_pinfunction *functions) { unsigned int i; =20 /* Assign the groups for each function */ for (i =3D 0; i < kpc->nfuncs; i++) { - struct function_desc *func =3D &functions[i]; + struct keembay_pinfunction *func =3D &functions[i]; const char **group_names; unsigned int grp_idx =3D 0; int j; @@ -1588,14 +1593,14 @@ static int keembay_add_functions(struct keembay_pin= ctrl *kpc, /* Add all functions */ for (i =3D 0; i < kpc->nfuncs; i++) pinmux_generic_add_pinfunction(kpc->pctrl, &functions[i].func, - functions[i].data); + &functions[i].mux_mode); =20 return 0; } =20 static int keembay_build_functions(struct keembay_pinctrl *kpc) { - struct function_desc *keembay_funcs, *new_funcs; + struct keembay_pinfunction *keembay_funcs, *new_funcs; int i; =20 /* @@ -1614,7 +1619,7 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) struct keembay_mux_desc *mux; =20 for (mux =3D pdesc->drv_data; mux->name; mux++) { - struct function_desc *fdesc; + struct keembay_pinfunction *fdesc; =20 /* Check if we already have function for this mux */ for (fdesc =3D keembay_funcs; fdesc->func.name; fdesc++) { @@ -1628,7 +1633,7 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) if (!fdesc->func.name) { fdesc->func.name =3D mux->name; fdesc->func.ngroups =3D 1; - fdesc->data =3D &mux->mode; + fdesc->mux_mode =3D mux->mode; kpc->nfuncs++; } } --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06B382D4B5C for ; Fri, 15 Aug 2025 09:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248983; cv=none; b=AHDBvJiifwnk/n8fjb7fXkV1I82i7nsnOqahS8NJDy3fiDPxqK3fOhiAwr8/iY+M1joP1HFEi/++eEL5DAmD62HW/CfJ66v9fiXe+PPlBqKoVi54meY+hKw9ihSLrhyqlZdnyYHs/fE2sRi2ZkvIApMcsKYUSjSqxeHvsQY09r0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248983; c=relaxed/simple; bh=nMVEhnX3klet6ryv9ldF7EB+laG9yYWfMI0TTrhkagg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qYEayxBmZMbC+SGURQ7mA4ovWBoXP+QM10wbg9lKc9OMfKZiDoNq7SlvwDfHtiQ9/qtW8VNG+KoyeRrqkgsKZapiWsICyPWap/G2wt3YB2d7xm4lfY5EfyiSxBzaLeZ9ltZM6RMxYH78PlXU5qGN7oypmchfn9IHkvyRIxvso5s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=P4JTBuad; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="P4JTBuad" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3b9d41c1149so1337720f8f.0 for ; Fri, 15 Aug 2025 02:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248971; x=1755853771; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QW8G5G1H2ybez9wrKQXFpVaePk3UVjXlh/KwL+gB2lw=; b=P4JTBuadodY8pBTZ5/JE4rI09wUZ9xxR7PaSMkMXzksK7aH5ZbnexkWR/OuJu3Jkg4 3kNtinflFuKePqmuIBXCe7EF5nsd8q/Q9GfShINhohzoW8HoE+iP84T7R1Ou4MPe+0H6 ey7M4DxecQEbO8fsxRtjBVida+M3TpU+lm7DsNVjs17y0O3YNd+0756STmcWfspiRnWM eUSIC9jff7FizMYgZg6hjlddRWjnRkrLWuNTOj9WzmELrmx9Bt3X1dejH8hDXSRfiRYA Okhbi0HE9vcDp4BVMa3A9rZS3oF2SfIRYr4a3LfE/7ARL35ivWU/GZK2HJBS3W60Uvc/ zDMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248971; x=1755853771; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QW8G5G1H2ybez9wrKQXFpVaePk3UVjXlh/KwL+gB2lw=; b=qOYpOowz+zrjTB2KjeIEzcla7DwyibTMQ6cvofUPxSi9m6Eu33cV8iJsEPKFABpH0Z cuHRVJo2uI/O61kYB35NtJ6hl2Zj//AT+LJ7xPp3VFlFiHv/jlFnjaJLmEy9vCC3lNj+ NLP8+AqKgjT1aw28lK9brI3itKnDbj9Rh+gf/Fc467Ho9q/LdKYFhZCKYQn2lHAZu56T H/uEnJ7Qj82Us+bULwS/SiYl/DvLsm9LEkuChZgrRaelNX1GzsT+DURMiKMri80iMcee Z3BtpMt3Y9uHpKUqTtsqG35l9xrhbEhP7yeiS5lcTMHbRLAz1JJFKps+4FDf1Ma16S+O qlFw== X-Forwarded-Encrypted: i=1; AJvYcCVOE97FdmVK5J502dOqHlTqO38eoVhzjTNd1/x4qsI/vsuESsGf770pRiNKXZ1BtJFSLmNGnfXy4yX0jvM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+xG92ZxupSh9xLxD/psYD+6TLhwaFRNhz0YURXhf2jTmMeNhE hQ4jwIchd5qjTlF5nCqnAUgO8CEVy5peTYIe5k0fkZiUf0qgYzixlBOAcM90qG8MBZY= X-Gm-Gg: ASbGncuQE3urFPf06P0PtwDqq76FjZbcWsWNVReHUaUnGt6zViXGttT2wP6scQ9tqmj xroRng2/EnHsKVngaLMGs1lIOz4Yj0oK1tOOraR6vsondqqlzmW9YO+fTFTpntAH1rphrlPwVGt +D6eOXuP0nh8vNsr9CH0wU9qJfUsjiU1oVBZoitE1ar1Q9EdfCO7F43Pyg+yeyp2OAGxUUKWSQQ /XZTAr8S4rANQmotNmXoSWnQ5KHZpNzLLjc2h6eIrjxqtTfWmo2mrf4Qc2L0H7nfwmU9TePCRT2 c1HTQrUqs9pvQ4aXiBR+Tv9vsSRfe/UmYJWGvsnndXy6swH4uFChTjWI8y+EQsHlIXloeoZkbjR ZU+qo1hEAkjNZsV86RHeav7VE1sv4 X-Google-Smtp-Source: AGHT+IFQGbRD7fG0xjh2XOA4+EesumD3/X4bl3aQfW+iqbi4ghnXZs2pTYkzxux1uUzECfDu9aBSYA== X-Received: by 2002:a05:6000:4210:b0:3a3:65b5:51d7 with SMTP id ffacd0b85a97d-3bb674dc785mr974491f8f.26.1755248971296; Fri, 15 Aug 2025 02:09:31 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:30 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:11 +0200 Subject: [PATCH v5 09/15] pinctrl: constify pinmux_generic_get_function() 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: <20250815-pinctrl-gpio-pinfuncs-v5-9-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=9697; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=UByWc+6pSbPCWlljoVLrx6QfiZfsvHjFY4UzBR5pADI=; b=kA0DAAoBEacuoBRx13IByyZiAGie+TiiFA5/OJCugzJFOrsxs1/xaWeeHAbTT6hLabdeMNTK7 4kCMwQAAQoAHRYhBBad62wLw8RgE9LHnxGnLqAUcddyBQJonvk4AAoJEBGnLqAUcddy5vwQAMVk Raphx6lRZtMwLk8PBZZiutIWdZD/etJKVPxsFTW/C0QOe4YvZPQnzgANdxTzmirkZ7w6kNcM5Bs nXsXQ/NqipaZtdBEpaxeegDx0/Qj8awBgbOy1QYqKDHhISdiM8Q58HO9oczSlcmgWVhmEyycmyO 0Xq/3RGp2M+PVPvUEl4TwdKbK04WcGdLY/WaKOGXxGiBr5L9crPOc4/ReId/YEU3We9pQdcWqFu tpw589vsmdHpHSETzm6MetSL9Aq28hT7x4xRjb05vIes3mNG72gRAJoNpjaKY2fhIpyNj8dsiOY H9kcfygNMqFKCqleCB7d3iF+9OarB8ChpWtNb4f0tIMKYyuaLlEiVlpjPXlfOF3DUMSDsdsVVZI hzLfPlBLzWG8dhOOPMOnQqK+0G8M2CRV11PmDywsFQuGjLWAS9qj19Lgq7dUu+hHc0WpUXz4S/o H+WBLejtgFnbCaWiKjVL3AhflItbG66K8dUeRv2UBvqB9csKWDp1IhHlDpQvXRz/GMRLqBAzuOD 6iPD0hPIds1aHc55iHwDpaNUDwQzjZiz3OVrmjCeo6fzO8n9KyXWfPzrOs0QEMABelsZ4ZmBNSu obUfZJUy7EGiwXwXsdgncdtUDvhR845cg7rkuNf6ZFIDAazHWRkbMt/veOyKccTCLCyAB8j/z1A wD1AN X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski With all users of struct function_desc limited to only accessing it using the dedicated function and never modifying it, we can now constify the return value of pinmux_generic_get_function() treewide. Reviewed-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven # renesas Acked-by: Geert Uytterhoeven # renesas Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- drivers/pinctrl/mediatek/pinctrl-airoha.c | 2 +- drivers/pinctrl/mediatek/pinctrl-moore.c | 2 +- drivers/pinctrl/pinctrl-equilibrium.c | 2 +- drivers/pinctrl/pinctrl-ingenic.c | 2 +- drivers/pinctrl/pinctrl-keembay.c | 2 +- drivers/pinctrl/pinctrl-single.c | 4 ++-- drivers/pinctrl/pinmux.c | 4 ++-- drivers/pinctrl/pinmux.h | 4 ++-- drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +- drivers/pinctrl/renesas/pinctrl-rza2.c | 2 +- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 +- drivers/pinctrl/renesas/pinctrl-rzv2m.c | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index d5d42c9ad5fe9dcf7c25ad393688e714b02db678..9ed84479a5b43871861f46fe132= 6f1dfadc7f63c 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -245,7 +245,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, uns= igned selector, { struct imx_pinctrl *ipctl =3D pinctrl_dev_get_drvdata(pctldev); const struct imx_pinctrl_soc_info *info =3D ipctl->info; - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; struct imx_pin *pin; unsigned int npins; diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/me= diatek/pinctrl-airoha.c index eb6cd27955fbe462f479fbe92c785588caee5ebd..2eed83f9f209cad79580082c274= d4056231bd421 100644 --- a/drivers/pinctrl/mediatek/pinctrl-airoha.c +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c @@ -2443,7 +2443,7 @@ static int airoha_pinmux_set_mux(struct pinctrl_dev *= pctrl_dev, { struct airoha_pinctrl *pinctrl =3D pinctrl_dev_get_drvdata(pctrl_dev); const struct airoha_pinctrl_func *func; - struct function_desc *desc; + const struct function_desc *desc; struct group_desc *grp; int i; =20 diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/med= iatek/pinctrl-moore.c index 982b9887521d036538f67e9919de444693c458c0..17a08c73423fd089066e4894d23= 07c852bbbb661 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -43,7 +43,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int selector, unsigned int group) { struct mtk_pinctrl *hw =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; int i, err; =20 diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctr= l-equilibrium.c index fce804d42e7d7f9233b2da0fb26e482170629424..18f0da58c96d4f0fad6535fd88e= 69fc8acf96a94 100644 --- a/drivers/pinctrl/pinctrl-equilibrium.c +++ b/drivers/pinctrl/pinctrl-equilibrium.c @@ -319,7 +319,7 @@ static int eqbr_pinmux_set_mux(struct pinctrl_dev *pctl= dev, unsigned int selector, unsigned int group) { struct eqbr_pinctrl_drv_data *pctl =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; unsigned int *pinmux; int i; diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index af9d2f3081859bc4b22f6820f3b3753eba36f959..e13ef07850386e70cffc8301158= 9ceaf70a70a41 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -4000,7 +4000,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev = *pctldev, unsigned int selector, unsigned int group) { struct ingenic_pinctrl *jzpc =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; unsigned int i; uintptr_t mode; diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-ke= embay.c index e78c8b3ec245aad56e3e74a26d27c41ba4a98281..30122ca90cbef141ec456ca39ab= 4eb6f8bc334c5 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -935,7 +935,7 @@ static int keembay_set_mux(struct pinctrl_dev *pctldev,= unsigned int fun_sel, unsigned int grp_sel) { struct keembay_pinctrl *kpc =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; unsigned int val; u8 pin_mode; diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-sin= gle.c index 5cda6201b60f53e62f3f50b8641ec894106111e0..c9adf5fcb1c76445d4812de449e= df09878771a46 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -336,7 +336,7 @@ static int pcs_get_function(struct pinctrl_dev *pctldev= , unsigned pin, struct pcs_device *pcs =3D pinctrl_dev_get_drvdata(pctldev); struct pin_desc *pdesc =3D pin_desc_get(pctldev, pin); const struct pinctrl_setting_mux *setting; - struct function_desc *function; + const struct function_desc *function; unsigned fselector; =20 /* If pin is not described in DTS & enabled, mux_setting is NULL. */ @@ -360,7 +360,7 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, uns= igned fselector, unsigned group) { struct pcs_device *pcs; - struct function_desc *function; + const struct function_desc *function; struct pcs_function *func; int i; =20 diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 79814758a084570adea0ea1a3151d186f65d1d1f..62bd4aa53b2b22cb09eacfb0539= 8205f2fe391b9 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -847,8 +847,8 @@ EXPORT_SYMBOL_GPL(pinmux_generic_get_function_groups); * @pctldev: pin controller device * @selector: function number */ -struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctl= dev, - unsigned int selector) +const struct function_desc * +pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int sele= ctor) { struct function_desc *function; =20 diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index bdb5be1a636ead9695410824b5557937c5baa89a..549ab10f7afbda32fadf4ad1514= 01180bed2064f 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -152,8 +152,8 @@ int pinmux_generic_get_function_groups(struct pinctrl_d= ev *pctldev, const char * const **groups, unsigned int * const ngroups); =20 -struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctl= dev, - unsigned int selector); +const struct function_desc * +pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int sele= ctor); =20 int pinmux_generic_add_function(struct pinctrl_dev *pctldev, const char *name, diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renes= as/pinctrl-rza1.c index 23812116ef42682d8ef667525d4f4486c286b46a..70f22e0ef307a02d5b11d6626d2= 97a619f5b82e9 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza1.c +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c @@ -1120,7 +1120,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, = unsigned int selector, { struct rza1_pinctrl *rza1_pctl =3D pinctrl_dev_get_drvdata(pctldev); struct rza1_mux_conf *mux_confs; - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; int i; =20 diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renes= as/pinctrl-rza2.c index b78b5b4ec5afd9879373b406e0b8c391912a200d..29a9db19759906598ac55694439= cff8a5ec2c8aa 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza2.c +++ b/drivers/pinctrl/renesas/pinctrl-rza2.c @@ -442,7 +442,7 @@ static int rza2_set_mux(struct pinctrl_dev *pctldev, un= signed int selector, unsigned int group) { struct rza2_pinctrl_priv *priv =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; unsigned int i, *psel_val; struct group_desc *grp; =20 diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/rene= sas/pinctrl-rzg2l.c index c52263c2a7b093fccdb38e44ff3fbba0a86d4def..a9bcb3d7c45c269046df0a7d008= 8a1f48d089fd0 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -549,7 +549,7 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev *pc= tldev, { struct rzg2l_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); const struct rzg2l_hwcfg *hwcfg =3D pctrl->data->hwcfg; - struct function_desc *func; + const struct function_desc *func; unsigned int i, *psel_val; struct group_desc *group; const unsigned int *pins; diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c b/drivers/pinctrl/rene= sas/pinctrl-rzv2m.c index daaa986d994dac15860d328c81e28e2c9e678120..dce68f93d2d57f6a6c9b1bf9e1d= b27393ece8e44 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c +++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c @@ -162,7 +162,7 @@ static int rzv2m_pinctrl_set_mux(struct pinctrl_dev *pc= tldev, unsigned int group_selector) { struct rzv2m_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; unsigned int i, *psel_val; struct group_desc *group; const unsigned int *pins; --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D24192E093E for ; Fri, 15 Aug 2025 09:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248980; cv=none; b=g5y9ol6BwWFHdOm/4nr+kGR37w4joa2QVR+VPPeyeSnHwGRRFKNRl/ZDwF3+9OzkFxf0XmXYgYfcu/ee88+gE20zGqGAE6xVbX40olQjSXgfXj1Xdoekfwsbt3K8NtSaEhxQUwk8QAcHapA1q78Dn0QQeqn6a+oIf9hTKauZ1H4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248980; c=relaxed/simple; bh=rk9E4FadWXaWSn3i2mupMAUwJWtQsYbvjLZhJrLTmRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I6NCYWdbLJITRPLD56kytshpG/x0CVfvPL/DM5LCan34cIJ89BdqYxnXT61UwiDzpsIGMr18lnhtK/sS7JmytiBFpdjXVK1ztceBGXmfOPQF3jmlyoZBfiXKTMFcgCy6jKICg1v9E4z9z1OlQTNNT/EeKOyK4/tnn32d8gaGr2c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=VI81Es2y; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="VI81Es2y" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3b9e411c820so938378f8f.1 for ; Fri, 15 Aug 2025 02:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248973; x=1755853773; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wUmSb9m7Wb2TMLn6U2R44kzyxWVCmDVSA6WZ95LWBOs=; b=VI81Es2y+bmNFTQ5A0pa6V5EkXBrXZSkrA8JDogRQGJxL+vxULXGOMY7wCJCjE67A/ fuJXdwvSgvh8g7ZdL3rI3rPkKcANBklR0FvPHWZq0/gqDHc6fJHNnFlb85w1ZW94M/Xk Z2Jn0n2xut9QZ+//t8AziudOsChpQHpf+C2r90I0S/Yak5SN6DWeaoO10h82W1iNFoOC olVJRdAcnTYfeI8xwZeUHb+SNFE90u1kdGGD9FP5nW16qCO1fiSIJnwfJMC320xTiwFP h7fUAgHMKyQHjyeIKdwLpwFS7ZUQntHsE2EuBxme8yKxPxTVtegKasR5TaPtzbMIlbwt zd0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248973; x=1755853773; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wUmSb9m7Wb2TMLn6U2R44kzyxWVCmDVSA6WZ95LWBOs=; b=r7nAXUDFbXcwDE8m1gkRJAfJ+2CFRutBgGrmmZ00jXGM20qJX5G79CMMCY+U1/IxeK nDDrI5zeFWTPDoCIlOsMJvbHi5kYbRY2iGfezZ/PZEmRWWGTwoGkD5vcfEmsCkUkbQUs +Fff0yk0RJvdyaIdfU02f5lVEEboeyJPlwXE+Rc0uFIAxAxEHyAPfgICJky7qO5WhPgM N+JEvGt2iLLJ5WdfNuxWal/X0ei5y15gjIctL30sBv8DvHt8OUX9RJlWeexYOf04eymf jzg3OQE7B61tPGTCUxxlgF2/Jy4l7WXaT6TjdX4NBA9xlFK8FPyjPllnxI7pR5A2+Tep biTw== X-Forwarded-Encrypted: i=1; AJvYcCX7lA7Y5PBld/1R/jVWraRxsexeCzf5JYFgmqeP/0RJrQg2aeeATb+TsS043yPhfK12KSujNVVfHrLenMM=@vger.kernel.org X-Gm-Message-State: AOJu0YyhtU/ZilIOecXPhXodFF5TuaGgE/G0EKsBPJsUb4ywE2l0G99L KYQ90L2Su5oOBe0k9Ru1YqnctN7mdef3tILCwAMVzMFZJEUIqU8zf7Go6x2HCX28Yyw= X-Gm-Gg: ASbGncu19ZuhvFKbEAw2twh3d15nNb8UpQxErfUJiIO8y+ixFMI+oXCG1cwe+xEdFQt IU+4752M57ECdbpwiBRsf1NN6Oxsf1T/MUeMPAlK6r7OSmF61b8751sOIGXV6pHWxEcMqgyf96x ZazpltCHA5LOmIuPIT8ea8W4iiQZqUGLwJathFtH4uwdExc7L+FBoDqcqax8btgCKUUvQxg3pZZ RRHBPEwHcFNC2OdLFlOcXeV+oZPylGy7cKfdorhNM46q6CE/MqULQqF96cVEkf8H/ZtYWRtYsut 5QgSRD8iBiZAwj/w6vDbj+BKZT0GGPhERoazUNW+r7/i598vIhuyde4Aw8XF12pHKei53ME4ZvV ILLbv0ScASzlIDokGYQ== X-Google-Smtp-Source: AGHT+IEsfSWYzEm27/6hYdWM/oDoGohRgnAYiUKPUf3nioDnbrFIrjHT15QbOHRBbroPOGJoJGn1cw== X-Received: by 2002:a5d:5d07:0:b0:3b7:9c28:f846 with SMTP id ffacd0b85a97d-3bb68fdd74dmr1040326f8f.44.1755248972964; Fri, 15 Aug 2025 02:09:32 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:32 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:12 +0200 Subject: [PATCH v5 10/15] pinctrl: make struct pinfunction a pointer in struct function_desc 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: <20250815-pinctrl-gpio-pinfuncs-v5-10-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5244; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=Zm7l0P8J/4Yr+ba9yWziUENeNgwa5VJWf6fQSuqhMVo=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk4VNy+wECbWRHhJLf/n6KmM7k5pMTn+IjYl fACs+Y2sDqJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OAAKCRARpy6gFHHX clftEACGI8JVw0+vCqaEtPg8fs5gEye52amqNQ+hqsElotQX4ILlanV/h5UlgtnQXD3SlgDRZXG R0ZOxm67YO3xopC0fuXZCActBpEsfw90Im9j7Qfs49iLYZBfhGOmDMQ98UhyTgFj8dn41/hJFTg l/GxFa2m2JMeO/w9b4WcGOIqSyrH7YnS2WKF/Jn59zQEL5KyK2ABHvJtGkXGA60p7hLWR9OypY7 N1vuOde0ZUENG4v9pvrF8pOGJgPkFMPUIXVLldJzBNddhq/oeUIVxQ95Ai7XpFJI8hL72/lDhet Ukev4jy2tdjT8P0iokwmmmmqWc2DwdZVS3L0r0XiFmpuNkBzMw4kN/MX8r7h3SwzCQIqcwm+Wq9 u9XZlYInmGVv8uutXQXAcpfeoAwGX/Z/0TSXXfv3PqBv1OrLhjh5A76+2LP9DDIXQ5f6GbOZSfT yBmkcQ55JR3el5kmh6ERA+hNavWreMdGMPlKJz22TveXpEYYNewYTdmEj3UgU9umx/oSNJTc0td QsK9hPDHN2Hsy7XOIE3itRPQmpSAsmvqqLtTkPddAw9hDZHGYOIlHrMKGwJ2tRxPXZfx5aW61gb K4FYxpa0tFpMifiwQ+/QjF1/DMevhoHp5QxpD6M1fdZCkdqz0ytRi2NPfUIydhyefTZ+vMGzVFf vtagIeUSAxzJviQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski We currently duplicate the entire struct pinfunction object in pinmux_generic_add_pinfunction(). While this is inevitable when the arguments come in split through pinmux_generic_add_function(), users of pinmux_generic_add_pinfunction() will typically pass addresses of structures in .rodata, meaning we can try to avoid the duplication with the help from kmemdup_const(). To that end: don't wrap the entire struct pinfunction in struct function_desc but rather just store the address. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- drivers/pinctrl/mediatek/pinctrl-airoha.c | 2 +- drivers/pinctrl/mediatek/pinctrl-moore.c | 2 +- drivers/pinctrl/pinctrl-ingenic.c | 2 +- drivers/pinctrl/pinmux.c | 18 ++++++++++++++---- drivers/pinctrl/pinmux.h | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index 9ed84479a5b43871861f46fe1326f1dfadc7f63c..0df7eba8ccd3209fbc4b2e67ffd= ea12b77b90858 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -266,7 +266,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, uns= igned selector, npins =3D grp->grp.npins; =20 dev_dbg(ipctl->dev, "enable function %s group %s\n", - func->func.name, grp->grp.name); + func->func->name, grp->grp.name); =20 for (i =3D 0; i < npins; i++) { /* diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/me= diatek/pinctrl-airoha.c index 2eed83f9f209cad79580082c274d4056231bd421..8fb3b65a1b775cf078d3c926af5= 9480e9e09ab30 100644 --- a/drivers/pinctrl/mediatek/pinctrl-airoha.c +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c @@ -2456,7 +2456,7 @@ static int airoha_pinmux_set_mux(struct pinctrl_dev *= pctrl_dev, return -EINVAL; =20 dev_dbg(pctrl_dev->dev, "enable function %s group %s\n", - desc->func.name, grp->grp.name); + desc->func->name, grp->grp.name); =20 func =3D desc->data; for (i =3D 0; i < func->group_size; i++) { diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/med= iatek/pinctrl-moore.c index 17a08c73423fd089066e4894d2307c852bbbb661..11dc525eb3a2dc8ceabf2278ee1= a2abaa425eec1 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -56,7 +56,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev, return -EINVAL; =20 dev_dbg(pctldev->dev, "enable function %s group %s\n", - func->func.name, grp->grp.name); + func->func->name, grp->grp.name); =20 for (i =3D 0; i < grp->grp.npins; i++) { const struct mtk_pin_desc *desc; diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index e13ef07850386e70cffc83011589ceaf70a70a41..e5b24fab12e11e443df25ffeb7b= 70d7c1a03c6bc 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -4015,7 +4015,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev = *pctldev, return -EINVAL; =20 dev_dbg(pctldev->dev, "enable function %s group %s\n", - func->func.name, grp->grp.name); + func->func->name, grp->grp.name); =20 mode =3D (uintptr_t)grp->data; if (mode <=3D 3) { diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 62bd4aa53b2b22cb09eacfb05398205f2fe391b9..6f5e3ede972bbfa78e279790df3= 59632e2d63485 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -810,7 +810,7 @@ pinmux_generic_get_function_name(struct pinctrl_dev *pc= tldev, if (!function) return NULL; =20 - return function->func.name; + return function->func->name; } EXPORT_SYMBOL_GPL(pinmux_generic_get_function_name); =20 @@ -835,8 +835,8 @@ int pinmux_generic_get_function_groups(struct pinctrl_d= ev *pctldev, __func__, selector); return -EINVAL; } - *groups =3D function->func.groups; - *ngroups =3D function->func.ngroups; + *groups =3D function->func->groups; + *ngroups =3D function->func->ngroups; =20 return 0; } @@ -903,7 +903,17 @@ int pinmux_generic_add_pinfunction(struct pinctrl_dev = *pctldev, if (!function) return -ENOMEM; =20 - function->func =3D *func; + /* + * FIXME: It's generally a bad idea to use devres in subsystem core + * code - managed interfaces are aimed at drivers - but pinctrl already + * uses it all over the place so it's a larger piece of technical debt + * to fix. + */ + function->func =3D devm_kmemdup_const(pctldev->dev, func, + sizeof(*func), GFP_KERNEL); + if (!function->func) + return -ENOMEM; + function->data =3D data; =20 error =3D radix_tree_insert(&pctldev->pin_function_tree, selector, functi= on); diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index 549ab10f7afbda32fadf4ad151401180bed2064f..653684290666d78fd725febb5f8= bc987b66a1afb 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -137,7 +137,7 @@ static inline void pinmux_init_device_debugfs(struct de= ntry *devroot, * @data: pin controller driver specific data */ struct function_desc { - struct pinfunction func; + const struct pinfunction *func; void *data; }; =20 --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30D122E1C4C for ; Fri, 15 Aug 2025 09:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248988; cv=none; b=MJ/5hJsHPFXAiyNGtnDf+A1rNalHVP06bL63uB8LzMKtpES9TOlCmllvQ/ePKzWabu8pxBmuuOFNs0rjUub+ogfa27n+Wentaxp06LqizUp5v12mjbjPPX+bawSTDs6cWNtsMHwijbqQ7Ij8cmFVqmYuB6Sazz/KP2Pyr/oWnCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248988; c=relaxed/simple; bh=+QvEm53FGBL8kbed9CrGkfR7JQ0mUkCssMIU9hMIktU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DhUyz9aWfoHBhJxKGCRO6CujfNM5K2NndFlaLOHxAe0qjvv+l24qijOq8NQ05ITt68I3EOlW4huEeM7PtdzA+1u762us53HrXaikxYCiCaQBKZREWbDJXVRWh5iy2gi+Kaxd4DYLnOgCKLF04lz+xoc3bYNIkReuYk4uFbHx224= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=F8GGFahW; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="F8GGFahW" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3b9a342e8ffso1267777f8f.0 for ; Fri, 15 Aug 2025 02:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248975; x=1755853775; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fkIrT982nu0l7atioMtbVH3OTcGWcWH7NZxVXh73dLg=; b=F8GGFahWqgeYLoE3MMaBcgPi58mxSIweZA/ahN/bvTxjyzCAzA1igjZvAXct/fdSdm bfplKio4HXdQuBMpGmsgpA/uEovsjyApJIhIJi1ZJZGlaQxNHxzOVHlbZ95AVOYY7mNa yEEcVMsK5xZCdJWjRySBYXMiZoKvXmIr+Z353VPcUl7lu+XvDBmQjFibzvhBKgl+mOwM cuNokIVpnqLBCO6pEbd2mAdX1UmF+RzFWsIvNqf1SeVen9L1tCs/dLaUe+SD40gWsOTo dr92S1/bIQpSca5/Z8WV4weryYlTbAPmzRohlGEgVKL78p2O0X7MyqG0jjzw0PNYO3N6 bARA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248975; x=1755853775; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fkIrT982nu0l7atioMtbVH3OTcGWcWH7NZxVXh73dLg=; b=jRR0SlPuDo7Z+GiZTI78Asi6v5eMfN56XGvX/3KmgDPNX1c0AWJNEzr3cY/3N3KGct m2FYxnk0uxHH6gPHDhcodtOxIn8T3ivFkQiAHxk9TYYQTAiTjq/HCZgiz+y/pkIV6z8e bOA5+GhQXj6zgJBQWJxUxT3/GNL+9JCahbFDO5JXsbyUwctg2EVt47SC7grU7QSuZMrU rm/Pu4FF/h+abfdLJQm7I6miWlmlfew4gpMl94egPODGli3heQaCmPrphbEZYE+Fx0Cp pybfZBPTTR2xn7+5QpiKeQNkYmybc+dmZnZBxpz2N7mIU6sWbZ7GGdBDncDRegpi+c+Z Us0g== X-Forwarded-Encrypted: i=1; AJvYcCWmrBXsuRLX1vuAh5hxhu6qtNJ5pvOzk8dS/rRKzMpYGPtKezijfVx/eyNcFXiq6rOvIzz2YunhoiK2dRY=@vger.kernel.org X-Gm-Message-State: AOJu0YwQOswi00dc/fc7qBaYpfAyfexr76ecWzTo5CcWgZyhS+NdgDf5 DSbUtUqZg8DIEJ3UbQrjUbwWAn3SsdWjXJwR/BFX4DGD/d63C3l8S3TSbY1H+oawXTc= X-Gm-Gg: ASbGnctxXcGY77SNFaMRFglNSIQtLRuxRZO09O9s2EIgIioRGQN7F9AtM4/7QKsAJrs 6gCQ7WBsAX8Jp5vN3lIjI591kv8YuvrpazSXHe/mpYc1/acOH7/dj5ShkV7HYNjGuXGDlYNEbxn AcFB/SOLGJPBFoA3rIZj/63XtWtQLOFKJQHu9GwOdOHNjVFv/T3k/ga0SDioh5xONoJ2E5Le/1U iQfqCXy8QECmMLZkwZDMxYjT9hVxu4IyusE/0xRt0VIHznus8X2b0zm35XDGxhvwfX/z16LHBiX 27yMn1GPJQpmzo4I1up1BhrP4MInf8UKl2iiXPnwNNguP3BrRzCHP0RQXq1UoSdmYDZTwI/Iiee +2unf71RqWhQhtIovMA== X-Google-Smtp-Source: AGHT+IGsDrB/9NqsFs+GTJUXDyUWG89PIW79ggF9quCSnVgyfof3rlZDBIwDgG3UDAmjbKhep2/pmA== X-Received: by 2002:a5d:5d0d:0:b0:3b9:13a4:722 with SMTP id ffacd0b85a97d-3bb4a1fa03cmr1100448f8f.6.1755248974639; Fri, 15 Aug 2025 02:09:34 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:34 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:13 +0200 Subject: [PATCH v5 11/15] pinctrl: qcom: use generic pin function helpers 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: <20250815-pinctrl-gpio-pinfuncs-v5-11-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3269; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=chxUZAtCU37mhXCr4qzhIIkekcZb+5ZpnLwzXbUTM0A=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk5lnBQ3Etsml5iw/SH8qzvKnyGoC4Hly5o3 tnIDLJk12OJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OQAKCRARpy6gFHHX csfPEADBEB0r5l4OpTTIJK9i5AuM4M/cyu/QvJFZPvHsnoQ9OThLsPCT7jshbC2wt9Pv2puSVX5 T1Af8wLRGMDrEZDP79F4hdOml7iB4kmRVSgBGYOIXs9akwp0viAFXXfUTf0qk512LjP/Zeha8Qu 2vBQJXCtlrnBVyrLAxCt7iywj/o0HrURUraqC1V/kL1ejTK5U51gBYfoAoeWQ5TUVJopb0tjbOA mkIQDFpPVtuvRc6JP3wWSfTDUEvSR/B8uIGUkyIDsqVTRzObzIFflNGPvWoIQj41zXagR0xgWTC tamCDJq4dBqsNR7YUMWTCgpLB9UMbZimR9r+Z5QhPEb1uEToQmLmIKQSH55KMosoRsheikmbyMj n/YfwJPK16Q1aEpo0CPIsJHHJDhsrEB4xWpq2w71ggoiJnPXLGtapH4altn+YIiCtNE2DsogjY4 z1J5MTqicg8N2Wk959AZ2U0iqc7pHTgnC+caKBq76Wqv8S1/m+npVHP6elyJa3brBbDRDwVuFdr tJZsQOOHOmp0WRxh5N/07ZwrriHVtfhX1KD02OHuaiQrGtEyrp1/6LksZu/5fvUVpj92ttmQ1JL A+VFk+sgzNoH7ZCc3rGLtCq4/o+8RzkaRpoUSMtxA10w30Z31P8SZPwIDmMqECTzGYpEsEPiMNh 4fdjFWUp2iXksfQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski With the pinmux core no longer duplicating memory used to store the struct pinfunction objects in .rodata, we can now use the existing infrastructure for storing and looking up pin functions in qualcomm drivers. Remove hand-crafted callbacks. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-msm.c | 43 ++++++++++++----------------------= ---- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinc= trl-msm.c index 83eb075b6bfa1728137e47741740fda78046514b..96e40c2342bdedb8857629e5038= 97f171a80e579 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -31,6 +31,7 @@ #include "../core.h" #include "../pinconf.h" #include "../pinctrl-utils.h" +#include "../pinmux.h" =20 #include "pinctrl-msm.h" =20 @@ -150,33 +151,6 @@ static int msm_pinmux_request(struct pinctrl_dev *pctl= dev, unsigned offset) return gpiochip_line_is_valid(chip, offset) ? 0 : -EINVAL; } =20 -static int msm_get_functions_count(struct pinctrl_dev *pctldev) -{ - struct msm_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - - return pctrl->soc->nfunctions; -} - -static const char *msm_get_function_name(struct pinctrl_dev *pctldev, - unsigned function) -{ - struct msm_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - - return pctrl->soc->functions[function].name; -} - -static int msm_get_function_groups(struct pinctrl_dev *pctldev, - unsigned function, - const char * const **groups, - unsigned * const num_groups) -{ - struct msm_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - - *groups =3D pctrl->soc->functions[function].groups; - *num_groups =3D pctrl->soc->functions[function].ngroups; - return 0; -} - static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned function, unsigned group) @@ -288,9 +262,9 @@ static int msm_pinmux_request_gpio(struct pinctrl_dev *= pctldev, =20 static const struct pinmux_ops msm_pinmux_ops =3D { .request =3D msm_pinmux_request, - .get_functions_count =3D msm_get_functions_count, - .get_function_name =3D msm_get_function_name, - .get_function_groups =3D msm_get_function_groups, + .get_functions_count =3D pinmux_generic_get_function_count, + .get_function_name =3D pinmux_generic_get_function_name, + .get_function_groups =3D pinmux_generic_get_function_groups, .gpio_request_enable =3D msm_pinmux_request_gpio, .set_mux =3D msm_pinmux_set_mux, }; @@ -1552,6 +1526,7 @@ EXPORT_SYMBOL(msm_pinctrl_dev_pm_ops); int msm_pinctrl_probe(struct platform_device *pdev, const struct msm_pinctrl_soc_data *soc_data) { + const struct pinfunction *func; struct msm_pinctrl *pctrl; struct resource *res; int ret; @@ -1606,6 +1581,14 @@ int msm_pinctrl_probe(struct platform_device *pdev, return PTR_ERR(pctrl->pctrl); } =20 + for (i =3D 0; i < soc_data->nfunctions; i++) { + func =3D &soc_data->functions[i]; + + ret =3D pinmux_generic_add_pinfunction(pctrl->pctrl, func, NULL); + if (ret < 0) + return ret; + } + ret =3D msm_gpio_init(pctrl); if (ret) return ret; --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBE4D2E2F1A for ; Fri, 15 Aug 2025 09:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248986; cv=none; b=gcBWnxBpVHNmNFMf61kIhBUx6ecrMkub7LEfch9OGk3kvEH1GxQuXg6A35diSogI+b7CrVImSQRnqFPQLOZ2wj6ImwkX9eKcv2KthgUKhx0TGw6nP5+qd1CABH0XVUuRhQ0MElYuTfo/+j7Gq/ItAZNsV2lb6p/v7uurx/n46lw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248986; c=relaxed/simple; bh=w5oPtVBROi/7Y9FQHD66FlpdPS7R+xegird3g2AxhQ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OcEnwOdYbMcXuVVylH5emjj1/DP/ebe9Ovge1+iGdTHqp64t/6HzxiDCKF4XtDOA/NpqPgnjad3+yhwTt5Jdst7QyA6tz4yYClEaeacrKEMYScwoxh/RsQIdAa7uN40K0Ov+3hLI5Wrm55GWxYzq/WaruHZRZWN+S5bhErK6Wb8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=UdEKzRpN; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="UdEKzRpN" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-45a1b00f187so7792605e9.0 for ; Fri, 15 Aug 2025 02:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248976; x=1755853776; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+2WJcuXshs43B8tgQ0eqFMBEBoYTyTVQjjLj/OzbqHU=; b=UdEKzRpNFf22kKF42IUSMtgKC22b858pHuFkUFJ9jZa/bsjlRswVYVOYHHzfUOjKx4 tDNvktek3jDsmcU+KPiU50AAR6WXtVZtF9kL3TFbnAk1uFj4c/kmHLT+GAPZ5Pd4L9/5 3FYVr0NFDC+8PHNP0TjxteaFhrAper+zjp5cVIxZtbg7nG2PUQRPPbdmDGcFX7fJDLcx JR39FSXB0JhFwRuzxtWem3AiXKKdnh4Taz9vacFCyrg57pgY3kv5a6+IMU+RFYJfmkJK GvzKAADwL/DxxKOqrT2EEScEKk5CZc4GJfcxL2bEGp6v2klgp4MJ6qDHktykgCmvdqKQ Mmgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248976; x=1755853776; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+2WJcuXshs43B8tgQ0eqFMBEBoYTyTVQjjLj/OzbqHU=; b=nyqp0l7rXSAzmxc6BsYRoomhDirWPcggNPiSRjLKpl8Xu9x/he0mkqV0GFdiPFCnKh gt6xVQtuJRBir7QdYvnTe6zhmjoYMPFoC1rmrWWpZ+JfKqTSda/cTKq/YlV2yjIL4PWH /mTW80qD/4TX9qz6iC4rbZS/69U+CiWuXe35Y7q+ZwacGoRW5XVFR/msbccoxqe0ACvS c0iC0ZmgCdxyxHAzxkDiK3+4z/GR9pkaNkqfQemCElc0wtE06JyFAvgnQVQUeU4tZ8ka eplWS2Zygcnt8mpOpS9L50qyY2IoGuHJlWnxdo6Z4L1DdpthHZT9EWyMYxhSTQb2boin e//A== X-Forwarded-Encrypted: i=1; AJvYcCWE+u3RUAkOTCEe1Uffk+MiG2BZBSnsVPqlK6dcNyBia/gKAa7aytADB6SJMDQB7aR9iyBv+Ih7x8UIyUI=@vger.kernel.org X-Gm-Message-State: AOJu0YxzaPvgtZ+xCKclOcPIQZbRCNkjlbjNB8c9mLF67gszyuqU2XPF BttGH1X99LGYbGajbDrLoMesJbWjtWqWc5bLGjim3GBHHnkJ93jdmZsgIsbyLuHStmg= X-Gm-Gg: ASbGncuMgxE1A5c3v48y/XWEd7aww/0sGXuWt4gbXOWd/cDpmA/tAq5nTpC7SGIKXBi 2gDHiC4g+47GcFMjD2FwQn3C0C5Izyk0k2wx37sHHEeIqbLBS6cJYvSMsTHcXwtyzteL/f2LIFH ZtZjCxHUeK2Dt8U8eLCMSm/Gf6JhVI32lQej7Q12IHZVBlYKlPHxjdpwDu+y3lK9UYc4LuhjQMf E3FerKHdZeZ6VkuELAbRzYAndeEB0JvFX9DYtWUnX18qiG/0COlJx3WQPOetStAfOt9k5eiEXqi ZyzddPBv690WrSdpaaYYb8V93qi3suda4d76pcRhaMxsxeuaBnB/c64pNrxElT2fJWzHFsRuklt N8S9woNDED/MTVK9l70Pu6IHD6HE+ X-Google-Smtp-Source: AGHT+IGtFuboeVNKDciYaG+Wue0vo4F6BgRJxWOmOLF1DSz5Cu3XHJ3qRVrOSZqH3ZFOO5JCnPO6Rw== X-Received: by 2002:a05:600c:b90:b0:459:eeaf:d6c7 with SMTP id 5b1f17b1804b1-45a218578fbmr11412825e9.26.1755248976374; Fri, 15 Aug 2025 02:09:36 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:35 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:14 +0200 Subject: [PATCH v5 12/15] pinctrl: allow to mark pin functions as requestable GPIOs 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: <20250815-pinctrl-gpio-pinfuncs-v5-12-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6852; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=WMZHoUXGJzQjV7RXxreXxMNKpdMVHjmxzsHXmgnkdQ4=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk5bgkY5AXm9FPgfoovthCOalkecv+3yu+Ic 3T3XjvXPjqJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OQAKCRARpy6gFHHX coJOD/4tMSbksBGkrhvSda2Cd3mhG3iDPTFzcr/DoZYk3If/6C4nByO6VnEq/0I0YP9wPf9KHgq Bwy5IGngCFqV4uov0W3dhUrQQuX7lBXzklakhg4DkwhyrQMiOPTf5wkfU8hHdYD9DgIoN7bpWg6 ZN5X6ZOCsfRhMpnJaecsr/eHvdG6DfTknJ6uMp9uH7/zQ8dcIZarHD3m9ACV9y0tq+Q+hr9xkWs 1AkVphL5gdR/HstzkuztJDlEnK74CtoCYvnxhPvb5XuLQaf3gtdiTCdAFWjKe4SLJVus/1fXdw6 B0ODk7/3X+Zfvv/fAe2aRZl7a+glcMhswDoHmtaeJMQiKzO06Xwv0AzfEcx4mJO52khpixxxauS XKNNrjuHOeZyifJi9z6kmjbHp3zIEGXILQRqhhRK9T3JaCydQN3L6wIIwVbm16oo53i/w05bSBT iOLB6+laIvJGNGQeXDyL5me90VUhmVAKflPgknGK5ZQvlaVsojfdrW6QFT9M1Pk/+yQmZXH2xMD 8LC/7eFAOzLR77etZjxow/DW6YGXP+u7RiF7Oqe+FonXjipug6doGLhu2t2pQkG4EKr8QjX5CPo /vbX8C0DRcZ1v+bRLvxw1aUfyPyto0eROYdnui3xAqZt7ky8XvlnT1WEOMVMOVIhvvZL2QZCKuA 1gbeKaA6NUwwdvg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The name of the pin function has no real meaning to pinctrl core and is there only for human readability of device properties. Some pins are muxed as GPIOs but for "strict" pinmuxers it's impossible to request them as GPIOs if they're bound to a devide - even if their function name explicitly says "gpio". Add a new field to struct pinfunction that allows to pass additional flags to pinctrl core. While we could go with a boolean "is_gpio" field, a flags field is more future-proof. If the PINFUNCTION_FLAG_GPIO is set for a given function, the pin muxed to it can be requested as GPIO even on strict pin controllers. Add a new callback to struct pinmux_ops - function_is_gpio() - that allows pinmux core to inspect a function and see if it's a GPIO one. Provide a generic implementation of this callback. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinmux.c | 39 +++++++++++++++++++++++++++++++++++++= -- drivers/pinctrl/pinmux.h | 3 +++ include/linux/pinctrl/pinctrl.h | 14 ++++++++++++++ include/linux/pinctrl/pinmux.h | 2 ++ 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 6f5e3ede972bbfa78e279790df359632e2d63485..730108467bcc226622185b53a15= 90c683ff19afc 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -89,13 +89,20 @@ bool pinmux_can_be_used_for_gpio(struct pinctrl_dev *pc= tldev, unsigned int pin) { struct pin_desc *desc =3D pin_desc_get(pctldev, pin); const struct pinmux_ops *ops =3D pctldev->desc->pmxops; + const struct pinctrl_setting_mux *mux_setting; + bool func_is_gpio =3D false; =20 /* Can't inspect pin, assume it can be used */ if (!desc || !ops) return true; =20 + mux_setting =3D desc->mux_setting; + guard(mutex)(&desc->mux_lock); - if (ops->strict && desc->mux_usecount) + if (mux_setting && ops->function_is_gpio) + func_is_gpio =3D ops->function_is_gpio(pctldev, mux_setting->func); + + if (ops->strict && desc->mux_usecount && !func_is_gpio) return false; =20 return !(ops->strict && !!desc->gpio_owner); @@ -116,7 +123,9 @@ static int pin_request(struct pinctrl_dev *pctldev, { struct pin_desc *desc; const struct pinmux_ops *ops =3D pctldev->desc->pmxops; + const struct pinctrl_setting_mux *mux_setting; int status =3D -EINVAL; + bool func_is_gpio =3D false; =20 desc =3D pin_desc_get(pctldev, pin); if (desc =3D=3D NULL) { @@ -126,11 +135,16 @@ static int pin_request(struct pinctrl_dev *pctldev, goto out; } =20 + mux_setting =3D desc->mux_setting; + dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n", pin, desc->name, owner); =20 scoped_guard(mutex, &desc->mux_lock) { - if ((!gpio_range || ops->strict) && + if (ops->function_is_gpio && mux_setting) + func_is_gpio =3D ops->function_is_gpio(pctldev, + mux_setting->func); + if ((!gpio_range || ops->strict) && !func_is_gpio && desc->mux_usecount && strcmp(desc->mux_owner, owner)) { dev_err(pctldev->dev, "pin %s already requested by %s; cannot claim for %s\n", @@ -861,6 +875,27 @@ pinmux_generic_get_function(struct pinctrl_dev *pctlde= v, unsigned int selector) } EXPORT_SYMBOL_GPL(pinmux_generic_get_function); =20 +/** + * pinmux_generic_function_is_gpio() - returns true if given function is a= GPIO + * @pctldev: pin controller device + * @selector: function number + * + * Returns: + * True if given function is a GPIO, false otherwise. + */ +bool pinmux_generic_function_is_gpio(struct pinctrl_dev *pctldev, + unsigned int selector) +{ + struct function_desc *function; + + function =3D radix_tree_lookup(&pctldev->pin_function_tree, selector); + if (!function) + return false; + + return function->func->flags & PINFUNCTION_FLAG_GPIO; +} +EXPORT_SYMBOL_GPL(pinmux_generic_function_is_gpio); + /** * pinmux_generic_add_function() - adds a function group * @pctldev: pin controller device diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index 653684290666d78fd725febb5f8bc987b66a1afb..4e826c1a5246cf8b1ac814c8c0d= f24c4e036edd2 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -169,6 +169,9 @@ int pinmux_generic_remove_function(struct pinctrl_dev *= pctldev, =20 void pinmux_generic_free_functions(struct pinctrl_dev *pctldev); =20 +bool pinmux_generic_function_is_gpio(struct pinctrl_dev *pctldev, + unsigned int selector); + #else =20 static inline void pinmux_generic_free_functions(struct pinctrl_dev *pctld= ev) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctr= l.h index d138e18156452e008f24ca06358fcab45135632f..1a8084e2940537f8f0862761d3e= 47c56c8783193 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -11,6 +11,7 @@ #ifndef __LINUX_PINCTRL_PINCTRL_H #define __LINUX_PINCTRL_PINCTRL_H =20 +#include #include =20 struct device; @@ -206,16 +207,20 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev = *pctldev, const char *pin_group, const unsigned int **pins, unsigned int *num_pins); =20 +#define PINFUNCTION_FLAG_GPIO BIT(0) + /** * struct pinfunction - Description about a function * @name: Name of the function * @groups: An array of groups for this function * @ngroups: Number of groups in @groups + * @flags: Additional pin function flags */ struct pinfunction { const char *name; const char * const *groups; size_t ngroups; + unsigned long flags; }; =20 /* Convenience macro to define a single named pinfunction */ @@ -226,6 +231,15 @@ struct pinfunction { .ngroups =3D (_ngroups), \ } =20 +/* Same as PINCTRL_PINFUNCTION() but for the GPIO category of functions */ +#define PINCTRL_GPIO_PINFUNCTION(_name, _groups, _ngroups) \ +(struct pinfunction) { \ + .name =3D (_name), \ + .groups =3D (_groups), \ + .ngroups =3D (_ngroups), \ + .flags =3D PINFUNCTION_FLAG_GPIO, \ + } + #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL) extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); #else diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h index d6f7b58d6ad0cce421aad80463529c9ccc65d68e..6db6c3e1ccc2249d4b4204e6fc1= 9bf7b4397cc81 100644 --- a/include/linux/pinctrl/pinmux.h +++ b/include/linux/pinctrl/pinmux.h @@ -66,6 +66,8 @@ struct pinmux_ops { unsigned int selector, const char * const **groups, unsigned int *num_groups); + bool (*function_is_gpio) (struct pinctrl_dev *pctldev, + unsigned int selector); int (*set_mux) (struct pinctrl_dev *pctldev, unsigned int func_selector, unsigned int group_selector); int (*gpio_request_enable) (struct pinctrl_dev *pctldev, --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4BC72E3719 for ; Fri, 15 Aug 2025 09:09:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248987; cv=none; b=YR/V/wcdOWaoko3+DMVHnJdTwPn140v1Fartyrdk/ujxsHKc8nv/ZXpvru02CqWTFI32TdQ4ml4gfjK1uELcWX52kQISeu/tED+Gamv/lgYIlC7/2AgjMv5zSlCVhUfgg0kTpmq8FTP8N1pmVUaTWL6LbXbWQ3AxkI6CYi6Z+Ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248987; c=relaxed/simple; bh=d+pkakvHisIo5B7fnb5foS5HS7QjQMAp1P2iWKiGNdo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bg2FaHrajYlaxVxhe2AUMIF6KQ9syLyH6PzQ0CVRE/9oi/VCoTLTYUdRw5/z56u/3OGTXA2BdVZgjgZDHRvPIGBtQJHNBbhpV+u0cNYhCmxf4XD8aYKdLVJ7vpieRJ5sm5EwFEeBFxj6dQRyy/rE8loBxq2CGdjiZ3mNpr2hpGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=srnib/1B; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="srnib/1B" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3b9ba300cb9so1199938f8f.1 for ; Fri, 15 Aug 2025 02:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248978; x=1755853778; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JThKrLTPuFVwzCwJhKd4fJmIEtCxHnGrNzSYzGU4KrU=; b=srnib/1BvaF0uy9WI33yxEDKIJJFMWHr9tgtrIPbDT1vBDXkcc9M58SZUb26xkCrWG RGLa8Kztd6pywSqq93ZPZYCfpPHBAkdm0EbZm4Pj1esgHm7AnRSaaqS4ItkgjVvFGPA1 al8sAec0qOOzIyuI2ppGIMISxLpx1WEuWa8MgbtWTMn0Gv+Mcf6hAUNkw3nPu29Cit8r DaYSwtgb6rEvH3DGsb97F2Z4EVhyoIXnhBfwA14kuXSofxVzrkn/USVEyl0KyqVOC3ay 4PKjgh1/QK2lokqU4yPBo7GOASab3yLvwliAyosVH9nBX1GZ97O0rvdP2ayGNb6aHI+H dMiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248978; x=1755853778; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JThKrLTPuFVwzCwJhKd4fJmIEtCxHnGrNzSYzGU4KrU=; b=UaurJgDlVolWvYdS4LWoVLnduVQNIgfmeSJt3qEIolgbWOs5kMw/9u86aTpiO8a1ss YHcFNVVmsoK8t44BpmLknsFZCvrDJdTFFxHXRvEahgCcLdH4h21R+UZXf/TwVIjjl8Pp hqYJG1BvSi7sVReT1o+51+hJ/2sR1Kbd97pTMCSpaCYII1qnEY++hjfln9jlQFlqVNHb vstkUsnWeGkGQrUDPWYabzooOqTgiu66/3x+dxaZiyj6EQoyrNB1I4xA8h7WbsnMyZoC MGOK8LbyFC16xg78DRb1yjWr0qeMWfFsyJKFh+VUiN8DUFW+MAk77Gitqd5yHlr+vjp6 0RwQ== X-Forwarded-Encrypted: i=1; AJvYcCWsSeTO510kqYlKH+zHCTAzEs2vTasqUaLibApNoQLJ0k6vXjB5wVH+EiaaqxqPrgLjLKu6Ar5D90nUUz0=@vger.kernel.org X-Gm-Message-State: AOJu0YyLGj4ogvYS5V0NDa57saPUA3+ZiC5TNumacm7jH1fY2sK+ufFK gpK7YsD6FOByC907HOi17R/VgNHwcbu8Eiyh5XSux4miJfmnGg6pV2LaPyaWG4dezE8= X-Gm-Gg: ASbGncvboaYnoBbZdOI7dOJqegdX5pJRIkAUuihop7TrU+D9idrOyRYybNGxHD+ayFm Mad4kX0/mzV2P7NUI2qvqF9GK/ugquSycESUw39bgCrIiuwtktAZa9hLfRlhQuDYhYYWIcIoQGT 0a4pgilhYdA8Vs/M5ft+HAfSoBEt+pW1sm+j4fy/8Kc6bFc0sqA3RANrrA6tMnXKVEbM+0ZSLFV 94ME+6vmoMmbcAXjzNe4daNMh33J1X7knr9N6TGp/p9PFdcMTJ/QlPcyr5WAGZp7iDt2MiytZcw PlXAIRk417widCtrwPY9ZhbB7cBzE8qSl2LS+Qq4HQNvdA6/ZA81N0IFq11xldzXH0rQA71EZtB au/BeRbL8BXKAYmw0jg== X-Google-Smtp-Source: AGHT+IG6tpzUVovgoQkKFLGI9UZEr33h0FppCamYKXGjED9LEMcOygc6BNR53lxBsyNw3EXRvTetsA== X-Received: by 2002:a05:6000:4007:b0:3b7:8071:f902 with SMTP id ffacd0b85a97d-3bb4c5b80bcmr1159773f8f.13.1755248978027; Fri, 15 Aug 2025 02:09:38 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:37 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:15 +0200 Subject: [PATCH v5 13/15] pinctrl: qcom: add infrastructure for marking pin functions as GPIOs 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: <20250815-pinctrl-gpio-pinfuncs-v5-13-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1755; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=1TtCXH0c1SnNyHC+v6gZsytFHMfkLN/q6H3Fm9nBNlI=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk5msNNj4Ca68fb7+G6bZ73KBx3fzutVpC0Z 9VENfY/MhyJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OQAKCRARpy6gFHHX cqCREAC7WpcFRL2Sb/Hk+HNXVI+dbXjLvxVLapxOlsBcpesaDrR/NahYb6p/G62D/kWHKA2KVii lU/tMlPBnJHukaRydH6794HwaY5/+/S9wFa5rDdnOyj2dBp6a9S3jbED/+o43IIUf+rOrPuqibD NVr66kEWQYaOLX/t81nHetyX+Dd+P/d++xBXan8oWhwtXd9zHLda05S+jw/RrBxcx3fSK6UTtD7 dNW9MUo9bAY1tlkU51qsjDfW+eRq5dAzdNdeURgAreCH162KFT+bIIAZQtswc6RS1AsC5M1kj6o S9cX5AF5K0XMaIorq5coITsfpWq/OxWi4L4P1TMTB6ctqiL01wOF/z3BSefdpr0MjAr5GsnAf/y LqKsz5hniCLTvZjgU1Ayvwq8usXkT8xaUY2zb9GfGdgGgmBRJSoleQR4XHmpHYNi5542R1lj46O y4qPwttgalxFYhy/FBpTsvlflTrGhicrlq+7hSDpjlvSXR6CYWn1w7gkVRb1cuHFR+Xj0BNYXvG A4i7Og4mKksF2x88F+5NOrW5SRklexTs4SBPGNo8Rz5cp+tYslwZmceoum3xCfLAbf0CVyMRym/ +eQd0GP5pUkNj2Jtjub8fvLlUFd542dMVBls5yK0Vw2zFC/nKbLCz36IRltDZCXJlsYgs5j0tVX dAwrcGCy/BjpcWA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Add a helper macro that wraps PINCTRL_GPIO_PINFUNCTION() for pinctrl-msm pin functions and assign the .function_is_gpio() callback in pinmux_ops. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-msm.c | 1 + drivers/pinctrl/qcom/pinctrl-msm.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinc= trl-msm.c index 96e40c2342bdedb8857629e503897f171a80e579..a5f69464827119dfe2a7781b558= 094b283fca215 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -265,6 +265,7 @@ static const struct pinmux_ops msm_pinmux_ops =3D { .get_functions_count =3D pinmux_generic_get_function_count, .get_function_name =3D pinmux_generic_get_function_name, .get_function_groups =3D pinmux_generic_get_function_groups, + .function_is_gpio =3D pinmux_generic_function_is_gpio, .gpio_request_enable =3D msm_pinmux_request_gpio, .set_mux =3D msm_pinmux_set_mux, }; diff --git a/drivers/pinctrl/qcom/pinctrl-msm.h b/drivers/pinctrl/qcom/pinc= trl-msm.h index d7dc0947bb161868c8f433dc2536719b8afc8bd8..4625fa5320a95a4d24e3a0c98a2= 49e4f163dd4c7 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.h +++ b/drivers/pinctrl/qcom/pinctrl-msm.h @@ -29,6 +29,11 @@ struct pinctrl_pin_desc; fname##_groups, \ ARRAY_SIZE(fname##_groups)) =20 +#define MSM_GPIO_PIN_FUNCTION(fname) \ + [msm_mux_##fname] =3D PINCTRL_GPIO_PINFUNCTION(#fname, \ + fname##_groups, \ + ARRAY_SIZE(fname##_groups)) + #define QCA_PIN_FUNCTION(fname) \ [qca_mux_##fname] =3D PINCTRL_PINFUNCTION(#fname, \ fname##_groups, \ --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 605502E543D for ; Fri, 15 Aug 2025 09:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248992; cv=none; b=isJWmM9z5UPpTBVqUx678VmFt2HNum+HUgKyn5OhlnwGylom1dJCs2+1pJptHcUVcf6jxypWQAP6ICnFle3oR05EbeM7S4y1n1Bo4vD9gGX6KmA7iK58RMU3aHv2fgxDyTR3bWESL8vygdHH6bu3HHa12miG8+fC+RkLjjdGj+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248992; c=relaxed/simple; bh=vf1MyQqTUh906uie0wJuo8fzAwB562VUK/aVO4anVkc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VDAqe0CUoRfbL1n0Uppoi4o8/hECHUomT49UZs8d90N0kE13A65PrC80IrCYl8Yl++sgSFFtk1enXcLMqOJrSTl01bCRm3bwjuoEuN7rBo1xPxhiBmTVCwhIPKB+8xBsgtJFrRdeiJP6MAwlXsKsTSlCtCAlWflP/x591nrfOwI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=qAmmAVvv; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="qAmmAVvv" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-45a1ac7c066so10123115e9.1 for ; Fri, 15 Aug 2025 02:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248980; x=1755853780; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6TfQEE8cwbjM9plrugfaKaYq7luPamLR3QwxxGoQ810=; b=qAmmAVvv6kp4/QKj0CkeO9ReFL+nSgITb9ULhQD84d9+BrZS2nEw+5s8iYta/slWxV RPadgmADtwp7Z7PsWlyyKISolgbhvjONB0DQhD0ukUEFXd8sO5ms3Kq+DNzSv7hOkmDm ilhw9B2ig2Cg6zhWf+Ksib5sjQhEEwjgQB7y7ydepRoAPn7y1ho5m4Po45GMMh8YxV7d 1129B1OlQ8w4HaFIniam2Y//qVrywXVEU0Tg2cdx63L4CO/9cVXNwcm2PwrTuVlDzp7r xZkL80WgNfpau5pKZSRwpta5H9tBSe+mynpCdNrKtyEJf0UdgqrPLU7FiO0T7Ykjrf1C FnZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248980; x=1755853780; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6TfQEE8cwbjM9plrugfaKaYq7luPamLR3QwxxGoQ810=; b=KAFa7XtgYctFZsHASi7hQ7g+dpIGjJkp1ycl/c0FOOHWWIP/hM1RtGCREyFOcAcEiu 58T7zay9vtDqQSr/yUZijd5bH2OE95RGn3IditxEtWvbtbAnWEq5EGU8T2v7boX9c3RZ RnMMhlGJctvKMSzCkg8ND6xjuFSe2qLKxwSPjz/UOkweiqKVwQxVXN6rApV5A1LH3014 qy7A//9ofN4gtqfOxXzftCCqxnSPDhq3KyVDbIMCQQXiOgKNuoX39WYO+Uadj0lZH8Ou DbhkJonGvNVZ0yff8Ips9LqIhHxkWhGjUSSPx20VKjh60xAc7NmXqciJ+gatotWkITdo U+hQ== X-Forwarded-Encrypted: i=1; AJvYcCVUo6tNEjLTm+PwfEsKNOomX/SCCYzr3v0bh6sxMKWOZEgofrnB8Izv5kkbR50w1VBf5FjTIsc3qc4K5UI=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2YMOutEhHDhcfRwKid7yFXS3/BkC8EKflJt4KCAD8PsJeZ1Qc txp4G5HL3nR5iZpTafzr0uGHf33Kwd0KZzz43TpYNV6Q51WqpPFye7U1gFp8g3/3luc= X-Gm-Gg: ASbGncuYdiDsWa+eFfjrfl1xfqWbyGNEIQqhY/Iy26U9OhQ/vvtjyDwhLjMBZPaSdtX H9EtsWz8pxhKNm5v/AqoOrVcSsd12UBaMW6TabQxF2RbhGI6/cmAX5W+DhpaPc9TkXbTtJyf12q wWZY6BA+wKNXw1loHA7QVAApTYn2BW2uUL4fwkIRNUvJvvPt+4XDQfy/WLDvxEJTcstUUTNA6U0 NWPvhw4zURRI0tFPFq4jkqEgP+SRgnjmvERy7kWPUkCdPQrK4WwMnYsOkovjKJh8VtjJ6CA+8KE 2vuBlxFMjL45mdpti13dlrxxslJQ777mhbE79rudkWsUGsaxwopdPX9Ah4X3MGGs9tB8O9Ja9sy GLTCLpo1y/bWXqzypiQ== X-Google-Smtp-Source: AGHT+IGnUmJQY8lI4AdocDNrPUSHWkWy8CRIts2u6+pdd0HW7S6rbdT4ViagRyVVGgVfFdHg9+aUzw== X-Received: by 2002:a05:600c:1d2a:b0:458:b8b0:6338 with SMTP id 5b1f17b1804b1-45a21801858mr12505515e9.6.1755248979749; Fri, 15 Aug 2025 02:09:39 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:39 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:16 +0200 Subject: [PATCH v5 14/15] pinctrl: qcom: mark the `gpio` and `egpio` pins function as non-strict functions 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: <20250815-pinctrl-gpio-pinfuncs-v5-14-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=35951; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=nHsco2Wzr2CAT5gE0mq3nSAwj0pKQdcWwYpWK83YXU0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk5p2bofiRRUBidQBlQOVc0kjlUibGiNohqK eftJ95qdXKJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OQAKCRARpy6gFHHX cv2kD/9hBiabJbR1ntT/tYy2deUWqpQH9qY7czY2tLvaHez8Qoi3lU7CJJpwTXgpg9kympgnD+S 9j6Z0sRP98UQpyu7PsNXhRWZlfswdn4wzQSOtD3in8aohomgE6v92HUeLr4/N4nT5cI09bxT0Sd BoHasWrVq/Soit6zkvgRRiEgzjo6PISIZQEzXuvrfDifr/2MGDU2XU1Xd2DjHKz7G6aoqy0WWN2 FQAuXm+D+/nC/6Njchk2JPO0SYZ3s3UdHQoC0ERpeff5eJTkZPubOscTeeUp5hpN9pQpUphhYVF yQEOCWpINMMoUvWsceJGnJOPwlxbFFZfvKlsF84d/xzcTgyjrYdFfKvv+1AlS7bgSaW4XKXYY/C WIxPL3L7jvUc3HtWtHfTJY3OSI7dmjXs37WzkzERnaK/qECHo6WNaH6pkTaEA7hXVQwn5DBnDcR Q5Ylz008NKBONcXNcalHEz8w7Re/aaVC/E91W6lc+uxzDkej36h51Cc8nTteKCLjV2JAsiHeDs4 3S0ewn1wjdSDzAtuYK9NH8TTMAYdSMunaxrD7guOwt7OMexANE8qEUu+3lfuEJ3nQfKflkhVRjO ueWGLimjIg6yIFki/96m1UX43LYC2tNP3ffHeYd2uQbOnL9u4fRGizXunC3U9rbZJb+uaY+dSkV SPpUvOzWmA+cr3g== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Allow pins muxed to the "gpio" or "egpio" function to be requested as GPIOs even if pinmux_ops say the controller should be strict. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-ipq5018.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq5332.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq5424.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq6018.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq8074.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq9574.c | 2 +- drivers/pinctrl/qcom/pinctrl-mdm9607.c | 2 +- drivers/pinctrl/qcom/pinctrl-mdm9615.c | 2 +- drivers/pinctrl/qcom/pinctrl-milos.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8226.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8660.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8909.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8916.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8917.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8953.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8960.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8976.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8994.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8996.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8998.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8x74.c | 2 +- drivers/pinctrl/qcom/pinctrl-qcm2290.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-qcs404.c | 2 +- drivers/pinctrl/qcom/pinctrl-qcs615.c | 2 +- drivers/pinctrl/qcom/pinctrl-qcs8300.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-qdu1000.c | 2 +- drivers/pinctrl/qcom/pinctrl-sa8775p.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sar2130p.c | 2 +- drivers/pinctrl/qcom/pinctrl-sc7180.c | 2 +- drivers/pinctrl/qcom/pinctrl-sc7280.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sc8180x.c | 2 +- drivers/pinctrl/qcom/pinctrl-sc8280xp.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sdm660.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdm670.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdm845.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdx55.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdx65.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdx75.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm4450.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6115.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6125.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6350.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6375.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm7150.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8150.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8250.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8350.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8450.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sm8550.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8650.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sm8750.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-x1e80100.c | 2 +- 52 files changed, 60 insertions(+), 60 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5018.c b/drivers/pinctrl/qcom/= pinctrl-ipq5018.c index 10b99d5d8a11db644e974a80b9d7d04ffc09bd4c..cbf34854f8826507430a9bb5a52= 7bdc5d87b9a8c 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq5018.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq5018.c @@ -630,7 +630,7 @@ static const struct pinfunction ipq5018_functions[] =3D= { MSM_PIN_FUNCTION(eud_gpio), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(led0), MSM_PIN_FUNCTION(led2), MSM_PIN_FUNCTION(mac0), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5332.c b/drivers/pinctrl/qcom/= pinctrl-ipq5332.c index 1ac2fc09c11923cd716495b16a7f4af5686ce398..239cbe75f198d3fadf39ed13387= f5cea625a8f63 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq5332.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq5332.c @@ -692,7 +692,7 @@ static const struct pinfunction ipq5332_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(lock_det), MSM_PIN_FUNCTION(mac0), MSM_PIN_FUNCTION(mac1), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5424.c b/drivers/pinctrl/qcom/= pinctrl-ipq5424.c index 7ff1f8acc1a3a81037298464130fda59f329d53e..67b452a033d62340d669bfff4b6= ae7b6d6cc430d 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq5424.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq5424.c @@ -641,7 +641,7 @@ static const struct pinfunction ipq5424_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2c0_scl), MSM_PIN_FUNCTION(i2c0_sda), MSM_PIN_FUNCTION(i2c1_scl), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq6018.c b/drivers/pinctrl/qcom/= pinctrl-ipq6018.c index a4ba980252e187879947e7057004fa48815f2620..be177fb0a92d957bd57126df9c2= a495b69ef1457 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq6018.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq6018.c @@ -891,7 +891,7 @@ static const struct pinfunction ipq6018_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(lpass_aud), MSM_PIN_FUNCTION(lpass_aud0), MSM_PIN_FUNCTION(lpass_aud1), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq8074.c b/drivers/pinctrl/qcom/= pinctrl-ipq8074.c index 482f13282fc2be951032cbe6dc5100bf9129ea5f..e94de90833140c83d50535778e6= 4044bb315c4ea 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq8074.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq8074.c @@ -838,7 +838,7 @@ static const struct pinfunction ipq8074_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(ldo_en), MSM_PIN_FUNCTION(ldo_update), MSM_PIN_FUNCTION(led0), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq9574.c b/drivers/pinctrl/qcom/= pinctrl-ipq9574.c index 89c05d8eb55034dea3e1c7299ede6567c20e0159..3ed093ea8eb9074426934336dcf= b9d74e3b8af22 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq9574.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq9574.c @@ -651,7 +651,7 @@ static const struct pinfunction ipq9574_functions[] =3D= { MSM_PIN_FUNCTION(dwc_ddrphy), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(mac), MSM_PIN_FUNCTION(mdc), MSM_PIN_FUNCTION(mdio), diff --git a/drivers/pinctrl/qcom/pinctrl-mdm9607.c b/drivers/pinctrl/qcom/= pinctrl-mdm9607.c index 3e18ba124fede923f56eab1aec5aaf875f06e343..cef330547ce78d4c8cc873251d7= 7f18b29aff57b 100644 --- a/drivers/pinctrl/qcom/pinctrl-mdm9607.c +++ b/drivers/pinctrl/qcom/pinctrl-mdm9607.c @@ -861,7 +861,7 @@ static const struct pinfunction mdm9607_functions[] =3D= { MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), MSM_PIN_FUNCTION(gmac_mdio), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(lcd_rst), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-mdm9615.c b/drivers/pinctrl/qcom/= pinctrl-mdm9615.c index bea1ca3d1b7f84c28c23af2a52cc464da44a90b0..729fe3d7e14efcfa247da2daac9= 99c4038e1613c 100644 --- a/drivers/pinctrl/qcom/pinctrl-mdm9615.c +++ b/drivers/pinctrl/qcom/pinctrl-mdm9615.c @@ -313,7 +313,7 @@ static const char * const cdc_mclk_groups[] =3D { }; =20 static const struct pinfunction mdm9615_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsbi2_i2c), MSM_PIN_FUNCTION(gsbi3), MSM_PIN_FUNCTION(gsbi4), diff --git a/drivers/pinctrl/qcom/pinctrl-milos.c b/drivers/pinctrl/qcom/pi= nctrl-milos.c index d11a7bbcd7331675bdd979f5a9933d9ff226c823..19abd5233a2c54e9a5fcf3a2ed4= 4056471196146 100644 --- a/drivers/pinctrl/qcom/pinctrl-milos.c +++ b/drivers/pinctrl/qcom/pinctrl-milos.c @@ -974,7 +974,7 @@ static const char *const wcn_sw_ctrl_groups[] =3D { }; =20 static const struct pinfunction milos_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8226.c b/drivers/pinctrl/qcom/= pinctrl-msm8226.c index f9a957347340813f87e58d3bcbea81faa9d6255e..a81aa092ef1240c9e951352720d= 48db6d269aff9 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8226.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8226.c @@ -483,7 +483,7 @@ static const struct pinfunction msm8226_functions[] =3D= { MSM_PIN_FUNCTION(cci_i2c0), MSM_PIN_FUNCTION(gp0_clk), MSM_PIN_FUNCTION(gp1_clk), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(sdc3), MSM_PIN_FUNCTION(wlan), }; diff --git a/drivers/pinctrl/qcom/pinctrl-msm8660.c b/drivers/pinctrl/qcom/= pinctrl-msm8660.c index 4dbc19ffd80efcdab059a253904e1ffe95fd36f7..5ded00396cd949f432c4bdcd3b1= 224cbfae34f8c 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8660.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8660.c @@ -714,7 +714,7 @@ static const char * const ebi2_groups[] =3D { }; =20 static const struct pinfunction msm8660_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(cam_mclk), MSM_PIN_FUNCTION(dsub), MSM_PIN_FUNCTION(ext_gps), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8909.c b/drivers/pinctrl/qcom/= pinctrl-msm8909.c index 0aa4f77b774f45947ffade7d167dd25cc4da5297..544a52fb8f3d6e6abfd97e2c073= 6e8242b51d7ba 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8909.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8909.c @@ -696,7 +696,7 @@ static const struct pinfunction msm8909_functions[] =3D= { MSM_PIN_FUNCTION(gcc_gp3_clk_a), MSM_PIN_FUNCTION(gcc_gp3_clk_b), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(ldo_en), MSM_PIN_FUNCTION(ldo_update), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8916.c b/drivers/pinctrl/qcom/= pinctrl-msm8916.c index 0dfc6dd33d58b2d9df7a5cc3f7ff8890976207d3..b1b6934bb4b6357f04d84ce9c24= 4ba930c1916ba 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8916.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8916.c @@ -743,7 +743,7 @@ static const struct pinfunction msm8916_functions[] =3D= { MSM_PIN_FUNCTION(gcc_gp2_clk_b), MSM_PIN_FUNCTION(gcc_gp3_clk_a), MSM_PIN_FUNCTION(gcc_gp3_clk_b), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx0), MSM_PIN_FUNCTION(gsm0_tx1), MSM_PIN_FUNCTION(gsm1_tx0), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8917.c b/drivers/pinctrl/qcom/= pinctrl-msm8917.c index 2e1a94ab18b219f818c591ff3b07280578822d1a..f23d92d6615b8926dc04ba0056c= bce6715cc7b21 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8917.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8917.c @@ -1302,7 +1302,7 @@ static const struct pinfunction msm8917_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3_clk_b), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(key_focus), MSM_PIN_FUNCTION(key_snapshot), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8953.c b/drivers/pinctrl/qcom/= pinctrl-msm8953.c index 956383341a7a777edf28c710353dc6deab124ef9..67db062fdf5628fb41588f2dc5a= 79a9e3499e5b6 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8953.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8953.c @@ -1533,7 +1533,7 @@ static const struct pinfunction msm8953_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3_clk_b), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(gsm1_tx), MSM_PIN_FUNCTION(gyro_int), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8960.c b/drivers/pinctrl/qcom/= pinctrl-msm8960.c index a937ea867de709326a2aea77f980cae1d8480f35..2fb15208aba050a1bf669a2e304= e389fd10fe0be 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8960.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8960.c @@ -974,7 +974,7 @@ static const struct pinfunction msm8960_functions[] =3D= { MSM_PIN_FUNCTION(gp_pdm_1b), MSM_PIN_FUNCTION(gp_pdm_2a), MSM_PIN_FUNCTION(gp_pdm_2b), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsbi1), MSM_PIN_FUNCTION(gsbi1_spi_cs1_n), MSM_PIN_FUNCTION(gsbi1_spi_cs2a_n), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8976.c b/drivers/pinctrl/qcom/= pinctrl-msm8976.c index 3bcb03387781f803bf7e0251496a88a43b562b8d..345539b9e696f0decdb02b24eb0= f966c7439af9d 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8976.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8976.c @@ -812,7 +812,7 @@ static const char * const ss_switch_groups[] =3D { }; =20 static const struct pinfunction msm8976_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(blsp_spi1), MSM_PIN_FUNCTION(smb_int), MSM_PIN_FUNCTION(blsp_i2c1), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8994.c b/drivers/pinctrl/qcom/= pinctrl-msm8994.c index 7a3b6cbccb687c8b5040ee6bf372f092f21aa872..94e042d1f4b2a5f20c3c3e9287b= 254e1e06c4050 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8994.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8994.c @@ -1071,7 +1071,7 @@ static const struct pinfunction msm8994_functions[] = =3D { MSM_PIN_FUNCTION(uim2), MSM_PIN_FUNCTION(uim3), MSM_PIN_FUNCTION(uim4), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), }; =20 static const struct msm_pingroup msm8994_groups[] =3D { diff --git a/drivers/pinctrl/qcom/pinctrl-msm8996.c b/drivers/pinctrl/qcom/= pinctrl-msm8996.c index d86d83106d3ba12343a4685e5b87c661f823c35b..e5b55693d02377c1bd992504a9d= 15a9ce015cf84 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8996.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8996.c @@ -1532,7 +1532,7 @@ static const struct pinfunction msm8996_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp2_clk_b), MSM_PIN_FUNCTION(gcc_gp3_clk_a), MSM_PIN_FUNCTION(gcc_gp3_clk_b), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm_tx), MSM_PIN_FUNCTION(hdmi_cec), MSM_PIN_FUNCTION(hdmi_ddc), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8998.c b/drivers/pinctrl/qcom/= pinctrl-msm8998.c index 1daee815888f54b711505dfacefd614df83affc0..b727593af34af94925fd9c938e3= c03c40ad59eaa 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8998.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8998.c @@ -1160,7 +1160,7 @@ static const char * const mss_lte_groups[] =3D { }; =20 static const struct pinfunction msm8998_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8x74.c b/drivers/pinctrl/qcom/= pinctrl-msm8x74.c index 8253aa25775b247dc54a377c9781094e465e22b6..202bec003e96f1d2d68703676e6= e8a88f1ffdae5 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8x74.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8x74.c @@ -778,7 +778,7 @@ static const char * const slimbus_groups[] =3D { "gpio7= 0", "gpio71" }; static const char * const hsic_ctl_groups[] =3D { "hsic_strobe", "hsic_dat= a" }; =20 static const struct pinfunction msm8x74_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(cci_i2c0), MSM_PIN_FUNCTION(cci_i2c1), MSM_PIN_FUNCTION(uim1), diff --git a/drivers/pinctrl/qcom/pinctrl-qcm2290.c b/drivers/pinctrl/qcom/= pinctrl-qcm2290.c index eeeec6434f6a68a588ff58641b7c25c261b5749a..38200957451e1975b7215eae6a2= d10329a30a57d 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcm2290.c +++ b/drivers/pinctrl/qcom/pinctrl-qcm2290.c @@ -870,11 +870,11 @@ static const struct pinfunction qcm2290_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi1), MSM_PIN_FUNCTION(ddr_pxi2), MSM_PIN_FUNCTION(ddr_pxi3), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), diff --git a/drivers/pinctrl/qcom/pinctrl-qcs404.c b/drivers/pinctrl/qcom/p= inctrl-qcs404.c index 54e3b44353494e9398a88702945b7a85ff901b4d..0b8db2c7e58a9b6f6b832c89987= 66f2711068dd2 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcs404.c +++ b/drivers/pinctrl/qcom/pinctrl-qcs404.c @@ -1296,7 +1296,7 @@ static const char * const i2s_3_ws_a_groups[] =3D { }; =20 static const struct pinfunction qcs404_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(hdmi_tx), MSM_PIN_FUNCTION(hdmi_ddc), MSM_PIN_FUNCTION(blsp_uart_tx_a2), diff --git a/drivers/pinctrl/qcom/pinctrl-qcs615.c b/drivers/pinctrl/qcom/p= inctrl-qcs615.c index 2a943bc46a6299899abd87523f24e7e291f24c57..4dfa820d4e77ce8157a3503ee8e= c6e426b54e030 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcs615.c +++ b/drivers/pinctrl/qcom/pinctrl-qcs615.c @@ -819,7 +819,7 @@ static const char *const wsa_data_groups[] =3D { }; =20 static const struct pinfunction qcs615_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(aoss_cti), diff --git a/drivers/pinctrl/qcom/pinctrl-qcs8300.c b/drivers/pinctrl/qcom/= pinctrl-qcs8300.c index d6437e26392b60f5d345f2591e98516a9d933a0f..f1af1a620684cd48e0282d4452c= 3f00af6ca0302 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcs8300.c +++ b/drivers/pinctrl/qcom/pinctrl-qcs8300.c @@ -929,7 +929,7 @@ static const char *const vsense_trigger_groups[] =3D { }; =20 static const struct pinfunction qcs8300_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb2), @@ -949,7 +949,7 @@ static const struct pinfunction qcs8300_functions[] =3D= { MSM_PIN_FUNCTION(edp0_hot), MSM_PIN_FUNCTION(edp0_lcd), MSM_PIN_FUNCTION(edp1_lcd), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(emac0_mcg0), MSM_PIN_FUNCTION(emac0_mcg1), MSM_PIN_FUNCTION(emac0_mcg2), diff --git a/drivers/pinctrl/qcom/pinctrl-qdu1000.c b/drivers/pinctrl/qcom/= pinctrl-qdu1000.c index eacb89fa388850ef39ceb50497df9e5cca54191c..7c535698a780041c2660c08d221= 46c8d700ce081 100644 --- a/drivers/pinctrl/qcom/pinctrl-qdu1000.c +++ b/drivers/pinctrl/qcom/pinctrl-qdu1000.c @@ -904,7 +904,7 @@ static const char * const vsense_trigger_groups[] =3D { }; =20 static const struct pinfunction qdu1000_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(cmo_pri), MSM_PIN_FUNCTION(si5518_int), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sa8775p.c b/drivers/pinctrl/qcom/= pinctrl-sa8775p.c index 1b62eb3e6620c978225c5fd2ab541451cbe93093..53f28b9c49ba2dba7cfbbeb1377= 4d011bd31fae9 100644 --- a/drivers/pinctrl/qcom/pinctrl-sa8775p.c +++ b/drivers/pinctrl/qcom/pinctrl-sa8775p.c @@ -1181,7 +1181,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction sa8775p_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb2), MSM_PIN_FUNCTION(audio_ref), @@ -1217,7 +1217,7 @@ static const struct pinfunction sa8775p_functions[] = =3D { MSM_PIN_FUNCTION(edp2_lcd), MSM_PIN_FUNCTION(edp3_hot), MSM_PIN_FUNCTION(edp3_lcd), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(emac0_mcg0), MSM_PIN_FUNCTION(emac0_mcg1), MSM_PIN_FUNCTION(emac0_mcg2), diff --git a/drivers/pinctrl/qcom/pinctrl-sar2130p.c b/drivers/pinctrl/qcom= /pinctrl-sar2130p.c index 3dd1b5e5cfee489ec34b16ee2ae1c8d2c2756553..4a53f4ee20418e755926770693f= 81a582c431e6f 100644 --- a/drivers/pinctrl/qcom/pinctrl-sar2130p.c +++ b/drivers/pinctrl/qcom/pinctrl-sar2130p.c @@ -1128,7 +1128,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction sar2130p_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(qup0), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sc7180.c b/drivers/pinctrl/qcom/p= inctrl-sc7180.c index c43fe10b71add7d6294c90e86578ed472b8759a3..3eae51472b137372f358278a7fb= 04ace7430bcf4 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc7180.c +++ b/drivers/pinctrl/qcom/pinctrl-sc7180.c @@ -903,7 +903,7 @@ static const struct pinfunction sc7180_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), diff --git a/drivers/pinctrl/qcom/pinctrl-sc7280.c b/drivers/pinctrl/qcom/p= inctrl-sc7280.c index 1b070e9d41f5972470d245edb821d202ca24522b..44e09608aad07acbd8354d5cb3e= 7f02b6e736f01 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc7280.c +++ b/drivers/pinctrl/qcom/pinctrl-sc7280.c @@ -1153,11 +1153,11 @@ static const struct pinfunction sc7280_functions[] = =3D { MSM_PIN_FUNCTION(dp_lcd), MSM_PIN_FUNCTION(edp_hot), MSM_PIN_FUNCTION(edp_lcd), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(host2wlan_sol), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sc8180x.c b/drivers/pinctrl/qcom/= pinctrl-sc8180x.c index 26dd165d154348a8659720335ec16c3e5ace30ef..d494e176383d25a369c217d1c64= 9b580c374d35b 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc8180x.c +++ b/drivers/pinctrl/qcom/pinctrl-sc8180x.c @@ -1272,7 +1272,7 @@ static const struct pinfunction sc8180x_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_gp4), MSM_PIN_FUNCTION(gcc_gp5), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps), MSM_PIN_FUNCTION(grfc), MSM_PIN_FUNCTION(hs1_mi2s), diff --git a/drivers/pinctrl/qcom/pinctrl-sc8280xp.c b/drivers/pinctrl/qcom= /pinctrl-sc8280xp.c index 6ccd7e5648d420072f7ce467d92ef0764a6d7764..cf8297e8b8f8c98add4cc5d305e= 99a2cd1f7a52a 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc8280xp.c +++ b/drivers/pinctrl/qcom/pinctrl-sc8280xp.c @@ -1506,7 +1506,7 @@ static const struct pinfunction sc8280xp_functions[] = =3D { MSM_PIN_FUNCTION(edp2_lcd), MSM_PIN_FUNCTION(edp3_lcd), MSM_PIN_FUNCTION(edp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(emac0_dll), MSM_PIN_FUNCTION(emac0_mcg0), MSM_PIN_FUNCTION(emac0_mcg1), @@ -1527,7 +1527,7 @@ static const struct pinfunction sc8280xp_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_gp4), MSM_PIN_FUNCTION(gcc_gp5), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(hs1_mi2s), MSM_PIN_FUNCTION(hs2_mi2s), MSM_PIN_FUNCTION(hs3_mi2s), diff --git a/drivers/pinctrl/qcom/pinctrl-sdm660.c b/drivers/pinctrl/qcom/p= inctrl-sdm660.c index 1a78288f1bc832837d5c72d9eb1659f397d79b94..687d986de75c4df5d91c6cda3c4= 3beecfb24795b 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdm660.c +++ b/drivers/pinctrl/qcom/pinctrl-sdm660.c @@ -1157,7 +1157,7 @@ static const struct pinfunction sdm660_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps_tx_a), MSM_PIN_FUNCTION(gps_tx_b), MSM_PIN_FUNCTION(gps_tx_c), diff --git a/drivers/pinctrl/qcom/pinctrl-sdm670.c b/drivers/pinctrl/qcom/p= inctrl-sdm670.c index 0fe1fa94cd6da13591397442a63ce8daec9f4674..486b72edf7b4ec9d30bbbffbf53= d41db2c9e8157 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdm670.c +++ b/drivers/pinctrl/qcom/pinctrl-sdm670.c @@ -991,7 +991,7 @@ static const char * const mss_lte_groups[] =3D { }; =20 static const struct pinfunction sdm670_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sdm845.c b/drivers/pinctrl/qcom/p= inctrl-sdm845.c index 0446e291aa4831da439af12b7934fbda5915ee5a..4cf8575797a0f49646e0dd7a934= 80dfbd6ba3a04 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdm845.c +++ b/drivers/pinctrl/qcom/pinctrl-sdm845.c @@ -976,7 +976,7 @@ static const char * const tsif1_sync_groups[] =3D { }; =20 static const struct pinfunction sdm845_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sdx55.c b/drivers/pinctrl/qcom/pi= nctrl-sdx55.c index 2c17bf889146362edf9f482d33b17d35a255882e..79a7010b73f187f4aeab8ff7e27= 461984c1c9c3f 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdx55.c +++ b/drivers/pinctrl/qcom/pinctrl-sdx55.c @@ -796,7 +796,7 @@ static const struct pinfunction sdx55_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2s_mclk), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-sdx65.c b/drivers/pinctrl/qcom/pi= nctrl-sdx65.c index 85b5c0206dbd199c6efc15aad10784d20c1addde..cc8a99a6a91ed253883535f3eb0= 338939db9a677 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdx65.c +++ b/drivers/pinctrl/qcom/pinctrl-sdx65.c @@ -732,7 +732,7 @@ static const struct pinfunction sdx65_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2s_mclk), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-sdx75.c b/drivers/pinctrl/qcom/pi= nctrl-sdx75.c index ab13a3a57a830781f35916ff508ca65d6699271d..4078d83d818c3352253563fc452= 73a293cfe4ce8 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdx75.c +++ b/drivers/pinctrl/qcom/pinctrl-sdx75.c @@ -852,7 +852,7 @@ static const struct pinfunction sdx75_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp2_clk), MSM_PIN_FUNCTION(gcc_gp3_clk), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2s_mclk), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-sm4450.c b/drivers/pinctrl/qcom/p= inctrl-sm4450.c index 1ecdf1ab4f275ede7cb629321f9c37d3f81a25e9..d51e271e336101796b75d64e56f= 573f3547f1121 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm4450.c +++ b/drivers/pinctrl/qcom/pinctrl-sm4450.c @@ -722,7 +722,7 @@ static const char * const wlan1_adc_dtest1_groups[] =3D= { }; =20 static const struct pinfunction sm4450_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb0), MSM_PIN_FUNCTION(audio_ref_clk), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6115.c b/drivers/pinctrl/qcom/p= inctrl-sm6115.c index c273efa4399630a2187845382e231fe150d997fd..06700685ea2a380b84464d17955= d040e55eb587c 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6115.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6115.c @@ -687,7 +687,7 @@ static const struct pinfunction sm6115_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6125.c b/drivers/pinctrl/qcom/p= inctrl-sm6125.c index 5092f20e0c1bdee2e99b768f12cfbec31972c24c..5d3d1e402345ebb86524b508c45= cf9fc9a0f2031 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6125.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6125.c @@ -943,7 +943,7 @@ static const char * const dmic1_data_groups[] =3D { =20 static const struct pinfunction sm6125_functions[] =3D { MSM_PIN_FUNCTION(qup00), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(qdss), MSM_PIN_FUNCTION(qup01), MSM_PIN_FUNCTION(qup02), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6350.c b/drivers/pinctrl/qcom/p= inctrl-sm6350.c index ba4686c86c54b8c1dc32522c83587521e149a5ae..220fb582cac9fcc97271cc0feb2= adc5b32c85994 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6350.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6350.c @@ -1048,7 +1048,7 @@ static const struct pinfunction sm6350_functions[] = =3D { MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps_tx), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6375.c b/drivers/pinctrl/qcom/p= inctrl-sm6375.c index 49031571e65ee3291fb1e5269e071a08a77c87de..08b8ef6efaf09741e8826e08a2c= 12ef49680504a 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6375.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6375.c @@ -1172,7 +1172,7 @@ static const struct pinfunction sm6375_functions[] = =3D { MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps_tx), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sm7150.c b/drivers/pinctrl/qcom/p= inctrl-sm7150.c index 6e89966cd70e34bcb74cfb50e80e110e40655b0e..78dd8153a4d4e5bb68dd5d22aa7= f2b6dc6a5fddb 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm7150.c +++ b/drivers/pinctrl/qcom/pinctrl-sm7150.c @@ -960,7 +960,7 @@ static const char * const wsa_data_groups[] =3D { }; =20 static const struct pinfunction sm7150_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(aoss_cti), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8150.c b/drivers/pinctrl/qcom/p= inctrl-sm8150.c index 794ed99463f76032f56be9464a4aa3018537df94..ad861cd66958c4faa929737e508= 8b82a35ffc95b 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8150.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8150.c @@ -1217,7 +1217,7 @@ static const struct pinfunction sm8150_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(hs1_mi2s), MSM_PIN_FUNCTION(hs2_mi2s), MSM_PIN_FUNCTION(hs3_mi2s), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8250.c b/drivers/pinctrl/qcom/p= inctrl-sm8250.c index fb6f005d64f53f318d58e69681f07e36404439cf..6021d9f6e407ef57a6b1ebaaa27= 039c0fea7e18c 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8250.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8250.c @@ -1021,7 +1021,7 @@ static const struct pinfunction sm8250_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(lpass_slimbus), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8350.c b/drivers/pinctrl/qcom/p= inctrl-sm8350.c index c8a3f39ce6f1b8565a783f04100269b3cadb9bcc..99949b552021131f5aade06a80b= d01799835e67a 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8350.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8350.c @@ -1267,7 +1267,7 @@ static const struct pinfunction sm8350_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(lpass_slimbus), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8450.c b/drivers/pinctrl/qcom/p= inctrl-sm8450.c index f2e52d5a0f9369d21922d0651539908d592301e5..9889fc5dc2cd204588abd06cfd7= d1ae0e4513af0 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8450.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8450.c @@ -1269,7 +1269,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction sm8450_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aon_cam), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), @@ -1291,7 +1291,7 @@ static const struct pinfunction sm8450_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi2), MSM_PIN_FUNCTION(ddr_pxi3), MSM_PIN_FUNCTION(dp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8550.c b/drivers/pinctrl/qcom/p= inctrl-sm8550.c index 1b4496cb39eb46b2b660ef213e1f3c8fdac2b21e..10a62031fdfd044f851165e3460= 59d1834ff7c9c 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8550.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8550.c @@ -1340,7 +1340,7 @@ static const char *const vsense_trigger_mirnat_groups= [] =3D { }; =20 static const struct pinfunction sm8550_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aon_cci), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8650.c b/drivers/pinctrl/qcom/p= inctrl-sm8650.c index 449a0077f4b10666ecd9dfaae8e0057a91e181a6..e2ae038002060d2f93c091c716b= 1ec7fb9b6498d 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8650.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8650.c @@ -1328,7 +1328,7 @@ static const char *const vsense_trigger_mirnat_groups= [] =3D { }; =20 static const struct pinfunction sm8650_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), @@ -1359,7 +1359,7 @@ static const struct pinfunction sm8650_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi3), MSM_PIN_FUNCTION(do_not), MSM_PIN_FUNCTION(dp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8750.c b/drivers/pinctrl/qcom/p= inctrl-sm8750.c index 8516693d1db51d3e890e298ea6500ae62333bc69..6f92f176edd4593563a95dc8b0c= fde2b6ad3a213 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8750.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8750.c @@ -1290,7 +1290,7 @@ static const char *const wcn_sw_ctrl_groups[] =3D { }; =20 static const struct pinfunction sm8750_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), @@ -1319,7 +1319,7 @@ static const struct pinfunction sm8750_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi2), MSM_PIN_FUNCTION(ddr_pxi3), MSM_PIN_FUNCTION(dp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), diff --git a/drivers/pinctrl/qcom/pinctrl-x1e80100.c b/drivers/pinctrl/qcom= /pinctrl-x1e80100.c index d4b215f34c39bf67a0656a3f894b8639491e898b..bb36f40b19fa53eedf68d46d029= 86410d07a733c 100644 --- a/drivers/pinctrl/qcom/pinctrl-x1e80100.c +++ b/drivers/pinctrl/qcom/pinctrl-x1e80100.c @@ -1407,7 +1407,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction x1e80100_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(RESOUT_GPIO), MSM_PIN_FUNCTION(aon_cci), MSM_PIN_FUNCTION(aoss_cti), --=20 2.48.1 From nobody Sat Oct 4 14:35:19 2025 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B3072DCF60 for ; Fri, 15 Aug 2025 09:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248989; cv=none; b=PwxK4vgZ6lNnmVKXJ+WwsvWqje26KOyAD+oQhPZmja1ppsSJ5RYXJvTeuGVnwY/fy3lkp+CjSCZ5n8fnw3TbbWshZCuyxWImD0H/K4V36M3D1PKyJN4TF/7TiKwCXj6GIt+BQD6lEZ3eYpV8BrwKflW0hiTcFSb3Yj1xz+lAj94= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755248989; c=relaxed/simple; bh=RFujl0Cr/YaORxwURfe0zTKDzCwOsKiOevFTrddSrvg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c9Fqy5vyQI7xrQxnXHthI7Xzo8ltgmnDp7roA1vtBQs9+Mrb0lQarzkghb3xMPjCw1iSaDkEJZXnRRk1/mK08MrWHRes9c58QukpQIIwCD17TLORTdkpBFDouySJoaFjr/20KVUINPCBDsW3Me2Qlt5nvMb//wqUj+Yx5fOqbcE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=nwPSVJP8; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="nwPSVJP8" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3b9dc5cd4cbso1313287f8f.1 for ; Fri, 15 Aug 2025 02:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1755248981; x=1755853781; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jAO2WeXDFkbtwkjKyd1xrqU98u0EGyjojmTyXcAuE7w=; b=nwPSVJP8PNQZglWu7s1RRRcQza/NcW6MSysM9IfnFWgr4WpgZz8taka9NfK0c6fE3p AtCV/0lFIYI8yq8GQsm6an+VfRKGK7JhczRVc048QMo1fBwXkCtie7iOaLYvAykQqQfS 7zzQwKhRKCOOBIdEZ5oisXzx3EVY4CSYjdzX2967BVldvdk6PxPY76kTZipXqcJxxlUa vfwqbKWKlp1hU7guGCSLzdv2BkKJL8IM1P/nrnr4qrexspCK2RO/b5NVbj/oql5mWwmO o2zh3SJosu1HKz4xJkANU8rmhIXADXVLMniliRZXL39YfqOWOKCM/vf0KFLFYiMbUwQt 7nrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755248981; x=1755853781; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jAO2WeXDFkbtwkjKyd1xrqU98u0EGyjojmTyXcAuE7w=; b=MtWYRL89WbsV2d8m2MGhYDQRVu6701IzH6+6B6NsZ4RJAmYwEbmVcE44l+fMHMtKRi kKw9nq09l+JTZXsD8zLzq2ifJ+nh2LFkK2nV4xdnQsgpt9dmJfmnbCMGnvv3/ESr5w5R u9mqOiD7oLAYMrS14YvgOBgo02hAzeyQL/ZwcaNxQfes1jNEzVEQv+0RyvFMOSvpvIUv psCgo0uHvFiCMKh6SlEK83AWrOVAFnA9RKn5MVtqplW+V98qMdhP7uoWf0rNkN/ZhFpf 2fvsTpNjWBBNZ2Gy14qyfWS4VtKU8t7gOm5dyxyFFaGTiMhcj0G2a7xLPZym9NUeaZbg c2Nw== X-Forwarded-Encrypted: i=1; AJvYcCVwYmEyFPPXDYdCqJ0hxOSlSbRy65rA583BpLoiDbcTdGDVqA9DYat44cQGjhfn97hHR0qkysDF+zRxvos=@vger.kernel.org X-Gm-Message-State: AOJu0YxFfh3MjJLXswQHz+Gz4/pFLyl3kNoYqNCK55l0Nn5RsNkiQ4vW 2B21ErXJ64emCARUfBTnMBETLooPy5KKFSUxEdrLh4bcspSUxxIRQ2KOfBQFON8U8Lo= X-Gm-Gg: ASbGnctf+ocz0ZU1vcblvDDuAqSTDXM8xUcql0ONrvyfgt2YZqm04yyGyCUok9YIEBL ZeRkLfrOau50DrVI1LdlfeYDTYXhPUT+Ie/qNtjPO+LqR4/Y8u1Mz+F4JFsrCq6x5ezQfIgKhJw 8QT0UJudVAo/H3WFor5c21vVTM/F99KBit3ZbDKfMLv0bRPqgIxF8VZvCEF1VESLJky7SPeoVkn WrA7ccL1ED1HTDWovECczqSwx1SgmqPXRSTcjP1Kem1JlvZXOy08XIT613QjaEzw4goNEWiztBh VRmTCthYSo437OapDKF7Yl+XVOJ1RXinHIuzkeeHfj6JGRzxdQd6Wzs4iKOOVGx0yBpxQLe75Gg IlEhOfwpBcg30dQvAfA== X-Google-Smtp-Source: AGHT+IH6u9qd88jYtkMUMO7Pk2wdt7IioAAqpR67Wlnaqpb4Xq5KR98LGHT/fAn80hsOAq7ogVV7XQ== X-Received: by 2002:a05:6000:3108:b0:3b8:d8cc:dcf3 with SMTP id ffacd0b85a97d-3bb68921b21mr916109f8f.29.1755248981350; Fri, 15 Aug 2025 02:09:41 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a125:bd3e:6904:c9f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3bb676c9a67sm1205210f8f.35.2025.08.15.02.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 02:09:40 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 15 Aug 2025 11:09:17 +0200 Subject: [PATCH v5 15/15] pinctrl: qcom: make the pinmuxing strict 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: <20250815-pinctrl-gpio-pinfuncs-v5-15-955de9fd91db@linaro.org> References: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> In-Reply-To: <20250815-pinctrl-gpio-pinfuncs-v5-0-955de9fd91db@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1142; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=M6AAfE1ZYIqFZsBoDZ4O1bJllvK/6bMXFJ6Zryc+i/E=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBonvk6E0B63uoFwvdNfdM6shEMGyPseEvOlsf0/ xE/Q7RcUMmJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJ75OgAKCRARpy6gFHHX cgUiEADKwU+j0rwTCMMo4gp+q9WJ8f3aBc4TC+eTJd7Rb68K/vvR8mQoOObnc5vYp4f1bGS5hjx nhb+kFiHt9322cnLeohSt3ZOFPCzHPEj2QRLHCoHJ/Z//LaWVcxvSNu/k5B0wuFON9igEj3HZnu cpu9eGKkr2mIAfESMNu2yXlUPQB5vXtiZ9y0GkHRefEdE18uLI39sKYfWLR/ZeMGcUUp86JjYUr 2BJ39RDdZCMbvLjh8df1T6RwANJSK2q7RbAnM1uvo7hUhvPnQYiTe8yo4a3aELWbv/TVbD9jT8K ZXGeUzH85xQKEQ0JTjzReXrxA748Oyq3uLoLuL1GzHqTkRiMnu18+BBTvaCr3u4TB8SVgkbF6Ls AUXyGIRAk5hGTn6lf6aeYN+NrvwvlvPtCtdN8ZTpi6p4GT0PfS0o1QOMVO8X0DrcDLo6nilrVyp GKZ4vywviTy/wxChO1vznkIdtfA5ylI00rp9tKrccz4rpnda311StQvjVC9o1Py9DeKtv0cGGh9 SJ4Mcj0suKefpRxOr8UWj05HldOdGpacP8CC7eTEE6LPapXVPDfkem2wLu4/01B+kl8N2cVPOdn io4s9PHmIyv1eMTsFNfIOUPPLb+j7PMBFXlGzqUadBKgYD6NcwP8wBOIeXNI5r7bkDQb8eF19oG qT+jLfULiytDlBw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The strict flag in struct pinmux_ops disallows the usage of the same pin as a GPIO and for another function. Without it, a rouge user-space process with enough privileges (or even a buggy driver) can request a used pin as GPIO and drive it, potentially confusing devices or even crashing the system. Set it globally for all pinctrl-msm users. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-msm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinc= trl-msm.c index a5f69464827119dfe2a7781b558094b283fca215..1751d838ce95d6138c824b90098= f74891dec7656 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -268,6 +268,7 @@ static const struct pinmux_ops msm_pinmux_ops =3D { .function_is_gpio =3D pinmux_generic_function_is_gpio, .gpio_request_enable =3D msm_pinmux_request_gpio, .set_mux =3D msm_pinmux_set_mux, + .strict =3D true, }; =20 static int msm_config_reg(struct msm_pinctrl *pctrl, --=20 2.48.1