From nobody Fri Oct 3 15:34:25 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 AC6E3202987 for ; Thu, 28 Aug 2025 16:00:21 +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=1756396823; cv=none; b=pcRXz1KUWJ3XaEHBVehCcxh4+Iu03T/dxlzZtvIMSD3tMlANWsz3TlhckTOUZn97SNAkq5niXTTFmJgCNsp5lINAUcMrQVBhpae95XkZcXgypBz8te2ZRk2dKLk0GJWg0FsIiBawRgl1OQ3O+oB3WlzzDn8FcWxzwDZ5d64kHMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396823; 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=Ct/jX+vve4aJqLTNfbmlQPrFz/W9hcCP6YATo/Ur1I5FU4+rGFpRg+djo4bLXZIbF2lViAqGxYr6YzJJ+ag4PYL0D/8S4EqbHxOUM66NzR8TpSONCOmF8B3Uq0ZIWctI+GfZd5JK/cBn96uzLQU1GalZktC5Kdz5enx4eerPNoo= 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=0aYQIyRt; 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="0aYQIyRt" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3cbb0df3981so536060f8f.3 for ; Thu, 28 Aug 2025 09:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396820; x=1757001620; 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=0aYQIyRtnm/jNBmzZXViV7QZOtRQjvom2hK4NujkaTV+2rqBdHDf8dhlPZZQSKVIYe 6wjBvhxi+VL1MC7uFMrcuoy+l9I7tqeaLnMM7jhYbEPFS6shv9KueT1Mx8xrTpAk2FpQ nkYhezbQzigqtJY7Xx5SX2lmz4J3BRcjshH3u9ENP3p51/iS2+UVQmNjnUXVvp8XXoEw Vf5VbWwqD78qoBs8G0OYMD0jmWtL45rvgs4FoD5UOQ3yRTDhcT5DSzBshDTgwNtAJnDh ya0gR2wlAja/kzCVmA2146XrHWw2S6PSBRP5RGNjBJMbGNnIR91c04FQcm2su+9gPgGy cSnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396820; x=1757001620; 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=aUim9OqNQUxs/oixF6uGf8+crfT/+OKnrBgDsL9MrvhW00lS73Z7XyBDptzIFprnpL rfDpdyRCTYn1xRB8Y8wLTBddY8uBuEi1xegd2xqpDIO1pLdGfGbTbEMJKXKNFffViV3J wYUUd2GhAUYSswxpxhq5MJwqj105nwRl4G+0yC5L/1TE8V4BqouI4GkWXSlvqoVRDLRA sAitq+tKIMXqJ4F/49a3Z/BYl+XMGUh3hjIK38gXXk8nj2vduO8LvuAVtJjAJs2zeLK8 LkG8bN043boQQODfn1L4W0aIRVPhDlVCwkvY7LO8y1Nwcu47gv26UU11MX3Berypn6/7 n9Pw== X-Forwarded-Encrypted: i=1; AJvYcCUzwa/rXF2KS1IWNSjJ95l9xhmBpPumoXj4lHNKm3WdwQPNMvqdlU6ORCrUXe6AAiLVVYQ7hJ5YKfRrLwU=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6ZjGuqvghJAeNrhPL7Y2cS4qCh0ySpENvA5FbnET6BaqYitsN O/6dHTqa/cr76CU+5mEvPcinPotkOrjHezxM275Gr98Bo5nzdMUhuChCLgWD20EgDDE= X-Gm-Gg: ASbGncuFajooKc9gEyXbbZxxr+v+5zxGI3pbyRibe6O0KiRTRGXyUuh6zW187uFfk6p F5fJX7b/HHKtp8N4bemQGMRE8DLY+IZmAEN+sRiSk0OcI9pHhfWsvPCSiNCoLaZ4hyEn3Qo1nRr QkP1mtKAVVL0paVwPRbHAN4unEa2DEARoSs322q6ZEnb97YekNJYZVQBhEJ83d11DZLPGXQ/Vum x5jkDO1ZadcQNqYG2ZlIO+SDhdLXHMKLoi+2nJ8DfJtuF5WEcjOOy2K23U8pQOAjhXrWPWg5fVF l3JFvNQmdlSDJOxX59jAwMXoslWU9ivW08mfKb9OWAYHkqmHI85u4QkOVPhClWFD7lvX3827JXV jM5lgTdDSmoBfX+PKaSTmwaxMLMyF X-Google-Smtp-Source: AGHT+IGxgL+toNcQZblo3toDDSWKpb6dbnh0R937eyOGP2RNV3U+4rRZ/V56bRaM+9Yqm9EW7dA7Gw== X-Received: by 2002:a05:6000:178d:b0:3b8:d360:336f with SMTP id ffacd0b85a97d-3cc22e34cb4mr6129720f8f.28.1756396819645; Thu, 28 Aug 2025 09:00:19 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:19 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:09 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-1-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0M6t7kDqohITUHpArt8wxM4j/l0nGheDDz/ lBgFuEny5+JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DAAKCRARpy6gFHHX crcbD/96BbYP4iAKgagx1b/SaoRaFXAC/EdEogLQkCvckdWVvEIEZ8Tcr1z720z6HyB9Ba31VkK eV5egMTpHafq/h0riC+6rAxWG3Yb1N/W+bFOh4kMVYLEP4i6IAEsBd9d9XUucbCaHWNolzNAw82 KKUmo7USlAk0HC27fCTmsZZnqVRo1e8oWsvdTBS1A1+6PVPpCUSvm8ucDBKt8GmuW/iEtFk+zVu b+E6wZwWpt/ugBke2tciQKiYcaYz+BmGjgcg/giMss8x6aCa9LvzL/lM+jf0Hyci1OQ/2DEGscb XmSsXN1ycObeXq3vKKy+Ea9IqGk80HW/jaOM38tf8YRVVWwPk34YZuNAqtJb46r7OOTSfPm14/6 2cW7KPby1U2qNtkIA6h33Dpoe+sVrnKNdSv3GL5K+/UYB9FJRAjQ5KwjtDLN4mgzhSMN0Tlg/mR 7gu+PUHHkiTRA32ftkWqtc99guGN5R3eXkDZesJ6GxqMxW9BzbtLDo/EYtmtBSUyF2GwKSoNY4N ncnsxtMEjMPpqpcblxpETio3cmc/R16fhYa6nyINj58teXPUV+yzA3zyK4zNHhFsQJD5m+I1Yv8 kObDI+zPGcSSuBJ8TtNtSrQsJjKKYZ68meo80Zv7c2jEmrvZbjqJqin3Iuc+Bew/4ZuXumx0Oak S/KoHAtfm3cEDcQ== 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 Acked-by: Greg Kroah-Hartman Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 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 541A8216E32 for ; Thu, 28 Aug 2025 16:00:23 +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=1756396826; cv=none; b=cyz6C5w4PqvUTUyQwwZRA9IcUEgs+ujLoSqGgexFVafMnristemB7st/SpxoNXmJk/33/vCFBJl49Qxoqk1uqjY6UKlz4DDfGDpY6HB39mqr7hJXHI2DSIl08tzx6kpwau4pgns5b5qk7TVrwfwaDwjK/N6DyhcxOGwqdb72v74= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396826; c=relaxed/simple; bh=WIEQvxtdRthB6856r4HUV03c0VDMli/mjsj8od8S8wU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZyeX6uglEWMKliBoVXK44mn3FmzWoB345YW9ixOZ47vmoTFpFFU/iypqyNTm6oydBCFacauPIuRy0vFWPtIZfwT/77rZd6IiJsrNdKwOxdXu4JrwWcX3SygXwC6ASRAVGkXrDmjXG4B0iWX8cITbgORtEjSlHRc6PBCsFlRWs6A= 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=Ydk+fPC5; 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="Ydk+fPC5" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-45b7d87b90fso3097045e9.0 for ; Thu, 28 Aug 2025 09:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396822; x=1757001622; 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=Ydk+fPC5Bl+26KqXmU3DEdhJXTwDFF9BduyXmHb/tu47K51hkuVlvd8aKnk/Ad22kh 5UnWjrrHjZwTZhgXxCLtAv7nkDUQPCBCRHqlSzWDnndkvMRC6pZjnDnraBkR2dhiDb+p ajhI6i8yxsQdPD5hvEe+XGqX6TGCyuayqiIUvSZS2TbgmYQxPweLwaHNZ0/H+MWAYypl HUsjgjdY+169rhpPuwut5GcqTSsvmm3lzkfAdeMtaHzD5K2vu1931FFame2Rb7x2zhPA zVoQ0S/TsgagplPHYXg9yiHB9ejbzJV1KjjUGAmEUAofIjVAWtjfk48LM2u/AzpwRyV5 xOmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396822; x=1757001622; 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=rX/7youTmvVm8WdlgtyPXv4dolX208J8tT48ELAUSxmMRrrHuxhe41YK6redcdOxEk ZICE4jtVo3V254sFw84I+uzF0MNqaW31J/znRA7AEaVh0bJ9owYDVcQQRzXZ49KPEAht wuv+v1msjJhUT13LZ38nn7KsHocr8x41HVP1bXo2jNCbp4HNh7c6Wh7emp3Jp1Sas1oL sl41pjTxbZK76cUq1hZqmrohlzaaeuZXio/kQAQ5UwAw4CvknCVBD2a4ovWq+jI/5RwU O12fCRd8TotRmbsH1wqus/e6bgNfGVL4JDB6/SJ9ufyNMHr1ElQVPVQknyX7Hefi2/S6 yiTg== X-Forwarded-Encrypted: i=1; AJvYcCUIRMxaFNboOnZMSj7Oz/7oa1tg0gyXR+hHlD7nHJhI9UNtHslUAVY0a5bHqGWt57T0juz53kdTPZ3oEH8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxf0pj3SEvw8wFQ3HKtZdCCNXOlRVpzeMH4WXJmOwiKigS2vHO6 YSSPY4mkA7mAqZkjR4xg2xPnZCvTIyMK1lMu98JozhB1Q8RzYrStRSHEcp5YSZ+vZV4= X-Gm-Gg: ASbGncvlS4S7FsBAhPgZQnxnicKe0v4T84UJCAt0opplVTmnXfY4zEa/5uBRN4CMA3m k93jVkXk9ZaxuoRNnHIHIJ2cyKMSvylb5VRo6WxpmgmD6Lu7SWGjwvejwbPoDbxi9n2QIIvvF55 cLyGpbOHFloWFi7yVmceWa5OWVMrhJaH6Wxu0KH0RLAfU9RuEPws24Wjf/IFbqobwX+O2sotKLn 6Ysk+pFcvwl4rOzRHdbrBgpyGv+qPJFLARDrJXRU88uiccPHEklBhLxLeNdF3yVnNT4ryDbJyQS ZGEmcOeHwSQEyqtjNeTfQU2Ppsgh85Ep7cqToYWxs8+heWP7ew9ZJRRRmR4hxB9PxT3b/nAUmnl uv2bqZwhFIA/7KZfHzA== X-Google-Smtp-Source: AGHT+IEEUPRPX0qtnpnUdpRPcym4sDI7d+C9JSDMifnYxhzBDzH4zw2E/VX9R94WuI/zU63SZA4k+Q== X-Received: by 2002:a05:600c:a315:b0:458:b4a9:b024 with SMTP id 5b1f17b1804b1-45b6870e72emr69147895e9.11.1756396821499; Thu, 28 Aug 2025 09:00:21 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:21 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:10 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-2-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0NSAuiaNKCszwfqmTlAGx4ApsdMbxmLPawo UWl+2+lOcuJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DQAKCRARpy6gFHHX cmppD/9QVDsKLZ5cJkcwxRoOidED6l4/SCMEMSp8Lz79t2BiBAthAsaNoZNilSYxuuaxILx/fTM yR5RFfD5iHwpJL+XJyqOMrilhdWzrSn6jR/ZAyGEi2Mf+5E6mJ5EmmBGq/GX+HqxrzFyb/8aIXi 3DJmYcsL7aPNY8wHUcbVX6Q5RjExlCttzH3Eecy3Yfg842/UHFfRGOqDZ+UEluH1z5cCPfon4d4 dU5xUL0WJrCIt+89wjQpcqpsWGzV/YaIZ0gDc7R4W7ITIArNF2FL67I5ouMxu+UMd8g+P3+p6Lp MV+xGzbc8rI/kOofT+7sZADnunYHZExzvxE01EQLJ1bLtQh8zdLDiGqCLhtAvr1Ddj1olfbytcZ lVeZ4bVQX/NTpopnWZX+5mJB3ebcajVkfiaq42SOhF+yIEYur+VwvAUAPsTz2qE88WNtg5Rq9nv hJfdcqstYL3cQ4xe4dlr7IL3X73c3dRNYprnGJIT6quDhcS+ZrXWAm+IdXuBYP7UHONSJMRYmlF drYKCzhFEMcKY9nrHR26cdnwikB0Tad1Lbj3snUDWTpVlVUTPvWgDk9Wo2fCj36gzkCZ42ChQmj 5nNCRqx91t8O4tyZUxF8U/EjKiHh+zObQu+2SQAtIRZ3x+nYD+8hX2B0NSmX3XZO8dSffzmfyvM xSccc+sRT2SAjXw== 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 Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 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 2F1552586C5 for ; Thu, 28 Aug 2025 16:00:24 +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=1756396828; cv=none; b=I2M0Sho+a2ZfNeTGAG74rIRdsMSvzLKnEwLUDPGQGfQk0pjkM4iaF5P9PXFlTf68y4ln+S8haTJ8LuViioJTeTpf5qImOg3KgeYEFYOiz1xb4gUnLBTFhxLH82YZSMo+T7rtyxn9jTulILcuA3uc9hqlyn90Y+Od0OfEaW46NeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396828; c=relaxed/simple; bh=eVcvBqQdVPNTqpfIQ1uOcWvSP+NDojr9eRpy6to1igk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B1npE0mz8C1nQvmOdmpQFGqlGYajZMnPfKTx5ucFNgq6CV/omQS8zeWfiKetWgaQDHbyr9qmcwgs/TqdeYsOgP4VgOTNJDBsBT+7LIhIRw3fU9GC42OlMJH6cExoUDJPqa3x5nuWuatckPnQKYqcTuP0BZH6LYwPfhzAkI6Qdco= 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=ou8cg0pX; 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="ou8cg0pX" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-45a1b0c82eeso9494905e9.3 for ; Thu, 28 Aug 2025 09:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396823; x=1757001623; 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=ou8cg0pXW17tnWdruFEhJ8VjTb+vYHSTynJdvw5zx/uw9y8chRtFtZDATLILjDadDj fC9Rt2R++nuHAnu5sUZE0BApuf0ke9cIWE83pvTFbGz3tXfAzlA7o14B42uwp8spzfAK 7egySCB+PwqQExqFlif/gKGNoaKsX4yFqv8u3/OK7Ghpth0k46aM1q0sUyI4aIp84QwA rW/tgmiws3yZgtE3Ky5X/gUGFNnuikKjpoS7XEkmEaWfdVuR5CenRmTu/csq/16Wbjay 4kINrumqruZsdx/WFkbQvH2lQyEZf3Fy+xgQ9rVLlq1x2ZV5l1Lt6VkdVorRVcm5L1/O u+gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396823; x=1757001623; 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=QKqDuWiw4m0YyK0Zty+wyZQS8VMRkbcNZBwj8DUKFALabMsa+M42L6RymrxCqGr9Rb MKuLbSGCPxLNN0EtJTwIe3tJyWiwNtzCHBciAJDJZSIAGziKJhXDgKwUxjvC5lMjuuvf bjht4F2iDDmKkK4xpkfYm/yOi2cAvxHA6osSPuZz+IRMH4NI1UqMhvePmAoWT02A90CJ suDt80LlP8NOXIOjypKjCt89Fy0XyIsfb/N2gxbmtJ6Teh41b8jPWr9HkjILbFCEZnDv 74CM/avEH7t4pdwY7A29w/x/0cZMC7lO/lVIyxoP8/5ObhwgOTY9PyFOgBoIhrRh+K6s mRVQ== X-Forwarded-Encrypted: i=1; AJvYcCVWDmp32IOTHHPnEeYgx4bgSCNrvmxZk30JugOh/fXbMX0tDmmvg1wJM0nJh+OL78jyTgCoJttfvDcrqKs=@vger.kernel.org X-Gm-Message-State: AOJu0YzU1/MdQKOxAXEyQoqOyBIOeJ7Wtff+bAmChZt7/q+nljGg/qww Y9iX2oZG0kyDH+M/BsUMowUdDO/lpZ4I9Kbvzk7cKmjTSPWFyGi+v5PkTAwVaDNl3So= X-Gm-Gg: ASbGncuVJTstHZ96ndnnEz+k6xSZwwWEFp7GcNecvApp5x94VatBy0erHA6mAb9hRhk M24su0x533aG0FqpEFsFlABdlQrIq3JtGrg5sueF00HbwKtLefE3I0VXW1RNHf7icpSPH3BmboI VG87RawmC1ZwV4ayEKqzNFRYD9adDsBWLaOl5xhwHJfNVoeX+vin4XYkLJWxf2+7FlJyQ16h7x0 FKFSjG7FP8mqufQbIPiMbbzU30rAxw70DVG0tJ5+cd+P91oWVQIcPEiRhXZSyr1Hp5Pgy344Fpg HwqzjMeUXc83LJ0YtIc82AyyWuBvmjzU1nNFhk0IGHthG0W6qvKx0S8alRKqSJqkcQ5xf5nToBp Eixrje5IwGLA6Ck93Tw== X-Google-Smtp-Source: AGHT+IER87jaQoeShvQsyVmSj0aSvRTPhiF3pGP4th0wCUHmIaEcNjSjK3S9hh6ajKAZPWgkTqzJEw== X-Received: by 2002:a05:600c:3baa:b0:45b:7699:fe6d with SMTP id 5b1f17b1804b1-45b7699ff37mr39397625e9.17.1756396823201; Thu, 28 Aug 2025 09:00:23 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:22 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:11 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-3-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0NV9d/sWbKuAEo7ou0UURrmodfCJaO+QJj+ 5MPwqZx43yJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DQAKCRARpy6gFHHX ctzoEADbwEMqx2TH4E23rUTlqfPLcS3fHDWD+epEgWLvTddWUX8zN0lfF4FdFwiys7ELKxR/XwG QQO9szL6/l5nLBeTUoJNYd+5mk/+O8TNscJuBmxuWHrkFdS502g9bhW1ECKt6zIdhveGlnOpm6G uWluWMTXPYbpEuB7ezYm2R757utNZGn9oMoJOpgFXPoJpfivFPV/oumKI4k9Iy7QThSAon5HZt2 k0tpgOUW/dRXd3NjVgKI2HKa5db6VTmGO8HljSZgVCiftk7ncKE2Mm9a9iq2oYrDJ1Z2Ht+o+IW Rd4fsCsXHoTWenwwIarjTfN8fSBhFWsfQzLZ9eGffhMOkn4HvMkKuthX9hXJN9441LES8oK0K5K yeDSnZWt+aqfrHK1oiGHZn3GJaKmOFDdvceLg/lUpV8R2Dc4DUY4yA2lX8NRgTXEawWajpJWElG +V2pCZfQmQvH/AixL165s4kQj9MSQUgT7j4g+0QiP9H27ht7qfkRBvNOcSb7LEA+D69MtA9t5wQ wQCWYtmFXFIyEttClIKmrjfl0UkXbMWiXX0OdeYgNoIkDG2wJb4jxQFXh9Ck7T9zC7KQrWhrnNX IXfuwfBD4wDRjDnT6qJc2SAi7vZcnjaZE1OR00slPWK0bn9dRYLmlRGy3EYl/+YjsktwDYpm1wB 0XpX32OnfZ6PasQ== 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 Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 2025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.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 F275525A2CF for ; Thu, 28 Aug 2025 16:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396829; cv=none; b=RpBYcQu4ODZ29uQaJhyOecjuRq3xSAW66JFa1ez2334mSI6FVVlmeOpT87wVQR08MElf5HgDoLMqp9+xfXOxIz04n0ZY+UQbPRdZre9LLDsk3L6r2OOLJx0WCXkcU4Q61tQtIvm0hzgoaBM195irGtCiGesvTzNDvPU1JS7KNMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396829; c=relaxed/simple; bh=AqBljAHcu9SEs+fMf1cVNWEroJaNcsABmNRiWlNYjLc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qdBD+jbz5JwIgPQkf/7vnwLYOjG3pdOJOEzjrQbOmfRGuSLnqQ2xDNEvLMs1rFUVl2+ruJS1ofJrLZpuh/vsUcLBcTeDTITzNdmrN4W6t78eWiYcJ7+OjCK0ccSE7kqHlbMk+B/Wv9vy8ir2Ew3q5UKIbAP1Yu1AYVqSrBlSrco= 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=yyraMMIf; arc=none smtp.client-ip=209.85.128.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="yyraMMIf" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-45b4d8921f2so9987325e9.2 for ; Thu, 28 Aug 2025 09:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396825; x=1757001625; 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=yyraMMIfnKzbWxtVCj9/B7KvdiaurbXNLMCGgEcazajDmu+wyLmUoJn4aITCcfcVef xQFV/Czj9rJh+/VlsRC91UFtlkmzEGQAVGW3TOfoNOfJSngcsRTkxsnC1s32mu/8+YQE UXEU/FBy5/7aD2aHzcfAPPAc9DkxSGtLO5D7E7SQzQKgHHwTHfraU87oO1YpLkwsFua/ HDzEvK2EyrQaPvaCNPZHX69V66C9UOM7Njyn+ic40Gvdh5AGMQAFFn6fmiwXg+gtj4TH 0oo2SM6CwaFtWayPdLVM9ktYHafbTZtZleCH3uJEtbV4BxG0VDuk9z5NrvR3Dlberkri s+Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396825; x=1757001625; 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=Um/xdfCBvNDfAe5TbJvTQG3ymhp5WBeXldkn3ke0oE6/oGj1Q++p56AoO65PKMb4J5 uOSBX8UJYHQdQA12ktKzjWHOiyCyqCJDNl/ePatU7FeEIBM3TTmOGs/DPsx2xd3c2vq4 v4z/gTL9FVMrPwxHR7NC+qCA+is+QPIkXG81zhJsrvglA1UKORZq7x6cBT/sMbhZAlme DkbQ57ljbgKw4K8LB21jNueTahBF/M1tK/M23Ye74yRZ7JkZYeLjMOFNmGXzKAwzV9wf CgrOpjNjCFeYP6SqjOv0rGZ3xITfBz10dEPVvnkFMSa8Lif7zsOwwkIK/kHpsK6txkNK Txeg== X-Forwarded-Encrypted: i=1; AJvYcCVegroHcI9o93xEt3yGBfOTmgdpBmxuMJIGt1oxbnCL1w6b1AnqOK1FCb3KOWvqx2vXNU7ww5zW76BpKJ0=@vger.kernel.org X-Gm-Message-State: AOJu0YxIs1t6VU099r5y1w6b7Z8Ja/es8FitFVimETqo1wFQq3LbVMrp F8qROSPzLSXNXlhd8pSyGeYKSoRCUA7H2l5KFq9k1lboZiY0iIwrQaFNImgCj4/sOMI= X-Gm-Gg: ASbGnctHX2BlCF67tscvoX0EAStRQq0Fyd0LUasW5ttuDh/jwEk49fEd+rHpQN7gCib +IHo4lMHNWHrBSNlz8Fk0IFZUy4op7hv9I53X24GA0sN++EoAP3Yk+fvrFS4iBlsfJY2Cem2QmN lobGEWBCjXPR99V4svRByyl6yugy38nE79vREGsReFIGy2kwx2GoLzgQbJ7BI0U7rHn8JSmVKsd /zOwUHgjRyj3s6hQ4G/bKBT7SaBZR7w9bTvYfmiOQ1mCseual+fMfK53pqjxmjTcImeuG4+go4q fupx1o63gsSVIyY1rwfhe+eELXq4F2WLMaKsetedg+zt5S5sMpyay14itWrXV0jMptOauMKquAB q/EZJhaPRIblPf/OBIekM1XIYikmy X-Google-Smtp-Source: AGHT+IGRMyHayDmkLGW7+TAO1iROYIwKh5FOICjdfcZ0105VGTYnJRy0SkhUfojn9IN8Mk3CuNpnVQ== X-Received: by 2002:a05:600c:35c4:b0:45b:7bba:c7b1 with SMTP id 5b1f17b1804b1-45b7bbacbc1mr17635415e9.32.1756396824905; Thu, 28 Aug 2025 09:00:24 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:24 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:12 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-4-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0Nb2Lfmw6OgPTm+UKi/evxFaUCjOaMgc4KJ G/Jl7qtg3uJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DQAKCRARpy6gFHHX cmd1D/9O9r1DDeMjfZpJc7L4WQYFg4NpL4bsKIEQD/4HTfJtY0F0AbCzTUVX8wvtO6G7Oz7Ckl1 JGsGL2ePPaPSOhC4u0K4c6e8AGfOLuS65Aup1ZPjk9dByafrLUoaeoI1SM2rk0Ff93R5dCbWAhV O+zwBzL4wpnwF6q8j7vEmnrERbfUK4DJyPUYU8dEMlQpCvM2xq3vX+6M9aRECpcDSDIgjXsJaiC 3SEQGGSpuSWLH4vgWbPAhYTv2uA//5mK/J93r57YZIjbfUe7EN+xvbqFhkUX8sFPTTQ1K5nSV3I 1xJamJF6MUu1lz6b7z/ZIRwkLcp9NWTEKBcIA5UbweTZFziTMjOdWQ+wncqGqm/jw3vitwXbUp/ DaSwfS6lcv7zefvLHYddAx3HLAixXjkS/XVFAC9VZW2ZtNpqJXBMl8S9+hfVpwXFc3OlVI+764g v9EF9SWddtxMvleCD6Cw2vOD0URS5JtaEfX8/draXvRAklHRp8xnNS6tXVnx/pQWNt/SKMcxHfi EuioUyf3YE+ywH7kBFazoYHGSt5+i0XaiWxZPkvXjk1A/9V/nJyroGXDVvC6IJKNSYJSkbmxsm5 6AQHNTKZD1aoqjMJa0hcJdLtcBCZCHyZup13Wvn6cJC7D3MAy+LWRbAi9MJMBS4G00bSg2oJCqw 6ccAd8cQ8L3Zydg== 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 Reviewed-by: Andy Shevchenko Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 2025 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.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 DAA05258EC3 for ; Thu, 28 Aug 2025 16:00:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396831; cv=none; b=iJN77NNH/l0E46OrxawQR3uKRSonWNbys+L+hXP9X+aoTHi8J+mARHg8DB9z7lYmE1Z2bYoBpVEnt2+tAaAMJstseO7BTN5/OyQuxtJiDT0lcP+MQdesp9UVOMsU2htv86fm5WmvhAfoNyO8ckatWaanNAHIxtuPv1pd91eKQ4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396831; c=relaxed/simple; bh=CSmJ0hfP8RAK5IyMLaW7Q3B8iAjyvA/90HhyhsBSBCA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ixzpTpfiOIqGTn24xxV79xGcB8qiuZYWYIdJidvVNyqwlVsME0K3vN4wMm0/hrGutKqDwo8eJDnxwzazeo+nofpFN5Okft8BEn4w2WD8e5g4g8AtThHLO3H1z1eHCyqgT3eIcHT54/p41Fo5RHCH7Ekoo/PbOBCKqNiTCmJp7os= 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=qcfbxmAS; arc=none smtp.client-ip=209.85.221.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="qcfbxmAS" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3cdfb1ff7aeso556238f8f.2 for ; Thu, 28 Aug 2025 09:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396827; x=1757001627; 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=qcfbxmASvKGh9PXmssrOfMeEKqnxGWK8m9oBEKLOvn0k/WkPj+oB96UFI442YmgA9o bLMzyn90q/kK/it9+t6ehNe6HfANBdrKoykG8Mk0Z4sYhDXf605i5000kTJwVLPTfyHu ROyn7yVMO2JKRxQS4/8KnMWLB7Db9I6F2ZhHINLurPcIzyAL49Z4q3jstWMeSlaiF6dx yvHo0eyDDzzv60hDorVRm3MzMpj0PyrkglbB/IFzfFM0YcmuxZPh5Ib/0w3dVITBISk/ v8vwEJDBh68mF/l0jIAKyS1cJu5W2avJwRS+1uZttVT3xwoRV+fNvF0VUgdaNoAjlH4B pLiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396827; x=1757001627; 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=PgAHw1Wikn1Sjf2sw8to//PNwR0MvnMGK3VKPhco11YSPvW7oOBlaRDPyTtBArCMer 59Lly0dXosjNTrSJnvkm3xiFzzajqyKfYJZ7o/Yfd5nPYIvGHv9EA9D7seopfezm1XSo 1aclIaovmEpO7boKAqZf4ELrn0DfHh6uSBJ7WMl82iJZGpYRgBpmtzmx/1EEgHB5qkR/ k4YvxXiWC/CKg74UFaOInOKQcvnL8oqKnWBnNWMnLlHZi5V8QD8ffcJtEPi3LiYqx3tz jF6jTfKyEQNdKI7wwnXGzsSBGaLYpKKR5s56LXmdIi/HdfEK7o2fHdRRiAOsMgt5tfKE XFGA== X-Forwarded-Encrypted: i=1; AJvYcCWEDGsPE6PYpoJJwDgP21UDcP7avpD2o/YSgMhIqgr87a08/sWjxdl6wCthlLI8kjPtRFU+4w4SZ4B0Luc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx16PMhSj77AqUTO0P/VxKjGeVNRkCoEc8sXjYmgOlkd13P6tW/ A6iGgD6833wkIO/a6f82zlJ1dpV3DvFN3IGkvM1bEAgRpVne3U5VXYn799MqW8HyvwE= X-Gm-Gg: ASbGncvx3JpWD3gzH1OmA8/PJc6xmyHu9Dj2BbAXSO3a1WjkPdEomzAHgTg1YdotrmP LjVSINoD5xgGvaczG6t/hF6oGKcGUxNk3keEE/2vgWv6TpzA8fzgiPQAXnO11msmhxjiqQR8obL Sij+ruCG4PKtUCdAU9+ErpaNtu9oV9cGQ9QE8QdgJV5mSQe2iTggTDac8Q7X/CVZU4GaNCPO+LD qsWK4/yZwv5HZlCGFXc+4qEHjPIwfu3ym15oJYrD6U2e4sghBYDTGFrLEdqojnsgj5E4ZPVQAR4 0b7AwCd6xsLdDJh2g+zXdPYcvP3H7UXESBPc6ygTNd8M9/g/E2bBb5gt8QZeJyRiKbwHEIBu+zM IO40aEeWClEiMa++xUYRk6jrs0q7b X-Google-Smtp-Source: AGHT+IFw6qjlDrmse6RIf8UYoO4kDt63oBcAlQpSlQsPEor2cX/h2xD8mZ55YTiA8r3CiuSEB2FkQQ== X-Received: by 2002:a05:6000:18a8:b0:3c8:e9d3:c392 with SMTP id ffacd0b85a97d-3c8e9d3cfefmr13313662f8f.19.1756396826703; Thu, 28 Aug 2025 09:00:26 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:26 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:13 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-5-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0NGnR/oaN0Wnl61ZnHBstpsOmWiljwo2l0c m+BpaVFx3GJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DQAKCRARpy6gFHHX ctZDD/9arpiDD6mR+QK7mS35XxuNAxcWS+ucQzkDk60d4EWb3psp4VvaVeZ1/IUU630zQgfjTV+ t8aXJb1zZTpyRic7GCOOuf1+bIBvDH8W7iOX/fgOfp6ekoa4e2r9SG1TAKkLlNtWiRSD7kTvPll hqZ/DVYo6WsZSaEJWD7S1YQX8spONqMCw27NzpYs0/GCrRRu3wKcemsEEtsZTfGnqOs5PyLOhOr mJzF7oEgPL8Z+Tjz0VbSghib7drK1N2+Nv6vXAxMf2B/Y6yfQHldQrgh+Ck7L/ILDzHNwh0qR4n LmfSVoUXKYOkpqH37fE2kXKTqGkaD8XksLO6dLEyMLpwhAEc4dmcAJ5XqVN8eUjuruuAmn4a98Q 1w+kacPImscDwDmEDXZmZIOLzC3JctbrU6im1b83JR4sW2+is22ir/s/gD4Z91esiFPnvy7kKdH SaDnpou2t0/PngZP5d9dZntxi/1FvyJj0OlX2yDxfS5QzrkewdS8kGOkStkdNt27UVqWnNb2yCM ZlBarFULOF621HTFSzpty70XsCw7I9ez21QupBpDOUmv2KDTcbcm8iijkGyxtFqeHpy+HJv9XD4 do4x5A6LTUDY+JBK10h9X3tLsDc69G6w4vnGcuSQ2XD8mNJHPeK+YpFObvarI8Rht67YImonRX3 sKIK4iijqJ/NJaw== 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 Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 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 BC6BB202987 for ; Thu, 28 Aug 2025 16:00:30 +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=1756396833; cv=none; b=Y6VFGabcXKM5cWxxOtUmqyie26drbDr4aZ6cHXgWLKjtWpM/dtl9+SEWUQTE8UTc3KTHQ4lsDoG5uucRTrxl8z7nfSXaP1BLUMjbepkc/vg4DMJlsW6H6Qmps3H1s9WG4DSIaywA2J8ebo0z+IEdxm4pGMDZTYRbEk/hD2lzxUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396833; c=relaxed/simple; bh=LOBwL8GyhXn2amKnj3tiisTz16R5MdNDH9LPyd5t80k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aLHbam+R8KM5SuRczgj45adiZv6WcP7cMNRnVt+LlctDUQgE9s2N7QtmCRi7LraIigGnSZVqshU49v3tjjd1uV1sfZngnU/73vQROB2SsmsT2yhwb5JG/ab1g5pW/B9cTHC5SaGT6HrzO8icOy+XtzetD6TUUZq1oSImwlchhyY= 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=bAkBz729; 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="bAkBz729" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3ceb9c3d98cso257327f8f.0 for ; Thu, 28 Aug 2025 09:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396829; x=1757001629; 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=jR/UQSU1rnoJqXet1GHMjYE6RZmBJb0DIB3rVaGeplw=; b=bAkBz729KqGA1mppmHfjaWmWEV1buUOH7bOsnuvy/egGQC7RX3nyLOPpzNiIP09UHw KqFhISKOclNCLiJYIqrBKmDGC7xyuadAxgGltVZwOhBds9gJ/r9CfgFr9xJQQPY4PiWF IFv+I6vgU1ut7uK3/o3m1Yq9URIf6TkBhHVovIcfdSLy4BEZQhDyDpJVbWZMFnTa4NlB fmsrW6Yqr82wmGvsmcpJSI6o/LaGd5ZyvZ4wwHmLAif9DXXVmGBGDpt3A/K/5/mq548B dU3LFcaky/sPKSnVOEEM7Vg6JjaxgzlAWoaoKN4qqpN9UzB35EiHj/+RPHCwKULY3yb4 IlJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396829; x=1757001629; 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=jR/UQSU1rnoJqXet1GHMjYE6RZmBJb0DIB3rVaGeplw=; b=qkn4ndiaT298PRjUcEFJTpEWDS4TlIlEBkqauq0H/cN37DAZ4Z6Dw/dQVAGd/K5yZi ekZlL4Jh6fajtsrmEhD9TVWd7v2NWhJb6j37c12UXQu8ljM5OLhjDM56dniNTrl2ii3S G4AscjAr63dXUeQ+ebfEaMNKYC8/suiiNcOo8QLRUgFFKZ9CcQQ553HjLcVyedv0n+cl /pNcZT7jKIuk1iGaJjc5Ff+utRQiODAmSX0GKKAyPDVZe2XRgROGipQjBh+dWNngPHcF K36bvvyynf5oZut5OG53tpJcQOh2TbqczRfkCeHljXjJt8x48Efc5GgfofwaMyj2iaHL aTXA== X-Forwarded-Encrypted: i=1; AJvYcCVrOv8LAtwXm0eo+ZT8mPGqVkmnwyaxo2iKqkuG+0hSX94Zpk91So3SdeYZ3sqLNG+6PaJ1VnmZRoJxGbM=@vger.kernel.org X-Gm-Message-State: AOJu0YxHV4HJzEuLiXwEc0XeblO9ovR9e7mvJuCRpvz3fGZes3Pp70dP 2ZjCx9d+FoIPm2z9mjMA3omhvt1o+S51xFKLVJQiZCKbuftbU9wMaMs/q9drfqq93AE= X-Gm-Gg: ASbGncsTgEMmTpt4bXjYOgV2tmqV0N2EU7mQbB/sYX3fI1xCFZ8kuOmZUBcEcdciABQ px+bzoqzAe1lHx/hRqF0NeiAW+yQSVAnHs0sSEBIZmDQIA4POqanjgcTi59QwE8NferccF7iFI1 eMtfgo7LZ00JiidWwlNvPSbdrltK1XniQ1XRT8t320mZfyp54Xo56WV8GxVR9N7rqgIUERUYGnB G43ydx9zvTSceOXGpRKZmaltWGBfqy11QF+P4e09IbPQF+uI9wEWccxoZQk1T/ngEpGZBbfKVW3 ZMkFBGTyhBYetIJuEcNHyIVNCR3Ymy4x26uejGAnBsZz6NRMuQd+RRDo366z9gKfuRvY3o13Zqx FJAp7pFrGQLMBoYxnKA== X-Google-Smtp-Source: AGHT+IHpa7seq9vvwG4pSrNyoWglcHVRKIa3k9MGizj9olBncMjomjsG4dZCZ0gf35TjhrILqQH5rw== X-Received: by 2002:a05:6000:4029:b0:3c3:806c:b82f with SMTP id ffacd0b85a97d-3c5dd0ecf8amr20776060f8f.58.1756396828557; Thu, 28 Aug 2025 09:00:28 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:28 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:14 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-6-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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=3140; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=64CEOM/GWFRZVaWr+uKwrz1KsAW3NNZpIdWvwWCf200=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBosH0NaAPsNFFrpH1CGMcLygHSJdcPneCN6Unyj uWMtG9dPUOJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DQAKCRARpy6gFHHX csz2D/9MgJP+ectOeSj5tPh3IRoQSIVu4AU0U2BIk9qLJsstYn5YRISv7Lr58AGRakRZh0m8/iL nNYJSQ98/gglKMupuS/yKusX9iGKVWnw8cqQtR2qBPGmRcImx2/9e7HLfz7CCVT/iDAjPPeMjUg YyeBqbeDoAKR72CednspSFx12VxQ7Ja4n65O2y2fjtejtwiGFuNvud6b8+pa/eKxHeIkigHEh5/ T71+1u33HaK5IxJVGK5qUbh7pJm+lSgmHzuPOJN9R8CcQO6lPBSWP9VXM63VfHNUfkyoPokJSyz Sxf/B6Qkyzd49YG3csk8gtZiCCKGeJeBgbEt5oY7bbuS4sOICYGYc42MEa1akallSWRvGv6LRxt VSBbX2tu/t5fI8EdOgROdf0H+VFhKPpz5Nytk6raLEJDU0dwyqO+Gnj8gGhHxOb8i3xBVJAN3+e oE6PlAYq1yoX/GSVH5H4ADkWHVGM922imRvR15JI7TpVxnLWaGZ0chIV87cWv3rtvcLtI5mW2Fr B+7CeIdbYV9gHFjqLi6dmVbK4CJXBZS8z/5DqhmeKNRvDwYkxvZBUfHoz6MdXw3oLpMfA7kO2Ar g9WkATffjdMY9P7gz7AyeDLdWVlb4LSx5uyzu3rOuNrmxYeEg//XgZ5loqLh0eTb8Oth0yRUqaa tb3/62Fap1QUnSg== 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 Tested-by: Neil Armstrong --- drivers/pinctrl/freescale/pinctrl-imx.c | 39 +++++++++++++++--------------= ---- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index 18de31328540458b7f7e8e2e539a39d61829deb9..3d626d8c9ae9ebd5f7eb7621692= 4c46b34233749 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -580,33 +580,38 @@ 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; + + ret =3D pinmux_generic_add_pinfunction(pctl, func, NULL); + if (ret < 0) + return ret; =20 i =3D 0; for_each_child_of_node_scoped(np, child) { @@ -615,6 +620,10 @@ static int imx_pinctrl_parse_functions(struct device_n= ode *np, return -ENOMEM; =20 mutex_lock(&ipctl->mutex); + /* + * FIXME: This should use pinctrl_generic_add_group() and not + * access the private radix tree directly. + */ radix_tree_insert(&pctl->pin_group_tree, ipctl->group_index++, grp); mutex_unlock(&ipctl->mutex); @@ -669,18 +678,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 Fri Oct 3 15:34:25 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.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 3D27A26A0BD for ; Thu, 28 Aug 2025 16:00:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396836; cv=none; b=HCSnL7MASeIig4bXuPmkQ7JQajSswauaYZ11VZsxn3yjeg+6TBWctrYkHuwVBMVRa/f36kodyZ2vBSXFBlijSCUZEqyMDjXVuJ8VygoB+jv7oXvkc/qGY9RTDCCfqTaBxzHTrbaHp4rfJTF5Q0vqyjLwSM6y6Rx662a0TtLMTg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396836; c=relaxed/simple; bh=8LckYYbv7wEiVDCoVOTbwt+nYJz1zV0AkW539eEIzwQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hKJL9eFMxptTp44l/JAEZATMx+dfs5GpIogNx8+hbt3pnNQtuaXMBgMWPPLwMQ5L+xj5p5m2rcg3FCQCllyca8O2MoL6Xe36hSaDpOUVY8r8TR6ttFfJ0uKqhmXJRbtyKCv/s9TU2GimAsjvwb7smVq8+6Opb7hF5iNpPAfR2Xc= 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=bPNneU8D; arc=none smtp.client-ip=209.85.128.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="bPNneU8D" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-45a1b05fe23so7081315e9.1 for ; Thu, 28 Aug 2025 09:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396830; x=1757001630; 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=bPNneU8DkNbGvwvoIhfgnA/1yDK1Cel/S894RSctbOUuwiG8xyhY4m3RP/vyqrjE8X SKMUeXWusEzYtdoqKbD0FG6c+6yjribeMAgr1Rutg9X8zp9Wqrh5W8HKSdDfUWNM+NFK gWIxAH8RB6EA3kGaQxJbPupAVUHCkd+I0GBcSXuAWeMGq4GUwLJB5Yyu4SzPiDtr5Q8U HWNmoT00KKW8RIW4+CRw6mS3kJKM5lfcRFWahZwr/Jvx0BgHGfEmRSIMwLYIFaQKEhVP z7O0qcl/MZ2nEFHr9eMD75fyJHlrUl6iy3vfzhvWN5kUE3Fuzm4LvtLYQhx51TSz38OY r9dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396831; x=1757001631; 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=eWSnEcy8wBDLwe69hCsgoPmJnyE26d+o/TLI1ZxVf4c4M1IUcaRfCM/srD0vktcD4Q ieTirASdSXjS5lcxpazP+feNRznMqNk1IaiKfE7p4whDBozq1isUjRJ92h7zwmhloX9j utJaNY1tpBMla8a8wcSjrCqAteBQJ1VV3CHp45uXVgQimULL5vr4A45UpKzQ4XJjtHux CggnKpmWPamZlTwqive3TiZczGtT50tOT2C6EbFon5Hr8CO12EQfxpReOCf9MVIVvty3 hLNGx9yIU9+ybQcfVjbGRyuoyHcB1MuDnABfbku6V+uF23YAzsaRe+3wAcYCVFOQ5CBt WKGQ== X-Forwarded-Encrypted: i=1; AJvYcCWE1JUme7DuUoIEd1pCTpiX9tPrYo6zOuSl5efuVWQBGzNAmVXzgTgZ5FQ3SR/5tIXFjIA6vQBrRfUyruA=@vger.kernel.org X-Gm-Message-State: AOJu0YxB85KiX1SiZ4yvLML9lgWm//n0wQ83j41Kzj8qnRr0tlMRtPqh Q2DU3ZCSLDi7wVVkR+qZ+BPkHjBzlCt5Xv0g2XH+EZre2T2TLFa5IyQw+z8IwXq2RGE= X-Gm-Gg: ASbGncs/ikkw79WFNRPKXJGC6iPEBSpqRKArpG0BCmp/HrWJnxL4CyZ0XvoroAIbqX5 xeFwYzmMZ7RLD1lB3ep+TU+mlDbFCZ0DLNfIUe+LUfAlytWu+7ieToCVW0jhuUC3KwgGFTzh7hM PmRlf5zYfTR/sxMyg7Dpg4ccl5eQneggnMiyAdnoIYPq20zV2zfTSJ7T4HDxXO4biI3UQYYHoLE Syqr7QpRtv43oTOM5B76Th6BD3nTXEI1PAfc8dBuTOei0JOtpMwODaXh/fQeNVnVeSrP7tz/35P kfZa6TTgtJ0KZHHWntVJXF5u+vb7yBvKtazTYAq2DsC6cls0fvYjG1U805NqRGcdAhOv9lcGasW 49R695e8DDHiZ24viVw== X-Google-Smtp-Source: AGHT+IFFepUYI+bxIRTxDUeMnPHpoc8pmGJqVENaUjjXrMHXXy2WRVR0FTskPq39jX17KmytYEjexA== X-Received: by 2002:a05:600c:3b04:b0:439:86fb:7340 with SMTP id 5b1f17b1804b1-45b517e9d34mr225147805e9.30.1756396830367; Thu, 28 Aug 2025 09:00:30 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:29 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:15 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-7-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0OrC02A7A3w/syOmHWmFD75kiKFWOGyfOfU IkOZw9hCMKJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DgAKCRARpy6gFHHX cog4EACpRHc2z4CEO5/+sWycbTJ/Lv36XdsRhCdryTDmJugI9ckFKoQSZSCDj/EPSYTLap4IRcK v9nSbe3GHgyhCBsI4oPZRLALF/GxIpu/uT6Km1hMYNz0BKb73ON/KkKX2YjD6FDJmZxw+Vu6UVN WM9eKdip1jecx1xnrqabz4R4N+ToGOw8uBEpUBFz+GxzItCcchdLGaDiVu5sSr+vQqBIRi02YVw nMlphUxtITQbANQYECx1Nv1wP0FC3z/NrADiA7uTJmmpoQ9/oGlBIxsk3oaFapoPnuJGo3SJHgW mmck7aZcXXhlAVZIiw9AIJJh/pgBI9uk7x1EcsNXWmikxyDmqd6lCXPMdIoknKVfyRqWnkCSgQ9 TXbSuYZKBlETf4DXch3J0+3Gzk048a+TZ3AGds07+/KPC1otJhyxKQk9l33053cVyeXhjYOH12w NmL9X+K1QkmH632UgY1mZUockXDkxaq77pVHpq7LhuGkPXIO7OQ4Z9s6joU6MzhxlIPSvHywpkm eO/vZTvIhUNoYQh3fEW1qBuMVuvoh9jDfivIMlZC5aDXleNbJrQTlT9uKils+YyNyOsXfM9sejY tdyEgsTDn1lfM8sKVtJe8RRgFOBmDbxsHb04CG5Olf9wBaVFRC3YBSJ5c5ro5ldHl3e+V93Ildw o6i4ZvyV6pa1cVg== 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 Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 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 E529A263F44 for ; Thu, 28 Aug 2025 16:00:34 +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=1756396837; cv=none; b=DCFjpUSaq0tC78qI6FrB8sYG4z8NdjvW0xGCPtVs9iJ7iC4Yhpcihg9bu0HVIBrHFjxErdUxJWYFHgmKBXwiahGtk5LDxmsDjlEVnsjbNuzvYopVA0o+yrY1TkGE8TAqvcGWrUMqvhh0DN3CKzbmZtRJwiIUnAACDTfyW2roJgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396837; c=relaxed/simple; bh=HSTxkhC3WyBFM1G4jv4j8GQuTAWxbn2e8t0aXkOzg+Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j6Xprr7jXvJnytuZwHHNuZ0F08fXI+eGug08ZFy+tgpZn8uz9jEhqy0bPurVwEh8B+KN/N+X7zj2iB3Au7gqBv4J1iBlDQ6WSrTOdMoENGxeNcsTSuVaRDgMyx19YlQ1SpKoMYPVP+k3Iag86fWomqOzu5MF5LNxpn1ODQ3G0kg= 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=waYYbO/m; 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="waYYbO/m" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-45b4d89217aso7109865e9.2 for ; Thu, 28 Aug 2025 09:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396832; x=1757001632; 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=waYYbO/mcj66/4zehBg0Vr/7oSR3oU7GdWJXAsqMumiepPaoA3qtvyuqoLyTjlWoVu IpFMmbEyURvV0ld5c33VLCWwwgAw7N5S0GK3+OEL6DouxLlg9N9MHp/SiEcATqusQLDx bKgfqBbR0cN9QxgLw6eaKOnztplIr18kYM53MiB7ELuRVNI8jSWtY6QmS+Ykeb4SfgyG 6Cp2GIkxRSpJOspx74LfEX+mROxX91BTXHhW0a3sgXnLqvPtHzbiA9oMkY16QNKJl7K5 1k4EBXdXlv1BUBm9yN6M3XJi1scPuWMTp5SjcLnBYlNLUaZ3kwFLKeYAD+aXv0ejn/rE g89g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396832; x=1757001632; 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=klzWmv3q2Q0VJBQqCvMdKOqa7Wy2UnAzzEDOkwYO72bDMgCjkm6X7dneftIzhOx+ME 0AlrKFpG41PhRTmETd84O8SgIBHa5a5AxFx8ldhTmRgw9S53JybiKt+q+OxLrClSvY9y 43wxrpvJKRz2dTVwU9yny50Rye2udnxji5Or5PHvnxpLuNlvV2yzE00x0RfSL8VfM1BB 1otoZxZJksgG7bKxQ+DRtRftD0zWBCX1PTJIaeA55Men9owD2Rfa0Kykqp3RiLqC/4rn TkgW1+GqoXYik+QjjFOIK84SHLw0+qYPzmsSSBPQBZsdEqDswr46WHZ4pl07zhKFpyVo 4hPQ== X-Forwarded-Encrypted: i=1; AJvYcCVv5juGbONxGNdm7oVdZA9q1GX5LH5jft1D8LnS1OHEKlzGsv2cBcTHLSTxIla15NJF6rkqwyaW6nUcwR4=@vger.kernel.org X-Gm-Message-State: AOJu0YxM7gjV8tZlZcf2bvqupU38o7sErBC/S5QMqJo+ZHsZQUfGuXe5 nF/KoK34LAVEKrnebccxNjz7AzRM9P2kbDcWcHP3z3/+fDKDhU1ZYE36QhsUAafv1qs= X-Gm-Gg: ASbGncvOn8S3tszjksiRhlmZGX+plVGnGj18AvRPDWJiTJjHEZIkHHQRrntCzFsxkU3 u/MJwOwwlDjPcbkub+6Esq05yB6NbzY0WV5ivW/+ywyVfm1wc84Cmc1dm3wWxW3GK4tkbM6ejPI V6j5yrgqjFcgYBefmg0vdZMn95QC7PdqkkK4+QRaFXDPNZwiA2O8u1bMQOtcIxcV9xJRjBmFGrt nxYkI6yk57tOiQvIdJ36TURKNyAdHjH//CsK+/GC5aM/Oui8p3ul9c1iEhkL7HAah7Qb5H349xG tQBYxiyU6R9iHHd4iCm0ZiUAM4HogHW+vikBf+KPxf324591AVoMLshl+3lAdxw0R8rF0AKGbl7 r0YzlNw8PzBt89Gkm94L8qcBFZueyJA8ElWzySas= X-Google-Smtp-Source: AGHT+IHLEb+XALx3SQT5OlVRvtOHeQcEx93SoK5JAJJrN3hgR1oVUvTEfB3KUoR77aDoDBkXnhfeRQ== X-Received: by 2002:a05:600c:45c8:b0:45b:627a:60c7 with SMTP id 5b1f17b1804b1-45b627a62e6mr140635195e9.6.1756396832146; Thu, 28 Aug 2025 09:00:32 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:31 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:16 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-8-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0OqeB42/YsplOuPBdejGDZ/d5WKJRcg95WZ LR104xQjUaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DgAKCRARpy6gFHHX ct8cD/0ZuQK3BRMs5wFLGQuOWZuN0q36r1G7AhQcVy4P7PCRDLcyiRs/WAoNUAxuaMt/WwFIkRO hROoXg0+TORn04NnzEVYQhTRbqJnwFISsG27ucFDhABh7y5SOZAAEGAgDlmr87Wj7BXyliVSG4F pveiULJuhiooGFP3u3dmVo4/fksZ2iNxe1F6Shfa02B1qtZrPp80GW8KrPmkyWiXmvnBdpr6jft smrDNxHL4z1e1B4Q4Vm11l1dWwpD09tf229YOZsHkOJHC+PLAI54oiNWw/e3RbsyJ9xoXCKZL4b 3UAlirH9CoqoulHfkqYeck+FpiINai8UDbl757HTSOvr5y/NC1SKghf5Sqs1Ltlko+1rCexnQy6 d3sz1GFWgtO1sMkKdFszISAXPg1mPITBS0afAMVUs+Ubz8zwNQEQHc6Fr1/RryMhvKlD4Ic3qds DStKOup5b4+KcfB+dmW2pXus3SYVlmgIVpnuwfPi8aNU6bFwKc08EPXn9LYBDNrVpAl8PKyaXFs hMuv74QQ0Rb/0y/urOvaoYVoZZjlzgU5L3OYCWXSaoHyHqC1lFGH3PA3jpMY8wKOJdDOr+Ugx+d jppbIfhciMtsHe9+7bBfnwJ2MhpzRZXMsMGY8dnba+fJOj7cYEgnMUFWpcChK9su76J4X0jsLs1 +9KYwX3UDLTLIwg== 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 Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 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 024E5216E32 for ; Thu, 28 Aug 2025 16:00:36 +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=1756396841; cv=none; b=M1CAP2jabEzcTvvMk6yWwI8USghYOWoaocvFAdyKDWQaW1KAinYpcVq512xc9U5+fYnIvrAXzOIjH5Tk+riYSsHogEd0NXEC9RerGbB8ZxFTLH/HReGKphnUQn3yEX22febw1dlSdyhs24rW1HLfc0TFqwOXL5VU43DrJO+d/bM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396841; c=relaxed/simple; bh=E0FlbqWRU3VKEv3J2s5DmOubF4HrmToy416DW0zIwYw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QbhNCPtOX6FP5fi1S17mbuVqg84WMVSboznyHN8276izPcPNGW4stCcZYdp0Liuf2NVMyoOtpBoGvz6t8XGjzeDwG7spayRUcqfXqAnkaidu8lf6LrqJy0JJa2tFiOHLyQjB8ZH+DmN9YVYceha37K4LzfwxxIDxg8O+upqbuZc= 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=dixYzkVW; 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="dixYzkVW" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3c7ba0f6983so752386f8f.0 for ; Thu, 28 Aug 2025 09:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396834; x=1757001634; 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=pP5mgQ/KO2A3DwCCCQ4AUd2vgku2CtkVmWarRJcBL5s=; b=dixYzkVW6wiZ/3LNb/kH3O7lz6oW5xSFk17aHANZtEzCSBthk9VxUgqft47qMkWF+Q FKf90m8l9GUUAIbd2lDk9WtYD7oNX1Z6ye8PrVtIHkJOVcJdt0eVrfnpH6NbPSlM7Dav llIbyNPSiJlueDAiQoiPaDnaN8ZA9uAdmVKjIpb4lBZlWh3m8F6guzAszpP88u7vCPEe kBoLB6JPMMTbowAdgGWumiIjXJhRA5DOv+YwA4mZ/FrCTfhjwlgwxQGdWw0dyOkHUfL3 TkdNfgugj4gBb0A6fomHfuCY6z2jmlE+54ehMNS5jGJ9S9y//Qz/xH18aA2Qn8NNcRsU kcXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396834; x=1757001634; 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=pP5mgQ/KO2A3DwCCCQ4AUd2vgku2CtkVmWarRJcBL5s=; b=Z5+5vYeLotgAF34JtaVIvV1PLnbbWJ82cHRmiN2Wyup1C60cBmMhvl3OxLVgGGQREM jxzKt/H9Bc+rUlb3phhuGVsscVZan2KAUunibzuyLpNski8gf1esJhMk5F9jvN1MqxhS j+vm29nKw1BGUn8P4gk+82goK7u1CuSSY9tOm/rCp5avKZ23yWMZIfFJlw3kAq//sZSf Ikb63QHJPszeYllggKn/RgKsmLaYa1WhRECCBepMKkOJ+IBcbp9ktWFziBUC88X6ayPF rnwnD4JM1nUCvrScH0RDHSAjRlRonkx+5oyBrgTehUvzKrbxzci0bgsrDU5Tj5qZDfBI cy3g== X-Forwarded-Encrypted: i=1; AJvYcCVywnLs9C+7czEaj/5YJ84ScZCpfgN7xsl7CAXoY3nkIkYdJj3HTIu99I0VuukYy60GA2NVUsqx7RZDj20=@vger.kernel.org X-Gm-Message-State: AOJu0YxJURlmzqFuFUpTeTg6FWC+nfZucQyQwHbFnYz/zg5gO2ibI7NZ eKi9pFIKZYhOOg68Fqs3i7KmFXpf8wwx9Ky72t5qjSLC7a0pWEufuGvmPmgqeWHnBE4= X-Gm-Gg: ASbGncvxpi8/h1xVvNCj9HuqFQP+3fSayE+DRl/iVhQWxsQmAbJpmVcuQkDTgmIozae 6AvhUM0S7+RL/uGVRqrlG1hTKp+U1RMvO44GJOqz5LVnXn+l2pSmSa0/lbSp0PY+tklV1UcGjvp y/+7RJnyPs7+VDm6pd00tUdlzbse6V5mCyv5AProeyiQpnokeujxo96fwXI3sOgrqFU0/+mwN+g Rw2YHqe9WDhd1zjSl+G76GgSnDwCSZK1UDeGWM0zCTFhsZQJtnRnnsUV+zVI8ioC7nQAYG61GRW 4w90jk4O/GFX5czUnr4iu+sB4gloG0IjiJwt4vId1E7PjJ4u/U/bFBb2hLcAym7noau/a+xeZ05 6K83mCfFXRRy6Z16zQGUX4YkvSSAo X-Google-Smtp-Source: AGHT+IF/YEBlIMtlSjoTBlz73MY+KW34NIRH0NQO4wGYXNv8UgmP3L04Jda4NkFEAj5ubMZH+/DoUQ== X-Received: by 2002:a05:6000:3107:b0:3c9:cd8a:2921 with SMTP id ffacd0b85a97d-3cbb15ca243mr6478341f8f.21.1756396833984; Thu, 28 Aug 2025 09:00:33 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:33 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:17 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-9-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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=heCL06NLwaBebVNCL7XXRfzeEKX3nvjH2Q2KMKw/M54=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBosH0OSJ+6KxK6PbX/PACI4VH4kRB8IHR9ON9MU JmGy7C8qQGJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DgAKCRARpy6gFHHX ctL1D/oDTBN4t36cQ5paiwmObkaewu5MGDgSBBjxlCjWyR0P3OOh9Ww3ut2AjFIxdMRW9AiDRIO sKUASOrHKIm32sDGCahVLsvFRME3KPMFCAg4gJsg1ZdkGsazCK0jztIP0PlZh2Vg9qtlp8HA1py +NzPyWWt0dmwCtvp+lu0kF/sjJYLgHT7PGr04i0kNPpswjNj7kYZ+hC/AvLg56lYG6GWoI/2t9A LQKlz8CDWkYug23hrY5nwYFh7iqvYZ2bcl7vpOj7+1YCp7AJK9g/2Dj+g4mCybIpS2qz5bMmmX+ E6AS7nwOwPyhrU3RUNRaOd+vf1cL/ta9I77wCKVvFLnI/EDOPYchR58ZKoRFzvND0MXxD8Aa8cH ZYPxoAhuXXIPrn1kjhPe2gIezgi9JQsJkkL1zmJ+5DUtKfi8yDnhoGMa89hJYTjB1g5rks0z8c5 y9xVdgNTng6/yE7Mk0wC4szS3GrQ7E8bVU6qfz78knyJxJDGoLLewKwyJ6iQYESHfWi4u9a53NY VFhtWlek4KsFmrtaa2DVo6vY8vpVC6NspEKw5aA5pZRkGyS/IgxAze3MDTdttS49q3VrI1zKnaY lrPe8BJjf6W1KkrRc7vpOWFo4nKVmEZVwm4qtsnUTv/EMWkgvz3ARCRmVMd4x54tv+euGZpZizZ Js/4hXE4ZFt3NcA== 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 Tested-by: Neil Armstrong --- 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 3d626d8c9ae9ebd5f7eb76216924c46b34233749..56bfbf4c3575355bdda59cf7471= bbf5b9babff4a 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 Fri Oct 3 15:34:25 2025 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.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 F37F52586C5 for ; Thu, 28 Aug 2025 16:00:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396841; cv=none; b=hMrDWO2NNgf6r5JtPgCp4HrzNvRgg32f5sbFJd1pxcmeA6VhxygtZDoMuPhE94o5nmvd1j8kjnmQ0XpZDgfqYlzSNlC8/i+UV1eG9rsWGsMsTG9sWV2tJFNZpKpAgxa8ReGfao+y+k7LjAqqFLYKmOL60Vl4Pj2BljGe2wE36OI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396841; c=relaxed/simple; bh=j1C32DmuGSrX82XablstDJcCxUm5RkKJeA9XS/CQyM0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dt90/Wrz8Aooje91nx6wRLvVtq9IwniGiPlIMi8610mrksgV1wgw35hCb//Pla18drxeGLUsbAMQSTE2wA1Sn4AE+T4OvVcuk76rpyLpkOtexmGD4dVhjSuLYihV4FrFLK/SRXdUQlBrZuKIB/VO5n2fwr9dNK/TXlEVXBa4dqE= 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=nhsIldNh; arc=none smtp.client-ip=209.85.128.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="nhsIldNh" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-45a1b0bde14so7052055e9.2 for ; Thu, 28 Aug 2025 09:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396836; x=1757001636; 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=4V6wSNUy+49WdVnDeUhgFQb5Ab581+KZPYX/SdZG0hY=; b=nhsIldNhlFTVtCRnUZBu73O6ENbjqRcCNrpNf7S3P9rr0MyIPM7mj6Z0z292SSxwPW xCuG7GbUY1C/RRCoFvhSiFKUcK167jeCx5Diw+HjVDqQP4h0dpkM0ODbdeYRxArZudDJ 8LAL1gtClulzmPQFYA3pFOyixPKv4ePOo89mGoaNsbEEjH6f+MISwbiZO1QtwSqCfvAF PD31D9QHdHLqKnal92qi34wZDjcYiw3tBhKiMw1YUiKmhBHdjb2juoedrIqm0f50Y3Eg Z6yLOrb6sfzG1Xlwd67IMi+cSl5B2XtaPcM1l16nfhVe1MaHDrmKfV9tJaiblYu314lx OiWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396836; x=1757001636; 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=4V6wSNUy+49WdVnDeUhgFQb5Ab581+KZPYX/SdZG0hY=; b=JrAjE5I1rl7MHzmzzhkDJusOlw/tXRrB1fWMWXr05JIq7q8kT5TKo2QLCnyjinfsYM JNa1Dj/sphArM8xp2huV2bRHCkWSa1WosE/d7zdi9/vIi8FPCvkz7QHYFRObXa2efJ8y 5Gh4JOKwD8wnEB/4/Jw+ZpgwfK4/xBuOGpYNexkNGjGhQ1SAYeOY/WjQn/hc+px1WhEP udVHyiwLw24mSd0TzUsfnP+TKBbhwslvSdZpcuFbagEbdjhqhNeSPrCi6ebOE10pG5WO bmMK+8i5SGth136DlapACzZCCC1IhxgNldO7dNxqUsIzZvUrxnTDZscuc3R9VAnBjs3z f7eA== X-Forwarded-Encrypted: i=1; AJvYcCV9drrb6bYyF8DYJ97KJdj5HdOoO5n1FjL19kGSfgZhBSpCHKke3I7nf7gEEXmH1OJhznLTq4pXIie+XvM=@vger.kernel.org X-Gm-Message-State: AOJu0YxXQTnxS7YaugHfBPmjgU888d1/3/5GiHbI1K+WvsJ0B+PqaAGo qZXUYCbCVBVvWtuFutFiulWZGDkNrz9ixyJyaRmU6+pOB3cwpxvNi8irlbFCgpuf5/o= X-Gm-Gg: ASbGncvAVWpXd/sjhpE0JIhdFOtwSqrdL9TknVFoV8BmzhlWiQkMEnq0FQHzxfzosdo Z/oqR5KT2p8DwwpT6cnyXy2rl+rgO6d4aOfFXUti4uFHWOFz/h5pQBPBtYwjtqoj32gtdL6dypJ vq5blurRW1EeKU6WtrkWRiXBB6TVsRKluy6I5bd/nZRNgHKia+Kl7s4u478TboXMF90oXaL2MVW RE2Io9+a/dSWtf8g5uwkyZ2EMIQ3W1Ox/VWLGs6eVDPmIBua/zq6NzzBRiVsmRMRacxRDF9HsMv GrqOiG2CoL0Md19hQwhlVqye9A+Eh4ZIKX1V2XPUnCboN/Kv3onlBasMtQJHmbJKB1vYRiMSsRu GM3GznEIlW+onO7y3deXR1NZeX4EN X-Google-Smtp-Source: AGHT+IHZut1Ju+wLWOCu27g3oxlfbHJTRITLE2zpN7kI0OEVcWhxgfQH7OJfj9RiKp9cCo2WNd5OvQ== X-Received: by 2002:a05:600c:4451:b0:45b:43cc:e558 with SMTP id 5b1f17b1804b1-45b517cba3bmr203142095e9.35.1756396835751; Thu, 28 Aug 2025 09:00:35 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:35 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:18 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-10-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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=igWDVQ1i3GNsSU9QCM7MdJ/ZXZhmiW6JQ7gs50oMzMA=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBosH0OShRzzi/YdGvFptLEfy7s0tzHayMhd9IJr CgF9D6e71aJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DgAKCRARpy6gFHHX cmVED/9Q9pYZVO4h155fVXACsckZla46oeZ3SlqT+JLQkCr+sa3X74JqYGKATTim7Rw/256QGDE UsdtaqVKnvRWtNWRyAJOeDAiiQPlbb41DBHtaTf0thIPguu1czlk5YkMZsmyVrIfJoNl8sNKGum ptdDmj/ALJIL4u0sfh+jBCnArShidwSMfTM/CPNJVYDWNaIA0Dlbs6HCiBiFRH5KnR3JEDkPJji AwABByFBhrCDmOzAtgqm6bEM6pv+huWJR4v6dtuJCu+mALZYiXGzSBy2evcJooioUE1gjc469ab pj6GkhP1syujJ9WallzCnoFeasP30aEFKqpZLTv9saXaiecZ/IZd2DAzONow948O8he4tnFdBvx ze/phxq3+CZC9IusFa/Cj3dY/GwwVIa8UCraq5poM+av8PzrrdG/Tib4Akj8LEmYo07FtAzbi93 uCxAfgccQ3wGTH6uedp1QjlKh/01q2kDQ6OrMt5aUKhEnSZKHfXjPJpm+ugFW3JA6HuRGt1QEVn o6s7TXD23ucx79L5J9DaEA+RhegqRSr242wmdbQPPZLxiMDbbur2keLH9zjrKxt/hS9k+6x888d 9nCqr6XPvnaEOssyKEX+Fk5PXIjFLtWcYfD8hEPiozd2D25jPIdZh/mybWD9lAuNZtITpXYeZ5S DdHAOotTsdOPNzg== 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 Tested-by: Neil Armstrong --- 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 56bfbf4c3575355bdda59cf7471bbf5b9babff4a..ad3bb8475c0c29e15dfc7a8e4af= deadf5ec8aaed 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 Fri Oct 3 15:34:25 2025 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 A23BB27A451 for ; Thu, 28 Aug 2025 16:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396844; cv=none; b=NBRLyOWNw+dPDPiK4kQM8aLoiJNOi7q6mA0BfGTo6/WyNI5McmvOZ/E3H2LVorTmtpW8ViLE/YH5qd5uQY4XwOxSoIah8NQHle0dwpkjt+Y4BpyedL1qtxApkyOwu8kLn4Ru+j/L44i9S0IdJ8vrl6xMbG1I0vWPzSBHmKlEjv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396844; c=relaxed/simple; bh=gnGkjaHtZR5cG1YYWSUpvgHnNwtSkmlkHkuvNgBor9E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UDDVfm8HtegXCtXw7WNWGtfqn3WSQhYsM5txqCKULlu50BangEL833YbCe2q1v2+ccylAMPs47BzbEBas4ojDyi8Ms3UBVzhTkM+0yadG8egOD6pFmMxZDz5krkxvnaQnrKOpZYxaAq2UI3NYnX2SUl5pGECYx6FSAFBih1e8Cw= 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=co6w3OTX; arc=none smtp.client-ip=209.85.221.45 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="co6w3OTX" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-3cef6debedcso90491f8f.3 for ; Thu, 28 Aug 2025 09:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396837; x=1757001637; 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=kyDGhfJgrh4J6gn9SuBfsKVPoVuurUg4MDMRSiTssr0=; b=co6w3OTXKX99n90RpI+O1BHXogGfoKQExgalVQDbJqJPuvxO79Y3WjrQAwS6lIb2JR v/htFMBrtxrEyzLUaSstUdMVLFOXMjK2VFWYF8EoNfEPGYsnoVvw3koF/mGkKIM6uZxP Zh9PK8J1NbnynjM6tk80h+VIWgUAypUFOe7ng1wwdZLmMVYcla7PSNeRtshnaXqBLRTq qA5n1hzrjHE2GKhnMMuNZgaiA6vYA7UUAzu/GBUH6wtiSCKUdAedUg6ggQD4Q+tEN57j OZbtXILxQqaxee1l04hyiDPsFkoIvx7Aochq8PgM7hPY0pe/QiEuvgRTUSS8rKtOUcIz pIrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396837; x=1757001637; 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=kyDGhfJgrh4J6gn9SuBfsKVPoVuurUg4MDMRSiTssr0=; b=b0Nck/disttj2v7Gr65s4gbA9TW4VGkxhXRd2rpLfARhklxWRYNntltJ1yHA7kd5tB mzvkF8vZ3Ut+aHLaf09X/2l5pGUPEOiPZWtrKk5undblESVo0dV6IIXWZ4ZV44jpSxCL Cha50q2bI3XoEW0co8cL7g2Ydg15e7a0kbgeteNCHNDryFSX7XRt43zBpSrBCjjyMEmC zos2DU7sHXsfZ99k9I2pouAy23sCyVpUukBza9XG0T9qUjuicC6e+gykOTcAMm+xA5Hm 9WFzN97PA8623w19EOuNPh9zCpiVW2pqifwyHkRRhEnC6RlPHbhouQgRvl7k9yXQK0IG 6uow== X-Forwarded-Encrypted: i=1; AJvYcCUKBqcV4WarCdBsAOk0o9F32ZyHMAbEmWMubRfvb46TnXYhedzxAKPa6YlVld0FJseq4JbUH04TcKZIGdY=@vger.kernel.org X-Gm-Message-State: AOJu0YyGHoC3jBDEIsYG9xXdwY1gAPv1bkcFKDimtxuO6tFoCUNKLv+H Chju4BfXx5e7+mqN2J7Z8xWAcx+4A1bMoi2hjbu+RbeHNXjlcFyhnmc7niCnvDSiBs8= X-Gm-Gg: ASbGnctMk3cYuliiYOefk1QKgJZsWUB9wauOHSyeV1CNgxaipimO+s4Sckvd2HQ+9KF 9pJIoWpJs29uzyIG2you3modKHM9mkxD938i9sIs2EMaoxWH6qvaGfKljP4ejp3YBtCWKznsSTe E2UfpgLfTqt1xX7bFpjfpHtxo7RVzI3zWiZqKaF2DLwgh+cw1eDhHnJ81WKArMSJcX1iSc/1Qb/ cfS86dUvfjHE7DQqz/No8NwdAxSM/O7KYg3vw+MP52BwQmZcaNhP2EknYmAX9/Dt5tWH/raMTPK gbxGOMsGoSVYiiSGrDyxFjaP87WwGVXtkpOdmUMfasEO6gx2or6FRQ54FX5HcZoicheujsgQnv8 DkR4rXwTjQLMFh8NP6Q== X-Google-Smtp-Source: AGHT+IGRb2IFrJR7/1J+rjeNU8GkVEAEf5qNguD6R0jJVoV6aqw9N3uve9t0ub2p/g9PXQeEWnV+2Q== X-Received: by 2002:a05:6000:2403:b0:3c9:1433:f8c0 with SMTP id ffacd0b85a97d-3c91433ff3fmr12100077f8f.7.1756396837431; Thu, 28 Aug 2025 09:00:37 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:37 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:19 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-11-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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=3751; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=qmbs27ufzmC16v+sdcPEY4dDQY3iNSX16sXKxiePlDE=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBosH0PnC9WMdqFML1hS6pX4Ax7d8FKU/1NETcnI wejv8+DrUOJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DwAKCRARpy6gFHHX cgUlD/9h+MbAVo/wpsAgGFq0gzUJAW9nwwGnh2UUoj3Kqv10EutSXw2RS8/j2v+ITd4A7ABEv04 3e7T9KxIfgTGIQNStI/av47LGaFQoanqW1bbicRWetgfw4ov9Kg8DBWxmiM38ucKX0TH0B1V0DZ 1ickY8HG8BK6FO+qam8qf//7NJ03enn6xAFDsdu8gsOOiGGf/TaB+M09CpUjTROpxx4kOdwoyRd 7KEgzKdp5nr/aTr/5ymPx+D4YvdV3g8g7zKgpOv7sNzlh6q4eHpIyRXfSLTNFfMEK27gs3RfQiu nFjbrmBC/Cm0Dx3PtrZoiuGFLIynOHFozfI8W1nxeIcTH2drbiUpQM+PMyzn6QwdQLyuYsWIIp4 P97TifYj25rmdWejAC7ce0M/MUr6ym5k13HkeDFMueER//pdQh2BB6H45PG9So0YrhSESCqN3TL 0rgOdRqufzPjxELShQhA8C5ca/bWsVuYWVY2lPBJxS7oqgJQ7yO0V9lityx55QhQweeXFlkDOCa odj5YLA2Ua9lK5nhrpJl4Pm++PVW/VroLuBJuEtg8pEYp5QOywE1m2GdXhZxMn4fOMb71Iy8Ye/ YCmOhCxdeaxT35vIe0apm4cT9JEQFY8JhotGnkxa3p+cTEYqk4BreR/mYrEtQrZJAOXNvDQXIeL AWgGjt+UZOIungg== 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 Tested-by: Neil Armstrong --- drivers/pinctrl/qcom/Kconfig | 1 + drivers/pinctrl/qcom/pinctrl-msm.c | 43 ++++++++++++----------------------= ---- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/drivers/pinctrl/qcom/Kconfig b/drivers/pinctrl/qcom/Kconfig index dd9bbe8f3e11c37418d2143b33c21eeea10d456b..f7594de4b1e9b95458c2c817e11= 58026a8006f64 100644 --- a/drivers/pinctrl/qcom/Kconfig +++ b/drivers/pinctrl/qcom/Kconfig @@ -8,6 +8,7 @@ config PINCTRL_MSM depends on OF select QCOM_SCM select PINMUX + select GENERIC_PINMUX_FUNCTIONS select PINCONF select GENERIC_PINCONF select GPIOLIB_IRQCHIP 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 Fri Oct 3 15:34:25 2025 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 1E4422690D5 for ; Thu, 28 Aug 2025 16:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396846; cv=none; b=EmZ6+tG0JDWMeCe7oAhlUEpMrdJg/g4Hh0ePvzSBn6ldzrzQeGQ2QJic2ZouixEpSidp3Va2QG8rUtwcuNtXIgl7FwL2BlRxzmNaAcsHkNCgUAPt07BXLQF4G0f2sLIkVq5Wv4nws944vNMd2sJnTcrFAJaQc/qYNwRn93T4UzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396846; c=relaxed/simple; bh=tTP3Ivi4QdIkGfdc8vPPhHpWnLxrIJA3KzSvQ1a6ndE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jpsifsl5VNNeXPCebKJOzlE9dyWWcwKjVg8vY0RN5xYjW+L0/Ai8Fafv6d2jqZli//6cT1rcpFEfhiMFvC0AzX5c5SrgStMCf1/UXX2YPGzmZpAUlMQ7rFmaJu5ki2/mkt+znIpFBrTIzGGoj5ZnsRlv7uiLidDof/+t1rr7XFw= 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=0hYwRfA5; arc=none smtp.client-ip=209.85.128.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="0hYwRfA5" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-45b618e067eso15724915e9.1 for ; Thu, 28 Aug 2025 09:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396840; x=1757001640; 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=5cgLuuNEHZ/uYnDNb6dxgb48v4u6axzoTiam4WWN7C4=; b=0hYwRfA5B9GwQqnQ9LxaICXrzroC/XyrnAslMSREJlZrS+HywcYb1tINacTjewenk1 3ObeSQh2ZjU7khrSB6GbxYPQh9+6XbXFkHW6meMX9qsqzqWjakj8PKoyFfmtC/yfZF5y 0BY1WovG5qAMWSf276Y+Poqvff0xVqs3NQisIhb8tM5cpuuxQL+XTPAL/OQXT/EUtZ+2 wfUo2W5BTXCfiRxoR/UF9cYNy1apYuZHyxCI/y79rV5DYnDRX9uSkpIwE5d9aqRLbqKb uEnYaWuJehjx6m8It0HNJvNjJ8YTLh2yAVBGWwbnTlP/jHBdqQr73fegNqDxGx99NyAu K16g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396840; x=1757001640; 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=5cgLuuNEHZ/uYnDNb6dxgb48v4u6axzoTiam4WWN7C4=; b=ZU9FUYlySKYaUXGY1VdsehXGWqcWSc+eFMSN2cJKmcekGHvUSwFAvh98eEnHMEe2Gj eX/hsK+X5BtH88Nh7Lw2FJ43+V44s2WK+Kn/fmStdgPktzQ37PT7Ko/0OgFbhmOEv8FV 3AwD2dNMlp5S37ehnRwvASMT3AaHnCmVscgJhK4VaIa0PUA3tpycUHZ9fGZp7xrD+LFx HK3c3hhsKC7AsxMSv/tiUx6/7szlcZoMmrYptn6SdfYsYQYon8fnlQoEnEC1JCcssAt+ M/x23U1SF+Lc2lgaZm/U4a2N0/xNmZn/gptj2wYewPgY8yHgwZHgL3th6YpRF5gb5bvp XJbw== X-Forwarded-Encrypted: i=1; AJvYcCXcIfi4nF5x1CBRLw8Zx9tb+Xn6bnxE1cyVCoo8Dig4RNDmeeIdE/teUx/O9Xsjk1ySwCpIBM2VSRbbNIw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/DIaKajjWsEg5OoZdnLSUSo33Oddl5kelr0DLJcSKH1C/xGKC 7BuVoYXKGncmIRblLB/2PK1GznG/b37k2om87LDUFL8Z24oJ7hVJPExhq3YCciMWDYI= X-Gm-Gg: ASbGnctUBgUTCHc0OlEoGMJT/ZKZ+QAGXjndkL8w0nBwo4UjPXRiQEJR3jDpifh54cz 49kVPfvUH6paKBj0WySdDs5HbrLvJ7aV8cbI5C8C+1bhZADWlAGEzp1S2LIhnN5c/8+3mW5z6/n 7ZRUQfEN9VTWq3ulaAKsXHQXucOJnLgSiT3w9aphBAn24ti709lDb3ez37U0hviipAnfUTTUntu nnJNDZYqk3efbovO10AlrKyxabjQtxuJvqhsPJN2JUpBvOAbVjp8v29inYRGKQNRxD5+gmISJ7b eb9NbYj3Acim8W8TM26nUDS8vjCQmqftuNOxbeWoQ1d5n72Ml2UpfopjphKMeGOSnqXexBQwNBP Ku3U12P75u6fewGvnG4cVJAZapH7d X-Google-Smtp-Source: AGHT+IHY93xJicIhLfSdUidEzVpKHtPobrQXprg+Ck+5hE5qf9qNEqu57kxQutrcB+RtoXUB4WrEqA== X-Received: by 2002:a05:600c:5246:b0:458:6f13:aa4a with SMTP id 5b1f17b1804b1-45b68b79262mr97078985e9.6.1756396839658; Thu, 28 Aug 2025 09:00:39 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:39 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:20 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-12-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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=7248; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=cNbq67lYy5x2lWhqKySAtFll26hPMdSh5sE8Ox6iL2Q=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBosH0PNGB6avixd0d4STpVF8wM5h87O2Lo5z2Kz bDbg4b/QXaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DwAKCRARpy6gFHHX cqwYEACp9WcPOcy4gcfDh/LJJl3cXfpEoQwSAP1WBDPryd/nzyb+k1ROOY9B4LpM+IlXz7zoD5m 4enSFZkdcYJf5OO80aWnvZN+c3oWCigs7WrMSdDoZ2wdPT/iHo8o0otbFvuk0WUlO9iOZPsZ430 zWyy8AjRs5AxBwxee/C+MI/MsHcTmJxftuxqn/QZSUzjO4HdsYvSRORiDo9LG0IR+XKDC7rIAW6 Hy2KsGziEum8j+RtK8udciPRz8b4Jrh/d3Ln1xTmqrCL4QhxGKjNiQG9vDHM2ufPi6ZHlWEtGuu w0fiUIG8vrnfMwAVz37LYjiYiVuaz3LTNKFy22jcPW/4msoW66y3NBn23pMqkuHVhIqf5BtCPeg n6zXZEFx7QbhvYIM7xhxgGciQAlKz2E9WONdxT4V/40OMzQzSHOjnJ0lVi4777IFfOoL2nE2KEL W48IdClDet9yldUS/sDS5N/LMmy9SpHdIH25+Q1gdX60QAQCN+NY5yvPMCrzzeaiBRcQGS7ufoK 3ldEFyHY8UA6PKuNdsK4Ikns5jS/8E+37Jw0lYI+RsahMEx0txavgZA46S6nxj/8gMaD5IK4I3w ax66JFhNeIfXBqRZnEfpOh68bNIdhR6i+nG9FUJv4YXhIKoXfbtkJDBO71lKwsBsDHe6v9ZGXct OzAWs5aoyt5lRYg== 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 Tested-by: Neil Armstrong --- drivers/pinctrl/pinmux.c | 46 +++++++++++++++++++++++++++++++++++++= +--- drivers/pinctrl/pinmux.h | 3 +++ include/linux/pinctrl/pinctrl.h | 14 +++++++++++++ include/linux/pinctrl/pinmux.h | 2 ++ 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 6f5e3ede972bbfa78e279790df359632e2d63485..c01814b5b7cb43acd748153e08c= e65f5ca7a7b9a 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 gpio_ok =3D false; =20 desc =3D pin_desc_get(pctldev, pin); if (desc =3D=3D NULL) { @@ -126,11 +135,21 @@ 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 (mux_setting) { + if (ops->function_is_gpio) + gpio_ok =3D ops->function_is_gpio(pctldev, + mux_setting->func); + } else { + gpio_ok =3D true; + } + + if ((!gpio_range || ops->strict) && !gpio_ok && desc->mux_usecount && strcmp(desc->mux_owner, owner)) { dev_err(pctldev->dev, "pin %s already requested by %s; cannot claim for %s\n", @@ -138,7 +157,7 @@ static int pin_request(struct pinctrl_dev *pctldev, goto out; } =20 - if ((gpio_range || ops->strict) && desc->gpio_owner) { + if ((gpio_range || ops->strict) && !gpio_ok && desc->gpio_owner) { dev_err(pctldev->dev, "pin %s already requested by %s; cannot claim for %s\n", desc->name, desc->gpio_owner, owner); @@ -861,6 +880,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 Fri Oct 3 15:34:25 2025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.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 4DBB027E054 for ; Thu, 28 Aug 2025 16:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396847; cv=none; b=WclJbQ7OWql57+xyGSHEMB/vqXqk7LXI1zjATNE1g9PW/wo+mx9aVf5L9XJVn6MYZvdwrx+ZzsGtjqGpOGcnnou+jOFO5/zeAVv62R1UeXu5KSTzqE6azV1MrIrCD+VN7Esg8Xq35eJdodeSm09rXAGFgJvGbjN+j4Yguii6QSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396847; c=relaxed/simple; bh=d+pkakvHisIo5B7fnb5foS5HS7QjQMAp1P2iWKiGNdo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hKcfnoWeCKnelCn9gdDXw75gIzzFi24UUGhNrhwUJpHntFmr1LzgYLlY1K1MPc8GuIR2re531utRC5bScn3z0AwfpftmHg3rFf9Tz7oGgV72/ox2PXmoPEijUalLjsopSeFKGUJkLYHOd7ltdCGbfMsjV4SYyFv73OZD7ObAzPk= 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=AU5hN81w; arc=none smtp.client-ip=209.85.128.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="AU5hN81w" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-45a1b05ac1eso6097035e9.1 for ; Thu, 28 Aug 2025 09:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396841; x=1757001641; 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=AU5hN81wTdXdxf/m98TZmix/+zuSq4O9sP9pQ93nWv+m6qkRNO7GVDupuLjkNHqYdP ctFbUMjFzk6GStk9VLV/3NtKkNUm9Ljd2nMSnfKNU+KuYV54CWtQNLi14NAx3+67njPY n2Gde7d/7uUZaD3C46BrRqsc/V9krbyWzJfWPQhEkKMrhkT1zMOQ1SM5ZzZ2yMczOAGj P230KpYf2Mxdi0mRZ8F0GkVZ19tieS1plxYg7h0u7YUyj2vRu6seu7cRHaEDGf2Yk9ym F5CHFWJ42i1F0IxaNnq5kO0maCzFLbE3sEBgl4krnP4vRKH/NMZ7Ahm+TlGTWcJuxnr+ U3FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396841; x=1757001641; 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=Sv8DMkSaD57aksPW9mOK9KBN2bUPs5RVPz99f/3jpLY8DHn8TwOaD4ckunw99hRef8 Fd2FyrNqFcaQekwvdQAaoVKezYz561GhQ+beUz9/Kh+4VcEfcWQL75qtPRpZMSq0goke /14L3zAZBgRaJEoZ6uxzWLUSuXcdhjnW0KmLFCryG7AL7Bv8TifMk0A1e0UYkmzahPR4 vwYeF8Hyqhpwqk8hfFmVSjka7KuOV580yYrlZuE4ubKgr0ObEG8AoHWpOHAAWJPGpHVl il4PoVAMF+MVTkQ1cfC8QR1FX17/BriMiMTeGvOsAc2TfzE1ZH2QpHDTC18vpi3OyJdj HUgA== X-Forwarded-Encrypted: i=1; AJvYcCVQW7pHSQmoEkUoTg7kC6RRrbPIurr6UIFMKfmGFJn467SOPiwPn6HKqqMFHLx+AlXr3+NIkFx2lqpwYvQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwvzGzSIJz5dMPQFQYtgonun5z0Ard/2UaFfYzedwNMN2q7jHeO RcYv86pIJmgVm2i4QpkMqaflRwxg8FvFeJiX2Illr5ZyQlvjILkcx0bZR1cE2pbY5m4= X-Gm-Gg: ASbGncv7HXcGbiqfWr27p8k3KFr+SZgEm0/kPaW5GXyoB6Afj7mBhnzo0pgr03koNgI wWOBRgGXQbFNnSNtPRzAPFfWRG2jzSF5+P8cHhF/N5M+zSpUig+2tA+auCOfL3bBoD8zRkTaQ+i /dNM21nKpiXat76hz+r0Ut+Qga04sJpgIPwBusMmrLc8GegWlK6ffpkun0vg7w0xupt9MdbQUdI jJlhTXqM2ylneUUL43UGKV1o0s2Z9XG87PE9arX+lHmzBesmGGaJp8yMYRuvMAeJ8bXbYaxZbkl b5flXvHK4rSOgzTMPhtc8k+kGvqIYUd+XpkpVix5FWBIJTzUs0NH+ONoexqT3mq5RdycRJhyRGG KYC1V3S3ev+KZsJTayA== X-Google-Smtp-Source: AGHT+IGBclbNO8WGRtJ0uIJ0ka2pGvDxULNrTlJVFv33q7V9H1vL8p1aMqaTfJLA+km5WeyuNutw9Q== X-Received: by 2002:a05:600c:548d:b0:45b:6f48:9deb with SMTP id 5b1f17b1804b1-45b75858134mr40479305e9.28.1756396841346; Thu, 28 Aug 2025 09:00:41 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:40 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:21 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-13-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0PIg19tb8c/EzOw0dn2/vV0Q2+khf5QKTgm oMVFo9hzQuJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DwAKCRARpy6gFHHX cmqpEACqff+3ib93FI87PuYM4exeofWP28ytmolqFv/JNDSfQlXfjFmYnRfKPTFyBA76ttfOjLm ASMPBrH6jm+gDbBK71pqHYmPLR2F3+VbGeBrBP4P+U4KIOoMivjWw3M4zYZw2pqshTxIuzIk8hp p7MU2ac3Y9n23iveKbzSAK+EoAmSxL2lQ15yc/7o8ph4+/jCy3aXmdAepBlD2zhWYVn/xEtcAcp XMTxIoIzyILFd7r5Z0RbiaGuyI1mT29BWNgpFIRDw954gCvFOYWUrbn2o/Lkg+Qctpz2A4FUeXI Diiu3zoutBbFXtO89+FSOyzdmqfSLbrt7rVfKtvvSp1/OoGcglsdJ9T5oWoGjckBb4Zc0Sbj1+U /4oXbRes08VCGwU5d0qXt2c2lxgrVlVnKODYUiEPU9qJkPSIX7Q9PAUOzdF6wmMNQBs3xWUDxDv PydivI+3iUC103HTAmcWHpervRU6SelZmt3njPpmXzohKb9EzGDwrif+F+FXALOTHaZUARsDhtf HPf1uVDdCvVnnIPhwwMrx5l+4F1B21FUAmCe4o6k2r6BZp5mZGL2FBpb+ZIiABfcTzIwxLGjOvn 04jBAAR9bb5jV1pFoCEljbH/f0c2ullfdb+vvcTGt2JrOg45VcIDDclxo+6Iw2aCGRgUNKNCbPg KlIxSfNF/oUQW7Q== 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 Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 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 DB7F82820B1 for ; Thu, 28 Aug 2025 16:00:45 +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=1756396851; cv=none; b=PFUdXZezia5RptBK1d2b9rmLnruf6qQJGIKGuA73mo58PRZ0Gtvgos34BrIVI8Xm4nzCw38B4+qTISx6OYeQ/nYE9gZXedcHG5KARrTCYKZ4K/0mqMEjqOsnPWxbO4KJZXBCGkJWcYD89PbfkA2hWnHTUtvCI2WPOkwQEGceNtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396851; c=relaxed/simple; bh=vf1MyQqTUh906uie0wJuo8fzAwB562VUK/aVO4anVkc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CgUL1pt0fgj6DrISSk2GRScvM+NnZ1eWTbzH7y8UWHBj3aUO2toUqU3DfEY+3Jc/Ju774jYqUM0r5PnyHH2KREDNgM0y02DH8GmNHnj5M3ygkatpDnOusxPHPAegHYmuIX2VrDNsaVzyQ5ObARLGnmRK7nmHd8AT46g3hU/uzNs= 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=wPPC/Gd3; 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="wPPC/Gd3" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-45a1b065d59so7733835e9.1 for ; Thu, 28 Aug 2025 09:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396843; x=1757001643; 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=wPPC/Gd3v4fE8b7CJrqn6DmhkBYa1AGr2mV3iigE0+HrkQ9zdQay8Y9aSrOnXWCqfV zjYOVWcdHr39iS0W4eTu0VQKDYW+/5lSzzLDjPrrUFUoWM7xpkXSGHw7vMIxyLRLCRn2 x0j3lPoAILmm2U6Q9IC5M/CASHA7EkXyrGQVUelp8BZcvPtpJKph2w/6cKV4v356ooAD Dc46PydLnwFOXx4FmqWwkHggzvJW88e34pOm0kuH1dXczbbu6rjM6rsLVEgQyrBY66hn TT+GShZGhyZMexnDZkDNiEKSWLsNBBkWIdPHPz4bdrzPhEni1ceAYrQrG+B6X4oy3TJU kUiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396843; x=1757001643; 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=o+kw1YmzUSqDCo3hnWfB6RV5TAFnXzYSy//i5MxB0pwrPdrEmWS+au32LTo4W9NQjN hHlJNfZr6zPCBOhIJLu4AnUg+lEc7fkgg5JK42xQ8Qn9ECJ8Recwi7TejflZyYXqoK6H fj1dYuNTWw5WKpAu0cRLb1q+krtw6gqx88T2tkRBD0M3FWABkdbNXvqI5cCh/jHEl+Tl VCnABkWaVy4h4lUhEKhVjMvTihEeUop7ZjpfBFCC1fICXjzxSQi3uqNFBxrMOLI0wkOI Indo3SMzbF2cirbgXvpCQt2SQmnQHU/iGltc0E8bEamISa0M5qdWloJIASrWYEGpQtrH B0pg== X-Forwarded-Encrypted: i=1; AJvYcCVbXKy1vcaaScbv+mS1Mk9eaoY7yKE0wtzKmBvTd2RraIu0nmk9zr7wD1nP7bKelaZ55QMtfAZVaOQVbKI=@vger.kernel.org X-Gm-Message-State: AOJu0YyjKp72TrD6zQJMCnFMci61yDb6rMyghJU1b5zuMhx7129Aud/e eG2YTBAGaeFkFsr0KykL270SlU0pTGxTaJ01OTEZzcVgKGTk1hInUnoIvYHcAnVe/Vc= X-Gm-Gg: ASbGnctxEww66yqM8qaftL3np3f5PSNHG4H20eWXEDuyinZ2bVpKiNRj6jQUx3DQJx9 kYkyRmoOO0JTPPHlWdTv41Uulq9GRZc73FLgEYxtnHmoO/CxYzKpHDsDIlUBzr10bgw0vhahyCW oolIAXPbxQaogUDyRapoWRl4crAvH3ND1xi5tyYpVprXFAfQTUQ/0R6uiQuf/II8gf6mMtgx6dO jfW0tYNotRM06MaMSuoWPQ+akpsg1VToRORnEMmwan4aZNLgSUIYWDmChqAMsc8pwZ7PhPp2WYD moQ3S6tWniKbBpsDG3OI5kcCPO2RpP7Rsor7gW8wtiUQI+J/PGeNFkgcWqlGIIUF7zQW6RD/TSA hPDPg0vqQ/tvLe2tXS3tfxIDiBVp0 X-Google-Smtp-Source: AGHT+IHyfwnPOSiFQh+WnjEL9NyUBhHW0byM0gWyiMHMkwrtgEW09+FpeEkhQpyU/BEy5WYfjiamFw== X-Received: by 2002:a05:600c:4f0e:b0:45b:5efb:2224 with SMTP id 5b1f17b1804b1-45b7bf1d61bmr21491845e9.23.1756396843098; Thu, 28 Aug 2025 09:00:43 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:42 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:22 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-14-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0PpC6seieh2cgvJ57ebKdLIm4PBGshfZ97j GafNBeZZw2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DwAKCRARpy6gFHHX cg5pEAC97Rymg8gbuD0vFT2WcxyUu6Tesfhd6i7iT+GYsjex58N7fWo5OiipJD6B9imt56tprBO 5KWt7lQsUsi0UUClG6E0x/+XIWbhvqEWgCN0TOE5MRjnlkgDCZiKvTTN25L5QVQm96EvKv4wGfE hsvNWNkACJ1tE+3vtXc82zgeF2GjVSzMzxOU6XkQjmpXLZ3skvb0SI4AF5iMPr6w2FQq0RLVELb d+Ckwj+4OvAmhhTzGPN/7KJQpSBDqFdirHIAv3brhuWLp5uXpKscY2OTzDsjIm0SGv560v2QOq/ cS2jT1kKLjWWeXospGP5XSi/EPX9V6bH2pBgALDPPiRY93dbUSnJycdo0jJlD4ts+hJ2S4f/u33 QxayloX2au0Q1V0J/mAXsuL8E7q4KS5CUxx1Yx24Y1Ivy5iycJOOcjs4qFRVxWqfy0spJ/GvqUR JqQQ6Eeq6jLnzcewWhTtr2ZSaS21FqWGS97vjzgOeahwuL3L7xTtuptY3JS49nm04h9kQD2Q7VR u7N6/sLyW/+H8ZcKOl+qH07xKvW8T3esV5b8tC88PQOP5xDiA3bZ8DPJG2EkcfGOL3vN9JOTURe QjfFbeQkQmN27SzCbJuA41Y5ujQ99V/rv5EwL6Oi3/yJp2YgMMn70e3Jsn/Xv+09TIfpncpTZYW Eqs1D0VlqbKDZng== 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 Tested-by: Neil Armstrong --- 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 Fri Oct 3 15:34:25 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 D21E9275AF7 for ; Thu, 28 Aug 2025 16:00:47 +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=1756396850; cv=none; b=caRQFVkqAgTKiF3SFL+cLTAlzzDVXtVLLLk9cmSmWIhtMTVxZq6rhg5o5ZWpKMQM33+8mRRUbBsXgulYpyUlyqaMlfdf7WbUMirATwjzjPSxcASH5b3N+B8OmXvetoqCwldFuWxYpMk5dzAlMFJXRZREzOz48T2APFDB60ersfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756396850; c=relaxed/simple; bh=RFujl0Cr/YaORxwURfe0zTKDzCwOsKiOevFTrddSrvg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ukbqFLwPh8/l/VQybm7gdI0GDW9NZqUSDEj3ygn7NUatNRHIdaJPNP38w8LZOq3fVgDFVGsWJO+wugM30RRNZ6Y1QMvZy6v/cAwfHFWiQTCNneyfvvTnY9YnUCbDvHsNNFPmyqJ715Bs0q4r7OjXWkTF894UJq+AVdxtKEaJmBE= 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=lj6cDzLy; 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="lj6cDzLy" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-45b627ea685so9069875e9.1 for ; Thu, 28 Aug 2025 09:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1756396845; x=1757001645; 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=lj6cDzLyrRNsEyMJagBiifpMvsKgMTOdkDj9GZcnDUdSWk8ufFShfmn6oRBNCPJlYN wwlx/jCcxGFh6khQcBnZbVSSt9/FpDiM/wFcShxZ5HeSfuytoJ4T1tp9FKUK/l1m0BFu q2+YD88pNd3Pjy1l3WbdlWvJLqTuZNOe9qKuITPjHqN7g5HTb3jYgLLbrOJwQYHyRSBU zQyAVA77lFidrn70OCC+dt71w5oI+PcHzWsVqDJZTpHp4uRShQNIGsG5yO2u0wzoFhxT RNCoJOYHz+2KB202CXeBStzNzhhnqRlD/jatRgXT5zbTFhBq1hCXi34hUK8POyu4/k0H 1Pmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756396845; x=1757001645; 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=ElQ2belKiyZ+ZpiBZ2l4x6TprATPhK9EcGlZj2N3AXODOKmBJ271Pjx75viU9Tg8nz mgUn+v15CcYIpwynvQ1bNS3ntiiUSgFrgdm4Uz0/GgzF5Ode1okOcK2QuBDrspS+Zvon IWUYh/vsA/nDp63UyEd4Yabc0E7ZydrGYSAz7wJ+RrWYK/DEh1iFEbinUpj3pb2rcX4M PVTJJdhcu4u77Fk6C3P60sj0naTvdICvn/FFjTcpbf/yHk33MvyrrsvglKtshIkmaAIZ u19SdTn0wlnZhnszDWPqk4YTZ9HJ/Lq5A8HTv4kSV6ygk/Ad8JHzD27x1lZS0ETlG4mz FLNQ== X-Forwarded-Encrypted: i=1; AJvYcCVNOfhAPXiIMMz2D7uT9gP4wt+C9DdcJDp9RNA9UBfdc0D5HbmQID9mj0ER08AdaZaVyhiqQjHMn+wrfNo=@vger.kernel.org X-Gm-Message-State: AOJu0YyLWhHizZBfvI0upwN0Xv5L3Po7leJ5R34UBDcVmQ2av4xX4mRf TviVWSZAmG3vLAJTiD4IbF/czIbNLxDg+y+bx1BGM/8WiQTsx8GzqtZNU/NT9lIVqOw= X-Gm-Gg: ASbGncs+tEC/SXuM2pmltbDhXGPoHnhMNkrHT9PkvTCx6ts963O7HZAG9yN9qA3WNPx n+B8dOGB9q1ltgw1x8C7FYAxsmsKFoKQxAxvnVjLpHcNtko9YDzwTnRaSkVz3OPioqUmpjrpm9g Z1abCDIXP7Da2TGb//rA/wMX4NTw/07y+LU5ayPebD+oNCIbBvz+ZyT7AuNkOO/TXoiSfuv7v4P Swhwi7Fd9S7xt1VbQVI30bXtHaTSGLGvBu+u8eO6oXJyQpmglH5o9wx0B2MT3Spa/Lv4P1g0zgQ KFgd6lj5NzcJ6q4X3UKY3RermkjDFP8r/0oHss/TWCAJ5SGPxdbfaqrJkgRiWjGzHS/vG01pEHr 77dNblVmlAeomEPuWQg== X-Google-Smtp-Source: AGHT+IH9eqAsu0mBkmZO1sLp4iQB82doTTOSGeYtxhUeFPIbPn5xY/WnY8KAWmQi9Jdt7MPymPYo1A== X-Received: by 2002:a05:600c:4f05:b0:45b:5f5e:f1e4 with SMTP id 5b1f17b1804b1-45b648111dfmr100878215e9.27.1756396845191; Thu, 28 Aug 2025 09:00:45 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:4933:4d7c:cf69:9502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f0c6fe5sm80211675e9.5.2025.08.28.09.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:00:44 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 28 Aug 2025 18:00:23 +0200 Subject: [PATCH v6 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: <20250828-pinctrl-gpio-pinfuncs-v6-15-c9abb6bdb689@linaro.org> References: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@linaro.org> In-Reply-To: <20250828-pinctrl-gpio-pinfuncs-v6-0-c9abb6bdb689@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 , Neil Armstrong , Mark Brown 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/ZANAwAKARGnLqAUcddyAcsmYgBosH0PX+ObgCFGCgqoUrUjW902keUOxgLE8EUsB XcES2lA2qmJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaLB9DwAKCRARpy6gFHHX ctL5D/9vpjY2JraOKI6xQLDzt9TXljIFuNDozQLvzOHyC9MgvKOWbsLqyOrunHPfrNqqKOFBK3T KwmfdS1uCAhkPVJFu9+QIjoLLd5p693JFSuHkObJvgCet04MNbRQLB5JHqL6iuH+bu9MyubXgwJ krZwBmRMnrDWPenruj6k4hAA2ihAQlUx9GOdKpiLfvYH8b6RAkHtDQPWjO21WqCLg4XFku4EESO 5IruyaJkV3MTpbYIobh2C/a6mUW8SqezSSh1LG4Bd1XobET0b8+hWmght65TmOvonC+GLe5r2Wh pLFBhM0QRVLHeqtJgYx4uIqUU9M0k9AXIOR9238ttf3Ct3ldZ9ZfTONb3jNBXOp9939T7h4ZLpx SUaPlc2TzAFEbRUJNonPEbxaaa0+qbqTjF9ltT5tZC1Mlqr8pyzA1YH8BN9wyrbK4N6qH1ty3MJ 6emE/yXMZFLsGd8hOSA+egnDYIO5BK1s91hpGWU/ZY/fadrMn6UtPYHf85JlfFzmhIlsS9nHjfY oLMcdYawGwDD/MdG1Dt9y2yWY+0T4iNxJoUqYKmpisWrARyHw/iR5VjqJFS50k88+CJMB1H36z0 letY3JTa4NNIETPLbq0dvyWaZmnqCNmCzEgKPyWyC7sxmk66PTtyQoJj32nMAH62uZVZ+A6DZeE zit65McHjdrqSGA== 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 Tested-by: Neil Armstrong --- 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