From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D61A72E2665 for ; Tue, 12 Aug 2025 08:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987234; cv=none; b=hzqRliZVSSNlYd30N7apMedmD2ZhP5iDtQqoBgxBbKGoi5R11c9h6W3mQ6aR4CibOgNH9B/lyCdBHp4vCsAw9bESVlh67fTnky1FLu+fO5N99XrknyQkHIRt4CxSsEehXiwQvdHVDtLjl+S6Ry3j2CJvSsqCmamJfFLyvHo3TS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987234; c=relaxed/simple; bh=bNsQPb9AwqRnxouMDlFzcHJphF1Do/Kcrq8+ZqSjYVs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XQkqEExfRv+hWqpVnliEtf9y/55AuWIM54oZUK6EAvSVaKwsrvsocGjAp1ln+Gnw3C8+p9md4IkFxSTLZ08+aulkBEmruM/bd3eZYdlMQXRRRG5IuPhuQYjtRBioKbwDHNdhnRDtNlEMNzAId58q8pPsIDo1psVlUgmtZBfJfnE= 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=QgPZfl2s; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="QgPZfl2s" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-458b49c98a7so32979605e9.1 for ; Tue, 12 Aug 2025 01:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987230; x=1755592030; 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=HTgIYPzRiaE3tZSZCUJbaKi97GRLZz5syZCli9/nEr0=; b=QgPZfl2sW4dc5ZBASFbhZ6LnAguM1EhnVEsiEpBlgk2e53Ql3v0+xUdhMCxvCvsL/w 4ckDfrU4Z1I32aiQQL7T9Eu7AHSovvqEjhr1scutbyj9zhy0uikLnnRprs+ddWBOCDCy d6vDPwoFM4srssi/ZZjgTbhbC7pG4gtdvqGF/Ltzl1lz/+E1yA4nCHnTNil+oBPWbOlv LKEtc/cpUeea5HzHG2dOOXAM3xbjA3V/LA2nJAm0Q+dz6FVJ+EZWJFWiVbLLju/3VpIO gXeoSF0GGODKC/KFVY3ByxZ9noEKBHT+THdCT9zld/Nyh8wZCqeI6xoy+o9mW80Zkke0 rg3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987230; x=1755592030; 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=HTgIYPzRiaE3tZSZCUJbaKi97GRLZz5syZCli9/nEr0=; b=ZYQpOOpCMtXbtq3KixOvVpVVqanhQlQi/TLrcCkk0ASiliq3JcRhXl90AVlL/nf/YK RCFD4sbxFLkQaK8ZuKZEaFIyuTIuPFnFlkjZZJeXJz/z2DXiM9bS8ttIPUgjXFtCrigD 80K8e4gU5+0/x0jx06mgOAMhizl0XCV7coPurlONy8nkOgDZaNW7ccu9PI2karkeFYyk Kks3qaGw+R1uOmxUAxwPcizz/P/1LQ3L9S3N/mJrSJ0CH+WsQ7/8VkV4S20BwXuPUwq7 Y6kl/0eEQmygYFQult9+Ox/VhDS/qjW6bTbZv3gB+meEvLu5hG4bM9fMMPBZ0iV3j1uz K7pA== X-Forwarded-Encrypted: i=1; AJvYcCX7qbGmxOGwkhWXLduVUHCAXFI1cLPve2NVAu7AyZOHsq0z0ruH9BvCB0mlp6s7RbTECfjlw6enDu1wmxc=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7jgCdHfwxsNWmaBK9RrBD6C3TnT9LrKa6XkR4/40hFvbZk3CF 1xSkVdtVo8Uh215AAX3OsfgLyu4yq4/Hx7uh7uWMlJ9mUTtKlpHdKDxMTkEG7i2Eud8= X-Gm-Gg: ASbGncu7Nc8OH7bHmZwlBxwfxxBsMq58eHJ99YhWgU6JHvoInyo5x/bJJbGfnQLVoDQ PrSBiKTjpVrymkyv7q0vJlu0uiRmzfEkVjcAjTWPtfdWho7waLHQ+29XS87amy6ZLqQqRbWdjE8 J+f4kXy8HwlDx9y0OOaG6PXg9HaalPF+fG9ymy2aeAXlOmxOmux2DStrgZ45vx/Y+5SUSQgEA6n 9m9uMyCtd+4jvjhRmtnGXSMHz6dofe5J0Hz6TFybJaGfS9PIuplnupmjhkYchnAIgOjWj4ofW5w noN68Fc/SzTo2syluKPRX8PZ0pNYvqHxndfKA/6QjTPC0izNRnoyvj3ihdMa3fSVUoa4yFsV/mY xekwnIicQmHFIzTc= X-Google-Smtp-Source: AGHT+IH2gcGBdQpuT3RXzrIq10+dePuK4J44tZFpcWvxuc+mjI/75XhCe1aSLOq9Ow+V0+SkeWNRig== X-Received: by 2002:a05:600c:1f0d:b0:459:df07:6da4 with SMTP id 5b1f17b1804b1-45a10b9b16cmr23623335e9.5.1754987229745; Tue, 12 Aug 2025 01:27:09 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:09 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:00 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-1-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2063; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=Igk+yDN8BP1JkTjLlRhKQ7SRJ5My7JH94ZAwq+/yocg=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrWHo270jKNT7TR30vMTLvJtquAQ8DkFhjQc ewt3zLD8DaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr61gAKCRARpy6gFHHX cjXuEADPonktCGWYlKywp9d3HO63lp5DL98Fa5df96en6tECd7hEXtS99i9LAByEf9gB+XIzpYT bn7HKsMznjan6cqY/js2/PmDrnfrTaS8GMTWnnVOxndSGotuSFmQ3zk2ssQIvblDxvtxEK/VfWs Xorx6opZLXirGk7awxEDwydn2R24ZBfAv4HNzCaPxdZDR5jPuBK3Y2Sz9Z7zxOLkgCA/dFSI/VC EiaB0QwENlBXLbDTWm+FBJKFkgyLBaaelM7rRmgWagtEkB6QDH4aDB2BeQn46Fwrx5thDVEjHzS fyE7pWZD/eVoSgnClKMYjtwFSECf860vmV3a0SYw2OQWjdtR6GDu3H9s05ASNdUyHuSY4YiLG9n JVpnETaTHpb9lSDi3vb0asDKaLIcBMaBkG4dWOWsNqs5Z91/qSP1KRMVbnpNI91WMeQ2as7u3Cd m8zJYNga6cC9JfwhC+54Q4ijTmVTGa6tqyxkNqWlsEm7M5jjCpIRR07fAODaqKv3MIgXA//89QS iCwpz0h208VuntqHpkRusRFTEDihMX9aqBRpvGkYLphyCcDXTK5bT1bOhByWDi4UnlmkZGRK8C5 Ciga46g5hgKGVQM1Nkkit1mjBI1xoc0CaHoC4+KXTbzTIormwWsZBSPMKWcYUwOzlpENKo0Z34/ nBWlmLjGY27IFaA== 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. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- drivers/base/devres.c | 21 +++++++++++++++++++++ include/linux/device/devres.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index ff55e1bcfa30057849a352c577bd32f1aa196532..c948c88d395607ff511ffa6eb0a= 75b7847ab9239 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -1117,6 +1117,27 @@ void *devm_kmemdup(struct device *dev, const void *s= rc, size_t len, gfp_t gfp) } EXPORT_SYMBOL_GPL(devm_kmemdup); =20 +/** + * devm_kmemdup_const - conditionally duplicate and manage a region of mem= ory + * + * @dev: Device this memory belongs to + * @src: memory region to duplicate + * @len: memory region length, + * @gfp: GFP mask to use + * + * Return: source address if it is in .rodata or the return value of kmemd= up() + * to which the function falls back otherwise. + */ +const void * +devm_kmemdup_const(struct device *dev, const void *src, size_t len, gfp_t = gfp) +{ + if (is_kernel_rodata((unsigned long)src)) + return src; + + return devm_kmemdup(dev, src, len, gfp); +} +EXPORT_SYMBOL_GPL(devm_kmemdup_const); + struct pages_devres { unsigned long addr; unsigned int order; diff --git a/include/linux/device/devres.h b/include/linux/device/devres.h index ae696d10faff4468a41f37b5d5fd679d4ff11997..8c5f57e0d613492fd0b2ec97dd3= 84181608192fc 100644 --- a/include/linux/device/devres.h +++ b/include/linux/device/devres.h @@ -80,6 +80,8 @@ void devm_kfree(struct device *dev, const void *p); =20 void * __realloc_size(3) devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp); +const void * +devm_kmemdup_const(struct device *dev, const void *src, size_t len, gfp_t = gfp); static inline void *devm_kmemdup_array(struct device *dev, const void *src, size_t n, size_t size, gfp_t flags) { --=20 2.48.1 From nobody Sat Oct 4 22:34:47 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 23B7E2E3B1B for ; Tue, 12 Aug 2025 08:27:17 +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=1754987239; cv=none; b=gpVYufFSGzhNa0bFAjr3J+jelLiLGO9XNf/hlNidIoR6a93ive2B7aYUhWHno/zRSAJWlrV0bbhLXfJR1q7f4zYuAd0squHlIA63aGL3JeRfW9dROPazSF3FSgbeUA9KZQ0Ns8wMc71Yf21ZICUiSjpEVCNxIQzskZRX37+ua3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987239; c=relaxed/simple; bh=WIEQvxtdRthB6856r4HUV03c0VDMli/mjsj8od8S8wU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hGT5Q0exTTg3UrIdLKQMSEF9Jg4lcifa0mcB0Bf3l43BORaC0gKt98O9h/s7Q05vS6XKcVfXF1GYlduyM+4u7G/GUqpEPVLAadLw22U7tbPUrj0TS3fGdoZC0ZRskMLfmghzZe5bOSAmD/98EEVpORFlFjbBX1wOgVhUH7XCpFo= 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=bILc/LdG; 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="bILc/LdG" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-451d41e1ad1so35370495e9.1 for ; Tue, 12 Aug 2025 01:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987235; x=1755592035; 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=bILc/LdGOQDWNzXHeGy5Tp86XoDvWDgjb3dgX/FBXLaKBZDQFYeOyDPESCDSQ5zSKj p1Fx3cNEQXsZA6ikjj859NnmPwrnHsYYXDP5Hy+IYMclgPiPSowZD6cDS+GwGdHkbp0v rGj9iZ7GFzqQhuYTjraIDhpdWmNP6VakjKifu6lh4UGeHdaMNIc8qyneIAHjKlTrMlLF xhbY2iogu3dmFRcPhmBUQ+SIlMYEov3EQwl0WUsq5WlbZqJV76H3i04Yjl3OdJZ9w4V/ OwS7uN2H30uXpD7calkCD38wUSfWZUZLLxv2g1O9sutUPvhVehl4RXqCKAalLeL3NoW0 GwrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987235; x=1755592035; 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=Jed9oaN5qIzSIdSsFEXO6o/5IJc5xG7mSH+bA5ooHnH6qHhgTLefrIcTd1RagfPM6S eOH2Wf+p88D+RZK0mFZn8nx9w8ZT9oa1ZwdG8fsT8coUn2qmSAJZR1xlBw4pM3C2s6EN N35Z52KIiG6fKv6lCy98qlpS48NP9hWeJ3VC2HEScoL+MeYahbwJIEtdcu3nJPa1rxIv EKkSZbgaE7lo1pPig/JtmwskmPEJexnxpd48kuSpPMd9FrmzwO5Xo1XPlyzWDdXIQ+f8 NkyqwB2w1BkOShY+R8CDrcAwZEH8xczoTMvtecXab9lJJAyXNaRNlSREzs9Pq4n/BkuE 5ioQ== X-Forwarded-Encrypted: i=1; AJvYcCXH9XUxaI2AsVmFBCI2GiIE4ntLHcJdkhKIKgEljD6Z2EEOdGpdV29obw1EEZkUfHrvUU8ruQrcQz5fgD8=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8twNr6Ql2E3Lv09Ey9BWCmhRBXKPiEn4lUN7qhPVuLs6+LVgr WfCmFZDN5C8bLapo2mdmMXP3+tyVVTO/fC95ZziZyVS2i8aCIFWLwObmi7a9iAVio0I= X-Gm-Gg: ASbGnctTBvKGsK1cAwveI+Kb254jBWCISnHsMWdAsvWjplH+nZy2kM533wxs2v0/1nZ tT5VUa1ECvju4GI3kRSoOKJEY4oY/CXioGKHpDsBHqG4nZPkqzhpaXLN1sayL7T4kQd6UplW20/ Cg65NOWyEaQzniab9RR1LVel6k1FgLlo2cuxnKP795au3aQi4atVztqUFdmsQQhoIjq61K7mBJ9 k3+G6cB3O1nctRP6Mhu+DJtCBhDNPUfZjWEH3vWhCnPGuMTzTwYK+xYkm2T6Oina0cixgQX6yRA 4fRuVe/r7Dht3xA/HcwyT/v29mOMa3U2SEDVl22H9+NcSIZr8DsupuK0L9bfjmendgJsgAEQ5lr WpTGL9khi24SCeu0= X-Google-Smtp-Source: AGHT+IG9LeN0OGOpXGyWbmm1lDOX65hlsrf90WSgSnAgOs0kyHwhrmmIpnE1O9UZJd/SZOy1ZHJldQ== X-Received: by 2002:a05:600c:3547:b0:453:78f:fa9f with SMTP id 5b1f17b1804b1-45a10ba7e5cmr21860695e9.11.1754987231433; Tue, 12 Aug 2025 01:27:11 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:11 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:01 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-2-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=8989; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=ngwvMKiL7WjeArNFSdBs/AB2ylnC/fm8iV0Ni8uhrlY=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrXKwBoZmvE6IqRK/h3ZfdqdJFQZiTnlv70d 0TzN5CgzNGJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr61wAKCRARpy6gFHHX coBFD/4wcnUgTwHXpY/uuZYNyiUo9QpRYkwTT4+3smLqrIAfe1q/XXvhhAoQ+/aQw+BwPHC1Pqe URolaN2+0ZqnzObnyMNpniI2IC7VUPkk5J11eX3f/S6mok7czKVmR/i1jreEGRdVkM1yUf/yDt/ I6Z7CQQa6xH+FdNkk64zWxkgSoAnEYO19mpzTsgmUHqLdEG0ut8b6vBARWjxewlFBF4GnnRx4RY mhR0eA8lvQwMEuBZqJDoKgZzAStqpzxWMGfn0e05earrNGZfsqHNhH60bvz+F8vaic4acPFlecE 4228aQB6xOgjKHtnVdTlKwPqLHFT3+cfo3+TDOCcuyEGcxyAn8z70GU45gECugeUHjgrHp/O+8H p9EWkHp3hAuVIrF1hVIgr0QErgg95xVrK1q4GUTSYVfKYXlfsTHd8S02gKZukIoQpExm3vIeQ50 Al04mUPYQXZBQYHJBkblS18qmlIYbPq6/jrN7A5v1Ggs68G5Qi0oN5oRUf6uQJ0x1z//D2mqpGc WYFyPYKktKiMPzV+5AXpocoXbab16ifpTUFPIHL4xf0b8ALn/+2C0lSO529yQXpQvEuRwUH85i1 y45Arf0XetU0vF5mGd2ZIK0Gvqy94EI2JkmCXh0hBxf7NQSuohuFh8zkJpLykAW66Xt9MNem4kn 6qeKfVolA8iijvw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct function_desc is a wrapper around struct pinfunction with an additional void *data pointer. This driver doesn't use the data pointer. We're also working towards reducing the usage of struct function_desc in pinctrl drivers - they should only be created by pinmux core and accessed by drivers using pinmux_generic_get_function(). Replace the struct function_desc objects in this driver with smaller struct pinfunction instances. Acked-by: Paul Cercueil Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinctrl-ingenic.c | 45 +++++++++++++++++------------------= ---- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index 2900513467fa4e2e9374946fc9c7a30d48aef9eb..af9d2f3081859bc4b22f6820f3b= 3753eba36f959 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -96,11 +96,8 @@ .data =3D (void *)func, \ } =20 -#define INGENIC_PIN_FUNCTION(_name_, id) \ - { \ - .func =3D PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_group= s)), \ - .data =3D NULL, \ - } +#define INGENIC_PIN_FUNCTION(_name_, id) \ + PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)) =20 enum jz_version { ID_JZ4730, @@ -128,7 +125,7 @@ struct ingenic_chip_info { const struct group_desc *groups; unsigned int num_groups; =20 - const struct function_desc *functions; + const struct pinfunction *functions; unsigned int num_functions; =20 const u32 *pull_ups, *pull_downs; @@ -263,7 +260,7 @@ static const char *jz4730_pwm1_groups[] =3D { "pwm1", }; static const char *jz4730_mii_groups[] =3D { "mii", }; static const char *jz4730_i2s_groups[] =3D { "i2s-data", "i2s-master", "i2= s-slave", }; =20 -static const struct function_desc jz4730_functions[] =3D { +static const struct pinfunction jz4730_functions[] =3D { INGENIC_PIN_FUNCTION("mmc", jz4730_mmc), INGENIC_PIN_FUNCTION("uart0", jz4730_uart0), INGENIC_PIN_FUNCTION("uart1", jz4730_uart1), @@ -370,7 +367,7 @@ static const char *jz4740_pwm5_groups[] =3D { "pwm5", }; static const char *jz4740_pwm6_groups[] =3D { "pwm6", }; static const char *jz4740_pwm7_groups[] =3D { "pwm7", }; =20 -static const struct function_desc jz4740_functions[] =3D { +static const struct pinfunction jz4740_functions[] =3D { INGENIC_PIN_FUNCTION("mmc", jz4740_mmc), INGENIC_PIN_FUNCTION("uart0", jz4740_uart0), INGENIC_PIN_FUNCTION("uart1", jz4740_uart1), @@ -474,7 +471,7 @@ static const char *jz4725b_pwm3_groups[] =3D { "pwm3", = }; static const char *jz4725b_pwm4_groups[] =3D { "pwm4", }; static const char *jz4725b_pwm5_groups[] =3D { "pwm5", }; =20 -static const struct function_desc jz4725b_functions[] =3D { +static const struct pinfunction jz4725b_functions[] =3D { INGENIC_PIN_FUNCTION("mmc0", jz4725b_mmc0), INGENIC_PIN_FUNCTION("mmc1", jz4725b_mmc1), INGENIC_PIN_FUNCTION("uart", jz4725b_uart), @@ -606,7 +603,7 @@ static const char *jz4750_pwm3_groups[] =3D { "pwm3", }; static const char *jz4750_pwm4_groups[] =3D { "pwm4", }; static const char *jz4750_pwm5_groups[] =3D { "pwm5", }; =20 -static const struct function_desc jz4750_functions[] =3D { +static const struct pinfunction jz4750_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4750_uart0), INGENIC_PIN_FUNCTION("uart1", jz4750_uart1), INGENIC_PIN_FUNCTION("uart2", jz4750_uart2), @@ -771,7 +768,7 @@ static const char *jz4755_pwm3_groups[] =3D { "pwm3", }; static const char *jz4755_pwm4_groups[] =3D { "pwm4", }; static const char *jz4755_pwm5_groups[] =3D { "pwm5", }; =20 -static const struct function_desc jz4755_functions[] =3D { +static const struct pinfunction jz4755_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4755_uart0), INGENIC_PIN_FUNCTION("uart1", jz4755_uart1), INGENIC_PIN_FUNCTION("uart2", jz4755_uart2), @@ -1106,7 +1103,7 @@ static const char *jz4760_pwm6_groups[] =3D { "pwm6",= }; static const char *jz4760_pwm7_groups[] =3D { "pwm7", }; static const char *jz4760_otg_groups[] =3D { "otg-vbus", }; =20 -static const struct function_desc jz4760_functions[] =3D { +static const struct pinfunction jz4760_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4760_uart0), INGENIC_PIN_FUNCTION("uart1", jz4760_uart1), INGENIC_PIN_FUNCTION("uart2", jz4760_uart2), @@ -1444,7 +1441,7 @@ static const char *jz4770_pwm6_groups[] =3D { "pwm6",= }; static const char *jz4770_pwm7_groups[] =3D { "pwm7", }; static const char *jz4770_mac_groups[] =3D { "mac-rmii", "mac-mii", }; =20 -static const struct function_desc jz4770_functions[] =3D { +static const struct pinfunction jz4770_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4770_uart0), INGENIC_PIN_FUNCTION("uart1", jz4770_uart1), INGENIC_PIN_FUNCTION("uart2", jz4770_uart2), @@ -1723,7 +1720,7 @@ static const char *jz4775_mac_groups[] =3D { }; static const char *jz4775_otg_groups[] =3D { "otg-vbus", }; =20 -static const struct function_desc jz4775_functions[] =3D { +static const struct pinfunction jz4775_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4775_uart0), INGENIC_PIN_FUNCTION("uart1", jz4775_uart1), INGENIC_PIN_FUNCTION("uart2", jz4775_uart2), @@ -1976,7 +1973,7 @@ static const char *jz4780_dmic_groups[] =3D { "dmic",= }; static const char *jz4780_cim_groups[] =3D { "cim-data", }; static const char *jz4780_hdmi_ddc_groups[] =3D { "hdmi-ddc", }; =20 -static const struct function_desc jz4780_functions[] =3D { +static const struct pinfunction jz4780_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", jz4770_uart0), INGENIC_PIN_FUNCTION("uart1", jz4770_uart1), INGENIC_PIN_FUNCTION("uart2", jz4780_uart2), @@ -2211,7 +2208,7 @@ static const char *x1000_pwm3_groups[] =3D { "pwm3", = }; static const char *x1000_pwm4_groups[] =3D { "pwm4", }; static const char *x1000_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x1000_functions[] =3D { +static const struct pinfunction x1000_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1000_uart0), INGENIC_PIN_FUNCTION("uart1", x1000_uart1), INGENIC_PIN_FUNCTION("uart2", x1000_uart2), @@ -2341,7 +2338,7 @@ static const char *x1500_pwm2_groups[] =3D { "pwm2", = }; static const char *x1500_pwm3_groups[] =3D { "pwm3", }; static const char *x1500_pwm4_groups[] =3D { "pwm4", }; =20 -static const struct function_desc x1500_functions[] =3D { +static const struct pinfunction x1500_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1500_uart0), INGENIC_PIN_FUNCTION("uart1", x1500_uart1), INGENIC_PIN_FUNCTION("uart2", x1500_uart2), @@ -2562,7 +2559,7 @@ static const char * const x1600_pwm7_groups[] =3D { "= pwm7-b10", "pwm7-b21", }; =20 static const char * const x1600_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x1600_functions[] =3D { +static const struct pinfunction x1600_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1600_uart0), INGENIC_PIN_FUNCTION("uart1", x1600_uart1), INGENIC_PIN_FUNCTION("uart2", x1600_uart2), @@ -2779,7 +2776,7 @@ static const char *x1830_pwm6_groups[] =3D { "pwm6-c-= 17", "pwm6-c-27", }; static const char *x1830_pwm7_groups[] =3D { "pwm7-c-18", "pwm7-c-28", }; static const char *x1830_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x1830_functions[] =3D { +static const struct pinfunction x1830_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x1830_uart0), INGENIC_PIN_FUNCTION("uart1", x1830_uart1), INGENIC_PIN_FUNCTION("sfc", x1830_sfc), @@ -3225,7 +3222,7 @@ static const char *x2000_mac0_groups[] =3D { "mac0-rm= ii", "mac0-rgmii", }; static const char *x2000_mac1_groups[] =3D { "mac1-rmii", "mac1-rgmii", }; static const char *x2000_otg_groups[] =3D { "otg-vbus", }; =20 -static const struct function_desc x2000_functions[] =3D { +static const struct pinfunction x2000_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x2000_uart0), INGENIC_PIN_FUNCTION("uart1", x2000_uart1), INGENIC_PIN_FUNCTION("uart2", x2000_uart2), @@ -3449,7 +3446,7 @@ static const struct group_desc x2100_groups[] =3D { =20 static const char *x2100_mac_groups[] =3D { "mac", }; =20 -static const struct function_desc x2100_functions[] =3D { +static const struct pinfunction x2100_functions[] =3D { INGENIC_PIN_FUNCTION("uart0", x2000_uart0), INGENIC_PIN_FUNCTION("uart1", x2000_uart1), INGENIC_PIN_FUNCTION("uart2", x2000_uart2), @@ -4571,11 +4568,9 @@ static int __init ingenic_pinctrl_probe(struct platf= orm_device *pdev) } =20 for (i =3D 0; i < chip_info->num_functions; i++) { - const struct function_desc *function =3D &chip_info->functions[i]; - const struct pinfunction *func =3D &function->func; + const struct pinfunction *func =3D &chip_info->functions[i]; =20 - err =3D pinmux_generic_add_pinfunction(jzpc->pctl, func, - function->data); + err =3D pinmux_generic_add_pinfunction(jzpc->pctl, func, NULL); if (err < 0) { dev_err(dev, "Failed to register function %s\n", func->name); return err; --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 497072E2DE2 for ; Tue, 12 Aug 2025 08:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987237; cv=none; b=PQtaRSbYFjSHOGTiv4rl98W9qGweCM+YEGvpGYTC0liGk0lopYfDcnf6D5y+0g+eS5uqJTQvHogWlDoB7Lz9j56RsLm5+QuBtpWB40IsJMyNqFkA6U6qys/XZcz65gbkQrDCgo8baegTMkcY7v0ATfa5A47gyCkGUehwMyhVwfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987237; c=relaxed/simple; bh=OvaIv/8oZ/GDP7Kwgfe/BrZhUlXBkWHg/MZtBgoNz40=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QFGyLN/H9o55o55iKQbNS4DT5Q+AXzdZhma4y/IvB0I5W8yHbAq5DY6Ac1ZUC/Ft5lnuL30FQ4crg+pbAfIKx4fvoY33E0o2NnTFbQ2ZLo5nv1C9muCSQRLTtm9q6TwuaNaoH7cpY0EW2APcRPW0Ygrmn/t8wvSN1M7vIVh2zWo= 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=JvHwgbIp; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="JvHwgbIp" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3b7892609a5so2994610f8f.1 for ; Tue, 12 Aug 2025 01:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987233; x=1755592033; 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=DLMz5dhvl1HJGifQ8hfDJvvXhldeSDOtxBP6N+/lIpI=; b=JvHwgbIpX5iK8o31mtYhG9SevDLmtJqlPt0xEoSa75hXFcIklRk+cZzomfBmOhb1PP ILytaJrut1SfBzx4MXT9Bpof/rOb+QQwDCMGL1obkiRExXkrcuz9PCKnYrK2HQhrI9mH KPlOFJlO0r2e7UVVYdb9yRa/wx1WP7t+SumAi4nbwot3kNWu0lRniVKF/wPhZRc+KFg8 GTF2nKKG0ZKailWU+5rVzOopmx84ATUbkbYYLFXVCsujTBa77JSYO6RNhPzfeaUGEtL/ dL/NkjTWfEaiNaZxiBbL/Sa8DFPGRe3TEpjD++uCoKuXekV3wnDkjvSeubtWr3juaKR+ Evww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987233; x=1755592033; 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=DLMz5dhvl1HJGifQ8hfDJvvXhldeSDOtxBP6N+/lIpI=; b=cSywSYe0jIYfNovkpEj/JKaaVr2RwxFLBVD+s7v5RCQKRhF8XsaaWUyzT6UKjDscdb +msxWDFR999v3Ar8LZbVnW43U2tFmYzNzWKzWZBJ9437pn/aR2EXNpg28dB8KjJkftNA WPXgz5aIjqMW1O6gqFjE3ltkJPmwC8cfRAmVjCOA3jSzr25CQPxzazCpEn+ndo/X8aB+ T1tVD6ASyjZSEEM5ITcwAuol+Kt9/SospCVrCfFZBLVrp8p0I+yFTtPYQMm5JsgK40uA yVS0AKTxY89iSO1BfpeIvNciouJBW6xMZnHAg3Ycq0x12APG9mrowusMvhPeUqAxlL/+ xadQ== X-Forwarded-Encrypted: i=1; AJvYcCV/w2MhY8LffRjX6KjCDvjBUnXSlilz5BgoGslDmxh9lWCHIOxzdmjBTtrklsPe+Ny7CTlVhrrOd9x1bWc=@vger.kernel.org X-Gm-Message-State: AOJu0YyBi5bLP2rbalEwVezQ+GqBRI2EbOmgT8MA1WVfa9oAUPP+0nWf Kj9w3H5FEor9018PW0+R/XIsGVi0Tj41dQBkL1xmZrk+lvLDntVo0K4ZW89bMJZLJ1g= X-Gm-Gg: ASbGncvGZtY9ArqqeMd4lseNDDF2iQvWNgaYZALxACh/74vQk5kYpVDkDA8n0nRwW+U 28N+oXQq7ivJBoKEcNKTRbO3aomp6zOR9LBEdH+CfvUywA5YLJN7Ip8pBffVXhxuRNKJuVX1ijx 3Ap+qKgfxNws9QHqD4eQTBxBz1nZXLavox8jaZuT9VaKRTyeRTwDkkCf28visLaZIlmg+eNxwmq Lsfz95usbG5gBUaq6pJzAYQ2r6b1Vcpd5e3XUswNnWPdUeR4N0WiKOc/LRX5k3ruERxAPrTy4ct K5yk3TJiriREul/9jwhzl8z7PltB+zCIdmnQuUoPI5PrnxI/IBy2uxsuTXNBWHwDbUmtumME7KE Q5dZ1fnlV1m/Gg0I= X-Google-Smtp-Source: AGHT+IHxf1Gheje5mkFJXNbYPspDezEy1ZvwMcDlFzSmLC9pvu7f4uHAGhCZoZHeWbKRH8nD1ty+QA== X-Received: by 2002:a05:6000:22c2:b0:3b8:d893:5230 with SMTP id ffacd0b85a97d-3b91100ef7amr2091026f8f.47.1754987233320; Tue, 12 Aug 2025 01:27:13 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:12 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:02 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-3-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2037; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=8m+uO2wFoz45np2OTah2daZeJ2sZYqJ85l0WVEHKDas=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrX9RRoKDbA/ltwtuJ4EyG2WO60DQb8Pb1vS coNAXS4U0iJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr61wAKCRARpy6gFHHX cg6XEAC8rNYcNrLRmViE7ypL62cxemJNiwcylZUk/EbB2LmSFdtxh5OdHOiPKfnWYC2WoqdsLeE dH7HsjwJepgfYk1itBu8siO7U3geQZasJ159uTbiAa9YW6PHmUFNLgxnltfj37gLl6FVIOgFscW mUASI9HQ5leJNQixSLwfniGqS39RegE+Z7Bf85pFZsDV6WOJINocubMK3rhzQecaeIKy+/YhWa6 VuPszRdtOp16D8969UfaKprxgn5khsdU635KHvTI+cvzk9e+6La7xoXXGoRhTc0TBKf+Ig+hm07 GPeEeW9mi+drhU3gfbjLHSY0SmdXerDgW9+3wPuV/BgVkVxDtYFYA2jznaWzg/wpFE/WUB8XKi4 G2aLL8E+K2i512j9KQKBZU6YA6neVMBqab2iwlDJAK+IxaTqeDUx6e+X1cVnsbHv3rrnRLaWCwq eLi0qlNEU72l4DXrBAj+KdwVRQlEJ6WOTi+9VzcGlzb1VXu9bSzPS3A9H8hLGs9CZ9dDFjroEPF yOavvyND8j+CsN0tdDP9o0bTzuzZFXnJRJJgGXE7W27j9qIsrdDcyec13EvXbDNpFueJ6ERKv40 g6XWI9ymS8TjdvJf5M6VlxYn8IqVcpF7TYMtLPDn5GPcl+DJqqJAcSFzv6pevX+qiAnP94PLErN ARW881PRppyAVwg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct function_desc is a wrapper around struct pinfunction with an additional void *data pointer. This driver doesn't use the data pointer. We're also working towards reducing the usage of struct function_desc in pinctrl drivers - they should only be created by pinmux core and accessed by drivers using pinmux_generic_get_function(). Replace the struct function_desc objects in this driver with smaller struct pinfunction instances. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/mediatek/pinctrl-airoha.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/me= diatek/pinctrl-airoha.c index 5f1ec9e0de213d587b68f41d3458cf504ee1b21f..51cd0cdc2f5170d024fe984ce88= 82ed9b3ce6563 100644 --- a/drivers/pinctrl/mediatek/pinctrl-airoha.c +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c @@ -36,11 +36,9 @@ #define PINCTRL_FUNC_DESC(id) \ { \ .desc =3D { \ - .func =3D { \ - .name =3D #id, \ - .groups =3D id##_groups, \ - .ngroups =3D ARRAY_SIZE(id##_groups), \ - } \ + .name =3D #id, \ + .groups =3D id##_groups, \ + .ngroups =3D ARRAY_SIZE(id##_groups), \ }, \ .groups =3D id##_func_group, \ .group_size =3D ARRAY_SIZE(id##_func_group), \ @@ -334,7 +332,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 +2906,11 @@ static int airoha_pinctrl_probe(struct platform_dev= ice *pdev) =20 func =3D &airoha_pinctrl_funcs[i]; err =3D pinmux_generic_add_pinfunction(pinctrl->ctrl, - &func->desc.func, + &func->desc, (void *)func); if (err < 0) { dev_err(dev, "Failed to register function %s\n", - func->desc.func.name); + func->desc.name); return err; } } --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24C842E4241 for ; Tue, 12 Aug 2025 08:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987239; cv=none; b=W6c6TG0UR3vsZtQeqOmz2r7rMRR6EeaZU2FVGz6GjougROLBZeaihk7EsPf/4ZAAG+THJV1fkAbILCxtaml2c2DmAIgjar5K8zy86IhIVTtYLa1rY9u7d8E5hhEvdP8eTL0PSpF3O+5VR2KX+AzKuMusyL4JDBDYYM9NRQsaMjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987239; c=relaxed/simple; bh=XLM+AKGhm/JPaIWRpDkOq+A/wAVorXQ6mpQytd/t0+4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZH25Zwja2lGLxWlOLThuzsG+XHqOlb0B/uIlYw3McSMXLj6Cw0g4t425/f6qkxRx8Q7Yae029wS8es8RIWpmup8jdIh01AY3lxsuOyXmQ2BTVZDyqSDj7EVDz/9bVHRWYDGi2qTBb29j62GWyRqz+4M8bhglcJ0eUYvnLzNSoSQ= 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=fbWEbAWr; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="fbWEbAWr" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-459d62184c9so30570835e9.1 for ; Tue, 12 Aug 2025 01:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987235; x=1755592035; 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=46QW0ZKTJsCdAnI774T47O1RlPj5t6dUczWWbfa0X0I=; b=fbWEbAWrAQ6jaTAeRietF5gFUOgaEGG8dDuej+ks9/HnFx8uo7QCU43h2JL7ovn1MO uSL8VDGxQ0cE4K/glLL55Al4zWhqU/4rdotvauebrX3KvbJKrxupnF9pM3s22ZrJ0mgn rrqOu6j164VW7182itYwlw8OVx2TQJdxexYbFADIk3cN8Bp2Im4MSXPCoeNP9mf2rzUo UU7hhWzBTHp+qB2GiRg55TNNdfz/fZ20j+gY6ujLiMtmFm6gm42Pt13c4ZyLpIa1jvKt EzQ+LygcCoU0nPdsiUcgvMeZHGbNmKktrySxutPSMULyu/+2gnBKM2EVC13/g3so4GGI EMdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987235; x=1755592035; 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=46QW0ZKTJsCdAnI774T47O1RlPj5t6dUczWWbfa0X0I=; b=vN8OGx7XkO5hUkPHfFd3B/LBUUz5XjYO+XyVR33lX/m3miw4l7h2cBGbNT8xix5F8v 1dvQDYEU+iLznm7FV3AbCtiml13TOpg3pbl03y+idnx61oSVmqS6riwURlta5GF3el8A M1Z6448NGy0iDtKz6uuxigbJA9gm0Sjx22cod6/4+DJ2y467VgDWl+RuLZmjv8Slxqms wxk6WcQTaZ/Dg4Ccyk7FiNLzkviN8GBAz95aGl9fa9SPsGzaID284rgQmLJAYQDASPqU Y2X3RnlusnJSw0yX6XxpesvqyqXhEJWUekrXbbRT3bB7r90DRjmIq8cT6KYRR2nQviL9 ImWw== X-Forwarded-Encrypted: i=1; AJvYcCXawplQRg+30YWsLrc87aenyyjdd4m3NRHX7Ox9NwbAgwC3jrh9kAb19VKUf5G8jzxeY/6BsX6Jj/65NbI=@vger.kernel.org X-Gm-Message-State: AOJu0YxvcHRUoBOvw1/C/XunzE+i+p7Zz5EwZ4HO6VcjWeXUQ/tZkFl2 fVbcgSy/qlMSIOjv0lSWboebuU2xFAErblUvBj0bx7WEF/m0P7VGNJf7ro4C1TUKk0c= X-Gm-Gg: ASbGncvFJDux9Q+6nYXu/gh2udLr+asktXd44j9e44toXDpTm7I/Mh2zS+F5Ry/kBGJ PRCvbcCBFXpxAvcDDWLfHbqFx462rYyJ6yjd/sc9aNme+jJ3J0R02CEwWFRGT8ojLy33nSleUaV e1FKWwG3KhofzHLihRRbQGRfQOt7N/YHDs3vSw8s6zD9/G3AqHXhdgeQeoq21D2z6jz/ddXUbAf UBYUjKlgi+VUQOal/C2DSH6crkQ1yNCRgMosxQpHne/MLdTWiS8TDarYVUsfWteQLjeoqCdf3IQ eTzqEnhzxnCMk+XiILrOdh25QOu4rnGnnRCCExxtHjJ/iUjin5kpjssEdL/7J7fO5fLZ4bPsbok q9lipcHjwty8k8to= X-Google-Smtp-Source: AGHT+IFdKvznDMFZVInYZwwYDHVNkoHUkpPZeGPe2WfSJ5pngAh+BKH1PEfINHP8AliGuYpxgpRk9w== X-Received: by 2002:a05:600c:3d92:b0:459:db80:c29f with SMTP id 5b1f17b1804b1-45a10b9f437mr17532975e9.1.1754987235079; Tue, 12 Aug 2025 01:27:15 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:14 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:03 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-4-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2873; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=nunH5KiVSLA9eNaj6eipx8y2OBwu+tjBhQLeBJL1rQM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrXGC6Gq0nJRiXqaR76dk7/R12B6PvbWm35x aNzc3XzxtKJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr61wAKCRARpy6gFHHX cvhtEADdNx7DArN5koidQnVfF+xi0aUHcfFGOuW8vpax22Hyr2Scf/VG3fJlaP4c5NFyv03lfv2 m5QXrrhpqBJRNJre3AS3sTt+5DFtU2x3XQe4g0YTzwVUXtZaMXzozSdl7dUdVAaS3d5bkfVQSoN bZqJ8Xn6GewglMBvisZh/eR7hVh7fsiDLRSGwzB0txJXy915USWDYvKaZAzaJrUNqH2DJPDkIdt hJvpe1DRASLLubOKWqhS6RZYdoLI1vMKaOeXRLJ+uJHwgaGX7acED/nxlYxNTFvJh1rEv+cvg96 D09YaOGaUsK3oJcDeWsShWamJbDXg76mz6PFaFOU9pXnO0gGch+wg+Ni4hrDfSOyPHmUTYxSJ5o rozzU6iNpaTtSsIbtXjcLDebrclN7xi088hZzvuiBccesTXa1rV37gq6lyqvvTWtHmk3qroaTio GTxkp49IaL5d++Z5Cid2pYg6PSQqidLMXqc3eMw/M/lw0tU6769CLGAOIPfmZw8pIQ1aVBEjPiW Wh30mUS3iHzRTUZ95x6mwyTgZDpBUKbP3wvI7XwSj2P28ThwZkNHX3iwas386F1Be10JolQ3pZw LWKA8cisHe32kL2K0hNad7VOpO51ebJNo5q6uC+jebFgDQrWSmRdS1nalBHRZbyorG+GSy2cb8G M4bBijT2vNehGvA== 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. Signed-off-by: Bartosz Golaszewski Reviewed-by: Chen-Yu Tsai --- drivers/pinctrl/mediatek/pinctrl-mt7988.c | 42 ++++++++++++---------------= ---- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7988.c b/drivers/pinctrl/me= diatek/pinctrl-mt7988.c index 68b4097792b88356babe4368db7d0f60194e7309..55c8674d8d66f12d2f2246c2150= 56d4e51296a9b 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7988.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7988.c @@ -1465,32 +1465,22 @@ static const char * const mt7988_usb_groups[] =3D { }; =20 static const struct function_desc mt7988_functions[] =3D { - { { "audio", mt7988_audio_groups, ARRAY_SIZE(mt7988_audio_groups) }, - NULL }, - { { "jtag", mt7988_jtag_groups, ARRAY_SIZE(mt7988_jtag_groups) }, - NULL }, - { { "int_usxgmii", mt7988_int_usxgmii_groups, - ARRAY_SIZE(mt7988_int_usxgmii_groups) }, - NULL }, - { { "pwm", mt7988_pwm_groups, ARRAY_SIZE(mt7988_pwm_groups) }, NULL }, - { { "dfd", mt7988_dfd_groups, ARRAY_SIZE(mt7988_dfd_groups) }, NULL }, - { { "i2c", mt7988_i2c_groups, ARRAY_SIZE(mt7988_i2c_groups) }, NULL }, - { { "eth", mt7988_ethernet_groups, ARRAY_SIZE(mt7988_ethernet_groups) }, - NULL }, - { { "pcie", mt7988_pcie_groups, ARRAY_SIZE(mt7988_pcie_groups) }, - NULL }, - { { "pmic", mt7988_pmic_groups, ARRAY_SIZE(mt7988_pmic_groups) }, - NULL }, - { { "watchdog", mt7988_wdt_groups, ARRAY_SIZE(mt7988_wdt_groups) }, - NULL }, - { { "spi", mt7988_spi_groups, ARRAY_SIZE(mt7988_spi_groups) }, NULL }, - { { "flash", mt7988_flash_groups, ARRAY_SIZE(mt7988_flash_groups) }, - NULL }, - { { "uart", mt7988_uart_groups, ARRAY_SIZE(mt7988_uart_groups) }, - NULL }, - { { "udi", mt7988_udi_groups, ARRAY_SIZE(mt7988_udi_groups) }, NULL }, - { { "usb", mt7988_usb_groups, ARRAY_SIZE(mt7988_usb_groups) }, NULL }, - { { "led", mt7988_led_groups, ARRAY_SIZE(mt7988_led_groups) }, NULL }, + PINCTRL_PIN_FUNCTION("audio", mt7988_audio), + PINCTRL_PIN_FUNCTION("jtag", mt7988_jtag), + PINCTRL_PIN_FUNCTION("int_usxgmii", mt7988_int_usxgmii), + PINCTRL_PIN_FUNCTION("pwm", mt7988_pwm), + PINCTRL_PIN_FUNCTION("dfd", mt7988_dfd), + PINCTRL_PIN_FUNCTION("i2c", mt7988_i2c), + PINCTRL_PIN_FUNCTION("eth", mt7988_ethernet), + PINCTRL_PIN_FUNCTION("pcie", mt7988_pcie), + PINCTRL_PIN_FUNCTION("pmic", mt7988_pmic), + PINCTRL_PIN_FUNCTION("watchdog", mt7988_wdt), + PINCTRL_PIN_FUNCTION("spi", mt7988_spi), + PINCTRL_PIN_FUNCTION("flash", mt7988_flash), + PINCTRL_PIN_FUNCTION("uart", mt7988_uart), + PINCTRL_PIN_FUNCTION("udi", mt7988_udi), + PINCTRL_PIN_FUNCTION("usb", mt7988_usb), + PINCTRL_PIN_FUNCTION("led", mt7988_led), }; =20 static const struct mtk_eint_hw mt7988_eint_hw =3D { --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.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 CA4CD2E5433 for ; Tue, 12 Aug 2025 08:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987242; cv=none; b=ZMFvedNblbZMcRltEDF/BDXK7u2WO80J+n8XkHJ7/hv8EbQHnsLyPiYK+LxJoKdDs0XmdtQpYfjvSdTtVasJze/wC4d6EN/ddEj4xfPi8nJ/aWd5N2AYJzk+2lOX4d/HZuyw32O6vJBDe7TBczoPA3RGgp2U+G9BSFlzZglcppw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987242; c=relaxed/simple; bh=uHw1RHh99DzN3gt+21+XixzbhVlGc71uNmong/5Mt7Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=avGh5+34NuQHNV75pqGT45jLpOo73q01aNgHfCq1JYM7bxJuRvZeq8fubKYxMWGnxyGAjgK4ToLClMjWxZMSDesGjVHUwXBY3J/DVjeOqTzB/1NL+kfdKVVVO552EKmgmSMMwzFI9nJxGxZZWd4m9FHdDanPZeNpLMVY70TTPYg= 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=N/U7eDjP; arc=none smtp.client-ip=209.85.221.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="N/U7eDjP" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3b792b0b829so5025606f8f.3 for ; Tue, 12 Aug 2025 01:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987237; x=1755592037; 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=UKgYZvZvQ5VjuvwnOZblLnAWdMLTkRzXbd38Wp8Pe9s=; b=N/U7eDjPSzHID1L+gw+2vu9u8VRRrJrmD8KKZHKLAlGJYQS5EkxK+R43Y8EeOj/khr TrRRPxsb4zHkVW1KKwInjfDq6J+We8vRccrJYbbY/6PJ7C2T2IqGUGGLkoaSv4fPqb6r +QlJloHn2w199G4+JTSM6lYJ1/iioi20MyTnQARtaD9vhtqEdfISD4Mw7MoEm1JGELFl WMpaKzhpbvH4dXZbqbipO33K+SUjgwZCC5+eeJyc3KTd99b6FpvpcspTZ04XzHFK7CWk f4AlzgHmYfZ1kSy2wFxF6a0dp1W2IwIH8piuQAr/MCApTkvSnYp8F5qWyX/wJ2TlmjwG C1nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987237; x=1755592037; 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=UKgYZvZvQ5VjuvwnOZblLnAWdMLTkRzXbd38Wp8Pe9s=; b=RCw9yqASiXZTa7bRFfw5mJKHBb/x46ssc/o08AqL4ECyfEhApOrV1p53nLfNLGdEfy Cj3o4VNg3vE74nVPh7JlhNurlt18z4B1u1PG+8uAUX83AF4/jNWogwx/FgUZetbuHELj AKP/3EFiazFaBe2rsLYteC7XU1J4H2sdPx9buW6ZhLu++WQ5rl+BWqykS1NWy5Knei1R 4/LSMg18BQR3MmHocjKyRuKxPRZ5RiMK7rbqVT7Qd94rZ/Zdw/nJRZZJAlr3J4pTmoXb k7m5UFijc5Nj1wHmZgCsw8CaGbicUypbJf99jPZ9GMowEDKVLR993/2HH5kNdPV2ZeEU U2Rw== X-Forwarded-Encrypted: i=1; AJvYcCWYLUgKgUyGb0MzWrCEBHC6cJ3eqJJGSuaS4MVg8nyP+wbCT4taIos2bX0Hf0emqcB0uhKFwLAGlOupE54=@vger.kernel.org X-Gm-Message-State: AOJu0YznAapF2mKlCsTvXwVb/3UixFH4IGEhi30/G9hmH8t2pWq7Fyqz o7Rrri/ayQeUKAywLoz8KT0B/nHZ29kJy218aZzqWEuQSwlFuiSRzAnr2pXwPDVJHn4= X-Gm-Gg: ASbGncuP2gLKnaMCcduPLV1dq7hEHUatfXutfathgC6W/ZVQNckmFPt4keGLrrKTVlh 4BK7FPRIsXOid2fMfuQrInD6GEkvh9wSbLXLiArbNaB/7WhTBoXzZco1bjdBA2Mm2kGjcRmdmx+ vHB1pdPWpTjWbyDxz+mJu77Rp8dWLs8DGFlv15Kr95OrONXLgwgGtWn6Ev9ZphlwACkHIat7Z5X 7ZJwTpVQqsCa4W2HmXKRRmPJUrMBl+noiwMU8/dzhdg/WoXLo8Oa8k+0N33n0ysks391gmemyyC OYXz+DjUuzpKm0l7pdoeej+405lUPyOkmQ5JvIHMoR9hUJjEGHwtiodKejScfSDUp3pwkGJxTf6 2k0tGxt685PMk7ks= X-Google-Smtp-Source: AGHT+IEZ/27jOsHs3m84L3TOqJK9jBTelhRpL1umym9DI5hpFyIiY1nmwpT2VmThicLJJSpID6H/vQ== X-Received: by 2002:a05:6000:402a:b0:3b7:8880:181a with SMTP id ffacd0b85a97d-3b900b4f015mr12160365f8f.13.1754987237105; Tue, 12 Aug 2025 01:27:17 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:16 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:04 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-5-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=7802; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=ABYLZWX8DVJpJC0vF17OH/X5Rl5vi7hFamob0mWFp0M=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrX81NUygmmMQnM3UT/GQSjySo3tsKuZ1OML 8rw0MIP3DKJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr61wAKCRARpy6gFHHX ckfMEAC27NWvs4YxoRUBYiQp15IQjffIiaUKgpmoxycB457LMx89AOYxTyl/aHw2Xmy37v9ASx8 aoiBEyvcw+TCowopcJGuWCH9VOE4Ds1ZtHbYe6mkK68cucW9dLjuco6VPnOWYNcqoel+yPZ4fWu G+thbWNJ6uuRpxZ0YrVZIVeNhi93DRWYMYtjMjuMqdyqXn4xZ40pvsLLMaqXwyyDOm83SVibeWL dFoz6DhTpo5F3+AF9PaDU5K32ZwyNrmIIR/2Hg1bY0nujcCa7TOEkl/Sf8RNVYiT7fPuEZ2Ue3H +q/UMpVOth91pR/SZM2pRVdPV5wUIa2UBNP94XlUjYkoTo3GrWz/tBQo+fvJMUFngUrwIGG2JYc BmaBqmOwWfHG2O0ptIliuv/t/LEo3dGeyoC9/0cDNsCS3N30ZV/bapJ8rbk775X+TE/uUweiKc5 W6D2mBjYa++R7s1FdginOMMlTA2cZNUJUsG34OYVQ+6bwPuoYU8A4SIbHU1mOd764asFzvc7945 brSDqLxNxlGjD20bKZY7aFVfmI7PtbagP28vMLKv+mNuz0yCJ5pIKNSwaYH+gqxldq/ARUpYJny lnxK94YR6GsGkly9C9kOcmDGZvbVtI27GhKVPEn7I6rdELD5ouAqdOiluGSTVN5yDTvJoOALn0s HAqR/ojR/FFN38Q== 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 Reviewed-by: Chen-Yu Tsai --- drivers/pinctrl/mediatek/pinctrl-moore.c | 6 ++---- drivers/pinctrl/mediatek/pinctrl-moore.h | 7 ++----- drivers/pinctrl/mediatek/pinctrl-mt7622.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7623.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7629.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7981.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7986.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7988.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h | 2 +- 9 files changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/med= iatek/pinctrl-moore.c index 6e4f6c07a509326a8a7e88b2dc32635b22e7b965..982b9887521d036538f67e9919d= e444693c458c0 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -622,11 +622,9 @@ static int mtk_build_functions(struct mtk_pinctrl *hw) int i, err; =20 for (i =3D 0; i < hw->soc->nfuncs ; i++) { - const struct function_desc *function =3D hw->soc->funcs + i; - const struct pinfunction *func =3D &function->func; + const struct pinfunction *func =3D hw->soc->funcs + i; =20 - err =3D pinmux_generic_add_pinfunction(hw->pctrl, func, - function->data); + err =3D pinmux_generic_add_pinfunction(hw->pctrl, func, NULL); if (err < 0) { dev_err(hw->dev, "Failed to register function %s\n", func->name); diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.h b/drivers/pinctrl/med= iatek/pinctrl-moore.h index 229d19561e229c77714e5fccb3d4fb68eacc77fd..fe1f087cacd0446e40628cb4fa3= 5a135496ca848 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.h +++ b/drivers/pinctrl/mediatek/pinctrl-moore.h @@ -43,11 +43,8 @@ .data =3D id##_funcs, \ } =20 -#define PINCTRL_PIN_FUNCTION(_name_, id) \ - { \ - .func =3D PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_group= s)), \ - .data =3D NULL, \ - } +#define PINCTRL_PIN_FUNCTION(_name_, id) \ + PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)) =20 int mtk_moore_pinctrl_probe(struct platform_device *pdev, const struct mtk_pin_soc *soc); diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7622.c b/drivers/pinctrl/me= diatek/pinctrl-mt7622.c index 2dc1019910662a2a52e81f277a10a32bd83b33d4..d5777889448aab86e82fa6821fd= ea0d30a5a7246 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7622.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7622.c @@ -822,7 +822,7 @@ static const char *mt7622_uart_groups[] =3D { "uart0_0_= tx_rx", "uart4_2_rts_cts",}; static const char *mt7622_wdt_groups[] =3D { "watchdog", }; =20 -static const struct function_desc mt7622_functions[] =3D { +static const struct pinfunction mt7622_functions[] =3D { PINCTRL_PIN_FUNCTION("antsel", mt7622_antsel), PINCTRL_PIN_FUNCTION("emmc", mt7622_emmc), PINCTRL_PIN_FUNCTION("eth", mt7622_ethernet), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7623.c b/drivers/pinctrl/me= diatek/pinctrl-mt7623.c index 3e59eada2825277b3d7500cb1f2cf740242a4a8b..69c06c2c0e21e4ce785f6553925= 4eb070bff9a0d 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7623.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7623.c @@ -1340,7 +1340,7 @@ static const char *mt7623_uart_groups[] =3D { "uart0_= 0_txd_rxd", "uart3_rts_cts", }; static const char *mt7623_wdt_groups[] =3D { "watchdog_0", "watchdog_1", }; =20 -static const struct function_desc mt7623_functions[] =3D { +static const struct pinfunction mt7623_functions[] =3D { PINCTRL_PIN_FUNCTION("audck", mt7623_aud_clk), PINCTRL_PIN_FUNCTION("disp", mt7623_disp_pwm), PINCTRL_PIN_FUNCTION("eth", mt7623_ethernet), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7629.c b/drivers/pinctrl/me= diatek/pinctrl-mt7629.c index 98142e8c98011d17339da74f61d6f917372dfcd5..cc0694881ac9dc536db0e46eefe= 5eb7359735a60 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7629.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7629.c @@ -384,7 +384,7 @@ static const char *mt7629_wdt_groups[] =3D { "watchdog"= , }; static const char *mt7629_wifi_groups[] =3D { "wf0_5g", "wf0_2g", }; static const char *mt7629_flash_groups[] =3D { "snfi", "spi_nor" }; =20 -static const struct function_desc mt7629_functions[] =3D { +static const struct pinfunction mt7629_functions[] =3D { PINCTRL_PIN_FUNCTION("eth", mt7629_ethernet), PINCTRL_PIN_FUNCTION("i2c", mt7629_i2c), PINCTRL_PIN_FUNCTION("led", mt7629_led), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7981.c b/drivers/pinctrl/me= diatek/pinctrl-mt7981.c index 83092be5b614cc164590fe5ec2b756fe6579b263..6216c2e057f6499b32741b6bd3a= 4854878c061c9 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7981.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7981.c @@ -977,7 +977,7 @@ static const char *mt7981_ethernet_groups[] =3D { "smi_= mdc_mdio", "gbe_ext_mdc_mdi "wf0_mode1", "wf0_mode3", "mt7531_int", }; static const char *mt7981_ant_groups[] =3D { "ant_sel", }; =20 -static const struct function_desc mt7981_functions[] =3D { +static const struct pinfunction mt7981_functions[] =3D { PINCTRL_PIN_FUNCTION("wa_aice", mt7981_wa_aice), PINCTRL_PIN_FUNCTION("dfd", mt7981_dfd), PINCTRL_PIN_FUNCTION("jtag", mt7981_jtag), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7986.c b/drivers/pinctrl/me= diatek/pinctrl-mt7986.c index 5816b5fdb7ca918486f57a890f73543b3198c728..2a762ade9c35505505c932b6fea= 75fa0cf77d961 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7986.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7986.c @@ -878,7 +878,7 @@ static const char *mt7986_uart_groups[] =3D { static const char *mt7986_wdt_groups[] =3D { "watchdog", }; static const char *mt7986_wf_groups[] =3D { "wf_2g", "wf_5g", "wf_dbdc", }; =20 -static const struct function_desc mt7986_functions[] =3D { +static const struct pinfunction mt7986_functions[] =3D { PINCTRL_PIN_FUNCTION("audio", mt7986_audio), PINCTRL_PIN_FUNCTION("emmc", mt7986_emmc), PINCTRL_PIN_FUNCTION("eth", mt7986_ethernet), diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7988.c b/drivers/pinctrl/me= diatek/pinctrl-mt7988.c index 55c8674d8d66f12d2f2246c215056d4e51296a9b..9569e8c0cec15fb6a4a8e359d64= 83fa163487b0c 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7988.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7988.c @@ -1464,7 +1464,7 @@ static const char * const mt7988_usb_groups[] =3D { "drv_vbus_p1", }; =20 -static const struct function_desc mt7988_functions[] =3D { +static const struct pinfunction mt7988_functions[] =3D { PINCTRL_PIN_FUNCTION("audio", mt7988_audio), PINCTRL_PIN_FUNCTION("jtag", mt7988_jtag), PINCTRL_PIN_FUNCTION("int_usxgmii", mt7988_int_usxgmii), diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h b/drivers/pin= ctrl/mediatek/pinctrl-mtk-common-v2.h index 36d2898037dd041ebc7e06526ebc085eb42f2828..fa7c0ed49346486ba32ec615aa2= b3483217f5077 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h @@ -238,7 +238,7 @@ struct mtk_pin_soc { unsigned int npins; const struct group_desc *grps; unsigned int ngrps; - const struct function_desc *funcs; + const struct pinfunction *funcs; unsigned int nfuncs; const struct mtk_eint_regs *eint_regs; const struct mtk_eint_hw *eint_hw; --=20 2.48.1 From nobody Sat Oct 4 22:34:47 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 98ECB2E54A9 for ; Tue, 12 Aug 2025 08:27:20 +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=1754987243; cv=none; b=jLFMYLLUdHMNUQMQ/lxlQLh8cuvEi4MX9sAJFQhMVBwWvbQ1LCBtkJ5RTI0PHjuJ+IpQKR/QEJxi0n6Ejz70KjAS1GAfR/G+HNMzovdnE5jkEvG78ce82iBE+jz29h2bi58ak+2l56ZQqN4aGoF+TDF33MQYCeXrBbaLX5o6NnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987243; c=relaxed/simple; bh=NN8N64azTZ6Tm9oD0O4UPA4GBXyAY9HuPJ1OulPwzrQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m8BrLutWhdY/xECPPsFFipxA9joEuSFcDFORWiS0wvbnyhj107xX7EOF5q4Uf/RAyZnq05mtW3EzRKtYGjmrt5DqLqB44sSVQ1pMlGzJysnvPJLUAc51BycSjIgZjXAfk6OKatyYgsdzuctABBaffhA93wuyvTqNRZRWfo2gnhI= 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=AT2zV9KZ; 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="AT2zV9KZ" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-459fdc391c6so24268195e9.3 for ; Tue, 12 Aug 2025 01:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987239; x=1755592039; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EnhxaXfLWBAe5wxXyN7EB4a4qBStRGqZ5wQqNK1Gqy0=; b=AT2zV9KZCcgY4lPNqwXBx1+GbuveznMIOkMdpvSx7z5IqnVdAfM9GYT1jzCmqI8AB4 2iyNCJ3DtGxeuxtEXBw3ELfi5GNne5UpESl5Vqyj3FTe4TsXX4wa4h+iba4ogXpbbHZZ tFd4V7iOhlBtVugF4Widtc1i7jEQr4mqHoISjPjfQZzfnXWTRTiPrR9n6RCyox/7P8oa RyIQ4TfIrbPWTQtujY2/39fLZVAmjMEh0e/KAr1pFMdLcD8cjiVED29q4C9aQxOxpt3f AzF3EjFletg0zwoxhbpXOgb1XOgsnkT0y1bBl30P+hrU1O4IyxOTtqFZHNgUI6OR1gDW /W1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987239; x=1755592039; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EnhxaXfLWBAe5wxXyN7EB4a4qBStRGqZ5wQqNK1Gqy0=; b=PEfickrDjPoKcFSo62W9ih8gnc9xKxzZ6qS6vNwsusKFo9Xp8zKHffkHDD9jYqQ9v6 hc1jFJyBEGwfLUFrmwr81mZDLxxeWOVOfWb/fhRIrgyA4VCBho6LQKE+WNGbSalxcehT prCTsSgoohUK7E1FtusZjsdpUJkQvtnB077dl++O3pw4p4ZEKZLlazKN4xdTrCTFF579 NdJpsnYwiRVenC4HohzmG3jkzxkKwobSzvyX2xavA2Yv963lVcDgYCTuzlvjpwdw0rmD Vjt7sLd8ujIjBjNCtF9oDn4diA8vs7/jhzMx00dowU49A7wPaX41QGxqWfCp1p9ziE6b ucGA== X-Forwarded-Encrypted: i=1; AJvYcCXp0qopb7WjGDuuNGDB/psnLiJyqYtKCW1re1H8zSWWcfttRjx/7aHVLM0IBzs2CKSl46DletWfWMn+4j8=@vger.kernel.org X-Gm-Message-State: AOJu0YxHzW4uZuucUf+wdjj3Z8K4/KpykVbGx6k7ydRYebyd7efVeZxT VGsR+4JxsruB5c0fyKgWkwbnj+Heu/q5oxWrkCLJgOFFVRItthqzDH7bctmFcl/KB38= X-Gm-Gg: ASbGncsv+jrgK68ZHivhoIWMMYi+HkTx/4hMLdK6F79hOQum0w2Dt4Z3zlSO0MMktJT dHOjUl5OgRVyZ20+vd6v0idZzlJNDBmQsMQxcM0kTRYDVXOxM/W773msFTrK6g4iCsVPMf/qW4P VMi3lRQw6xyTJMYfIlul0NXyK/spyASfzZqCX2D6RgkWV2Mh+7/NdWPjpWdyfW/LSatJwg9zPi+ ncvMkDyig1z+5BFaBByCXQzK934jf6L0bDajpnGe9oug4qTA5xdrIwAZDoh48/8LzAxQuAeOjLK Yo0Sh9JxapSguB2bBRN1jekreltBrQAzHMc4NkK+9TUnXpuejsmmwji0nT6s+yAdoHdKp0dkHUp z6yWl0gn8/G2VyJo= X-Google-Smtp-Source: AGHT+IHCxxphw0C1ysWW25fo60uK0xUciNoK6/brqWeyF0IqKEcM+9QCTW7mxqYhhnP5CYPiuHCuHA== X-Received: by 2002:a05:600c:4753:b0:43c:fc04:6d35 with SMTP id 5b1f17b1804b1-45a10b95677mr23101005e9.4.1754987238810; Tue, 12 Aug 2025 01:27:18 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:18 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:05 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-6-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3088; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=FuPiesxsrAA0Rn9DkOactcvX9/BHBoNthgyhyXGEhH0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrXvfSwc1aR/VkXuzCwVe/jTr/RkVSkQok9/ 6ZfT3vraKiJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr61wAKCRARpy6gFHHX crU/D/47WmiHhr1jD4X7MX23IkaKdqa8H3X1+A1yMibQlOZwva+m91uzbA5E1KqKisV1OFMTrwM qQw8JodqYSC7dGdkQzBqDTIPr8qzRWzoSvMRK4SEMSkWN6JmzLvQkjkT0QFqmMWrU29Eu7a0K1F Dajot6d2+kAVgD6I14MGW8cJyorpzlsoHipAlEw12RWTEeduUUSmBSgSdFriSRaQ59MJPBKp8hZ kVe4zp0J0g84ajKZ+DnhXBhaHIQym7fLJR57ngkJWPemTobyqxz2105/iqorzBrO2YC4Y2pX36z cuDpKjunZLGwb4w0loqgMygcLK/bV/U5ML167wppqGTE781xJw8gTclK0ECkF06V9mMriWr5qog w0Iiq+SbqD84+qFscPmKzsUrqqSX0Ih35IZdHkB2+uOuY9wKhFsFauO5KIiHmPkgPvd1VHClNqm ItFa/4pd+kPjurFIxcHWHYyEQ5xM2PYjHpH1qPVzaQNzL0f+rZPoifcD1zBil+ildZtDLwNHbLj 9bGuk4x45L/2ysZqyTqShL9pN8TnHn3mQrsZpHh+PUIe5e3hgaZi+P7oiTmtPmifDRFb/rJlKSM l7mYoB8Nx9U1KflhK7GPr2sCxhy436TecxSTqnjxs3nFe0iqlGJPyQMvKZURsDe/JEiBZVGu0+n KZOvfyXmKWunFeA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The radix tree containing pin function descriptors should not be accessed directly by drivers. There are dedicated functions for it. I suppose this driver does it so that the memory containing the function description is not duplicated but we're going to address that shortly so convert it to using generic pinctrl APIs. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/freescale/pinctrl-imx.c | 38 +++++++++++------------------= ---- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index 18de31328540458b7f7e8e2e539a39d61829deb9..d5d42c9ad5fe9dcf7c25ad39368= 8e714b02db678 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -580,33 +580,34 @@ static int imx_pinctrl_parse_functions(struct device_= node *np, u32 index) { struct pinctrl_dev *pctl =3D ipctl->pctl; - struct function_desc *func; + struct pinfunction *func; struct group_desc *grp; const char **group_names; + int ret; u32 i; =20 dev_dbg(pctl->dev, "parse function(%d): %pOFn\n", index, np); =20 - func =3D pinmux_generic_get_function(pctl, index); + func =3D devm_kzalloc(ipctl->dev, sizeof(*func), GFP_KERNEL); if (!func) - return -EINVAL; + return -ENOMEM; =20 /* Initialise function */ - func->func.name =3D np->name; - func->func.ngroups =3D of_get_child_count(np); - if (func->func.ngroups =3D=3D 0) { + func->name =3D np->name; + func->ngroups =3D of_get_child_count(np); + if (func->ngroups =3D=3D 0) { dev_info(ipctl->dev, "no groups defined in %pOF\n", np); return -EINVAL; } =20 - group_names =3D devm_kcalloc(ipctl->dev, func->func.ngroups, - sizeof(*func->func.groups), GFP_KERNEL); + group_names =3D devm_kcalloc(ipctl->dev, func->ngroups, + sizeof(*func->groups), GFP_KERNEL); if (!group_names) return -ENOMEM; i =3D 0; for_each_child_of_node_scoped(np, child) group_names[i++] =3D child->name; - func->func.groups =3D group_names; + func->groups =3D group_names; =20 i =3D 0; for_each_child_of_node_scoped(np, child) { @@ -614,10 +615,9 @@ static int imx_pinctrl_parse_functions(struct device_n= ode *np, if (!grp) return -ENOMEM; =20 - mutex_lock(&ipctl->mutex); - radix_tree_insert(&pctl->pin_group_tree, - ipctl->group_index++, grp); - mutex_unlock(&ipctl->mutex); + ret =3D pinmux_generic_add_pinfunction(pctl, func, NULL); + if (ret < 0) + return ret; =20 imx_pinctrl_parse_groups(child, grp, ipctl, i++); } @@ -669,18 +669,6 @@ static int imx_pinctrl_probe_dt(struct platform_device= *pdev, } } =20 - for (i =3D 0; i < nfuncs; i++) { - struct function_desc *function; - - function =3D devm_kzalloc(&pdev->dev, sizeof(*function), - GFP_KERNEL); - if (!function) - return -ENOMEM; - - mutex_lock(&ipctl->mutex); - radix_tree_insert(&pctl->pin_function_tree, i, function); - mutex_unlock(&ipctl->mutex); - } pctl->num_functions =3D nfuncs; =20 ipctl->group_index =3D 0; --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 839452E5B23 for ; Tue, 12 Aug 2025 08:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987245; cv=none; b=LZygNOof/xgVw0T/t8VzF2dp1D6r/8UcJzMshgQ490keQIyp+53VBP0BvbuKm4VtLnU4nai6s54x8Bh24n5SQF7VmM6xlPxyv4Td3o7P5vTXqasR8k+9zC03nIDuDBiFCGJGLj3xmNXjLOvUSgP+lQjFYKfM95rMjMNqpAKJlJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987245; c=relaxed/simple; bh=8LckYYbv7wEiVDCoVOTbwt+nYJz1zV0AkW539eEIzwQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HHQaw/8+0WPFq3SyFK7Ua7HJK+fvhQwtISJpkQsItni98iBOmACHAlXSq+CdmDb7oya53s4A2UQ1n+4LMm9Lo8jp/F6L97fporkYTD8+04TL0JmqONfVWaIaDqVS5vu9/PpJt4K40OGZ66/YmMVvTIw10aUYmffqVTAbCwzfiKs= 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=f8YcOLuJ; arc=none smtp.client-ip=209.85.128.47 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="f8YcOLuJ" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-455fdfb5d04so26171005e9.2 for ; Tue, 12 Aug 2025 01:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987241; x=1755592041; 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=f8YcOLuJWaGoKO3ukED1ZsheFdnSRu5+oB9sD73V5nMByxiz15V+e5dLXCdtR3zPoS 5WdQLsn/RoE4Mjif/R0dCQ34iZ8BKbRiQXikHc0J5IiQEJJYO4p8YSw2BbuMIZrMzXjt DqOvaaSHYgA7cW/6YDepzSUcmIJuMLT5jf8/TbhJzss7bTiJ8BSJ5BRYCBoRnTRjqlzv Da387BNwVhnn4ee3QZhR9gDlVpf5IKqxYq2GW5Kh5LlSPy9X8SOnB0c/tRl5ANUL3AE3 yi0EDPFEU+okfgwI7gt8DnkIXUrQEmjLUPBSCKT2Iio0XQKGY/EOHy1vG/WzadL2km1P UaZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987241; x=1755592041; 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=qlqTa4GHXqxm9/W9ddtwygn/waoHw5WNrlCdHMSoqB4t3aQADEGzKGt3td8grFFIrt ec23As8OQHCB4vTIzLutJPfnEhUFE3Q9ln9CfP/y/8Rpo+DLAtTKrnu4rT3Ulh3vsTGO 0se1JrjwPeXzTUq2EsruXsdECcC55gEk17cP/0yghnkW+ljgONRKdxSgm7c8rvFEc9nb t19eOGeEay70A4bVf/gQG9QjSzNfnDKq5iq5EDMbZSEWnPqpt4VHh30QB9llJnP0NYoa 20VJT8CHmB8ri3LK8hJGuFKbFsg0GOmgbX6J4ODg52i1dQ7d7z0bm8H7GVEeTiD+5xJn wWhg== X-Forwarded-Encrypted: i=1; AJvYcCX7l0Ej5TRUKbTaCcG3Ibos+8iJX6JSIfVu57vgbx4tVuZigZor5TNlQFVMH0mKgWoaKtsLTFM7Z6wjZzw=@vger.kernel.org X-Gm-Message-State: AOJu0YxgQufCD0wmSh6yorseQ4x6vJz59p8IkmBFcpTO4lqhtg8Vqb8i FPI7PrXdu7P/YLDexyt1JudQj6DMui/19meZJBKvL+ripN/t0n0YTIbZblNk2Zl2KHc= X-Gm-Gg: ASbGncv7W8evrp79MYDl0IlCg8pqKuJB8zZbPRlRpuE8yM9RsklBvnQPXrY9spd/Buu W74RxjrhfSEetlF/gGhN9a+A0O4kytRTR53UEBwLzJUgsqNMxkUIEHoghSfOThCMsLib9WbPIxN mvPOfv+IcjM6TxgAERD3vglS5vSHGSIbL0FCz/gse4FWwzuEmHH7H1Xdsq7QOgPDjfMt4OASNbU GNprkyyH8vlA2zeAAsZeZMP81wfLOOYfxluvad5NfrvLWT5xwu8a6RvlT40HLFTWvyQ+Np5fhK9 sT4cARsg+/rwtPx/Whn0bGKpmFkQp/yD2IluCrIpW8IrTufnhfmHp+32zMI51ZLCabUgxMH3r3j iSPlvgARYePZlhdE= X-Google-Smtp-Source: AGHT+IE8fEgiEn9lwBjUv2uob+aBCzOy3kH39g3JVI8xm0JYVluln+IusGsEv24A0i5bbeOMk/kDAw== X-Received: by 2002:a05:600c:4f91:b0:456:29da:bb25 with SMTP id 5b1f17b1804b1-45a10bf510dmr21937425e9.19.1754987240452; Tue, 12 Aug 2025 01:27:20 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:20 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:06 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-7-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1867; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=qPaUa8oAewMMgl8vCYU8JU6h4WrDoK89nonD2PTBKh4=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrYc40u0edePr0EkIpRoNV/l6AhxW+gy+qoJ DRbu/5uoWyJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62AAKCRARpy6gFHHX cr0FEADfv+WVcmzOaStfsm70mXUw69iAKQ+QB7ceZ9BjSwzet76pU/4gtWAVho7oelV+euRBcs0 rI79EvWGS9pbM7J6fBEPxlORgTWjhZ68KXqcPbqBLiBSldQTY1ZILTMVi18urPLCWQ3mj+w+Kju 4MbUSfSaeCLqLiFFCETd7te4vFDeDMpKmDmKxpTtqBqt8ZFzShFGXV2vxVtYLR7ztkmE1QAI3u7 DzjZ7r/jkB0IfHAG0G7RyIfDdVHgRGGw/Luhe0ppGZA3Q3qJalbn0K487GB79PLQT36ptT2Ey6C kcr9rYtt9kyoaXybtesyYcENhiUdkUSP1StOc7c54IUPOjlZ6EDG7fD72/LrgzRnCtsZ/WADH0G w6u6iuLcYQdpYxtED6m7q6rfDBsuzq6tHiZ4w3rvfvjep0xGXNo6s3bwioOPlDCh7ldFD3AEAUJ Ulgn9cufPkFGzcCwVnEc0mRvdlTavOeHzjQIt77zX98T6+AGs9rBsIDvYazO+jzAIU0TRSy7QqQ 8cE/3vgeDgTOzpTxfqdUm1HKwiHEuebwYuXdr2mI50EV4MjJbX6RN0C7XWKJjcLl7Q0l7aZRt4x MzKCL1YVBkfo6txurpQA3wRqXkgDFUW6ek8GoVdzy0LtGZirWgtY2Q3RAMVsBav9S02diTip1P2 w/nGmj49yU8wsew== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Unlike all the other allocations in this driver, the memory for storing the pin function descriptions allocated with kcalloc() and later resized with krealloc() is never freed. Use devres like elsewhere to handle that. While at it - replace krealloc() with more suitable devm_krealloc_array(). Note: the logic in this module is pretty convoluted and could probably use some revisiting, we should probably be able to calculate the exact amount of memory needed in advance or even skip the allocation altogether and just add each function to the radix tree separately. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinctrl-keembay.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-ke= embay.c index 60cf017498b32a9f36a1f8608e372951c2b8f12a..6aefcbc31309995ec1e235416b4= 0aab3e4a073a9 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -1603,7 +1603,8 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) * being part of 8 (hw maximum) globally unique muxes. */ kpc->nfuncs =3D 0; - keembay_funcs =3D kcalloc(kpc->npins * 8, sizeof(*keembay_funcs), GFP_KER= NEL); + keembay_funcs =3D devm_kcalloc(kpc->dev, kpc->npins * 8, + sizeof(*keembay_funcs), GFP_KERNEL); if (!keembay_funcs) return -ENOMEM; =20 @@ -1634,7 +1635,9 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) } =20 /* Reallocate memory based on actual number of functions */ - new_funcs =3D krealloc(keembay_funcs, kpc->nfuncs * sizeof(*new_funcs), G= FP_KERNEL); + new_funcs =3D devm_krealloc_array(kpc->dev, keembay_funcs, + kpc->nfuncs, sizeof(*new_funcs), + GFP_KERNEL); if (!new_funcs) { kfree(keembay_funcs); return -ENOMEM; --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.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 828F12E6122 for ; Tue, 12 Aug 2025 08:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987247; cv=none; b=LkyfYJ2sow3nCp0D9tU+uyT3ghZocOZ/S7xqYN/v7Dp65IYIGOInzlr72aluudPJH+wMbZ2dmCW3m7um4M7l85aZpBwlLudgu6iBdGf6LNK4g1cunDtqEe3JA1ui3nzkq2tT3npJLvDkceCTvWs6Va9FVXSiExxTH2EF2NfN5ig= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987247; c=relaxed/simple; bh=HSTxkhC3WyBFM1G4jv4j8GQuTAWxbn2e8t0aXkOzg+Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HxEezQfHOjzeRYPrp5yO1lrbs89ZEz4yCTuOsx3Bz8BINPrvAIlKoYZevRjKo7C7ajE/Ca1QnWArSxwBwWCliFbFspmJ0iQkmMp72fZxVl09V35zmmrTtnoQGKO4+kcXlXNF4BxrrB+cBG9WysBRD1yEGOwksDT2FCYY4/xMTrg= 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=SWUnhTWb; arc=none smtp.client-ip=209.85.221.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="SWUnhTWb" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3b78a034f17so3938211f8f.2 for ; Tue, 12 Aug 2025 01:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987242; x=1755592042; 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=SWUnhTWb1xVnvKDGPYatDL+5wF2w2vTEqjXDJBfPkjaL5IebY39EbDRzYTbpGbAfsT fLUTIposzew3vOcbt9acHAueXb8T7N1vT7XwJMWOvk3wXlDkm3VRktuI7cmrUxv2+hjf B62BRQ1EVzls9Z0QRfqsMdL5xnmFfTt6VJwDLKXNhxzWykbM95cRTDGRF8HATvPPo2z1 QIIXLPtXGt22EWZgAGtl2DmLY3ZIvsF4nVaE0EdA0csIkKJCD6PsiungK1l89yY9yeyT XZO1BFe4c9gTvG7VOD6IS6RxgJU/eQ04WKN8586BmO6LbZz3lZvv7BuiZdQFy865m66T GNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987242; x=1755592042; 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=Zacn/xwsq9N3tMo7DBrd8BYe2wmSYHEQG/RnWTtcloBTvBYMgduky95m7ekjzzbYAO 5+cF4AVceBYJIYvukgyg1DWW3KtLYy6V69FYTNA48z1eD3hpz97Pm5f+4sy9O9QUvACX ju1hokDGylGkHTELpKxANOCTkJV64uBfAgBjYHd1qSfa7jSzpcQc8G6tGgLIkCey6tKP d7AI6LFYWn6kHps+53xprgtlG5O3noykuEcCmQP54lFRU5RCDFnunvRt2lla2o4d2r9T 1VWRZTgg3izrVHD3cpFNS+j8A/7mZd8IiKqe+E9R++ZsUEw1OLvRtkwn97z0Z1DjQvYC zk6g== X-Forwarded-Encrypted: i=1; AJvYcCXEwrOk5wW4pxsast19EvwjBTKA7kMPU7xzP0ILwlUmDlNtvvkIk1Tp06KAtOohVJWvBJ7+c5v/NZbUuvE=@vger.kernel.org X-Gm-Message-State: AOJu0Yzyu5HevzinXsfV+66HUdC1ydamZB5XALTMSiOJdk8RunKnYnXR LfkXVHmoVsTlafWHjZ08Hfp1fxaUz399iNWnzKYfZAGtte7V0P2wGsbR4aBkO14DKX4= X-Gm-Gg: ASbGnct08HcK/EEJN/S/WcynLPKq5C3GSC8+YDcnyl/9ZPz55GXDriIHnoxYnMjrNPL fhvnfvmFGt5YbPnBZutHCs5mX7s3plhZ9WUZsfe969t3z7cAdQRQCB6ZAyIPYqt3JkYYjdbncCq 3iWkw+4WN93tNuaZaqohm6hK4wXNiZSNd81mEU3TVjI2TA+uu/ClDhpme4gLGGX9ifA4u3s58hQ DhZRAOCEfrjkT+2a/pLRjyDxsfYtYh0m2tfjtWX2v5iFZWHtPcsELKx6g+C2V9YY3JHtabndECI JZRj5AczJhSpj8hwMiOvdjJha0rfP1IvGbnhDoiVzxquhwK1uc5LSeiqrOgCx8UybrHd9FepcO3 P1C5A1T8NZw54cCw= X-Google-Smtp-Source: AGHT+IE7RzdqszohpjnIT7cc2wTKSAeG24gAzL3U1lbvOrOc1qeSqca8LmuxQAuRcX6HqNeYGrkvjg== X-Received: by 2002:a05:6000:2003:b0:3b8:d69b:93b with SMTP id ffacd0b85a97d-3b900b83ccdmr10680009f8f.52.1754987242087; Tue, 12 Aug 2025 01:27:22 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:21 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:07 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-8-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2974; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=HD9TOJpRmpG6enieox3SLEnzfmanpdaE65mOB6T5MYc=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrY8MuBbR5f3WyoubwUxwTmfyIcSpxQ7Ha5S zLVYHlj+CuJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62AAKCRARpy6gFHHX cuHpEADDsPkguck9xZ93DDbHm+dAkW+gxRyBIFKg7MoqDE8bGz/PJcKk/1pqyE282dOw68stYlV vWEOPXQXbw6Kn/H8LprolH4tci+fdlUYSuFCVbwEZHEr12487UwAWk0X+B2HpqF5xcBnOdVh3aO XhnFfIkuVErPutmqWZP/8HbQNkc5ASjwIqSDD14dJHZf0wFw7eyA4KvYcWH472lCJ/KpQZgrFK1 oL4rj410zLawPhIN0OT0AIYF1gECMQZsfoW6aXo0YqgMWt4z7/gVDJgbhpgs0nSWqB1/ri5wVg+ 9O17SbdM3avEKfy6ioY37j4RypySOqOaDC2cNt+/8RhGVM77rMBmEvMYESdtX9Sp3nySjpOPaeg 5kQTLr7RSho6OQIM4GK8qciMCFnF9AcggpTOOw3GFWJKKWHUQOAdfJbiPyF56YUp13+rw2d52Zq qcBjz8+t3mIvEpCUr02fqA1yaeFZfjR/CmIlvEpkYCvBxW9o60l+SL7i4LNbQYppZQsZv7V6qwU 59JLUvYSuDw2Z8OkViH9CzlRqd3PH3Z8ufgkHBFZX/jrwufWqycyN17bhs5PxI7xzO/JMD2q3rE Oyh+AdI+WlSwIi+nk/ccSPXY5Ru6x6NE9iJr8R11FGaDLpiRT1xMit6Vk9/CGA3AUU8FVayq/hP 2n/7CMV5EcQpTVA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct function_desc is a wrapper around struct pinfunction with an additional void *data pointer. We're working towards reducing the usage of struct function_desc in pinctrl drivers - they should only be created by pinmux core and accessed by drivers using pinmux_generic_get_function(). This driver uses the data pointer so in order to stop using struct function_desc, we need to provide an alternative that also wraps the mux mode which is passed to pinctrl core as user data. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinctrl-keembay.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-ke= embay.c index 6aefcbc31309995ec1e235416b40aab3e4a073a9..e78c8b3ec245aad56e3e74a26d2= 7c41ba4a98281 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -135,6 +135,11 @@ struct keembay_pin_soc { const struct pinctrl_pin_desc *pins; }; =20 +struct keembay_pinfunction { + struct pinfunction func; + u8 mux_mode; +}; + static const struct pinctrl_pin_desc keembay_pins[] =3D { KEEMBAY_PIN_DESC(0, "GPIO0", KEEMBAY_MUX(0x0, "I2S0_M0"), @@ -1556,13 +1561,13 @@ static int keembay_pinctrl_reg(struct keembay_pinct= rl *kpc, struct device *dev) } =20 static int keembay_add_functions(struct keembay_pinctrl *kpc, - struct function_desc *functions) + struct keembay_pinfunction *functions) { unsigned int i; =20 /* Assign the groups for each function */ for (i =3D 0; i < kpc->nfuncs; i++) { - struct function_desc *func =3D &functions[i]; + struct keembay_pinfunction *func =3D &functions[i]; const char **group_names; unsigned int grp_idx =3D 0; int j; @@ -1588,14 +1593,14 @@ static int keembay_add_functions(struct keembay_pin= ctrl *kpc, /* Add all functions */ for (i =3D 0; i < kpc->nfuncs; i++) pinmux_generic_add_pinfunction(kpc->pctrl, &functions[i].func, - functions[i].data); + &functions[i].mux_mode); =20 return 0; } =20 static int keembay_build_functions(struct keembay_pinctrl *kpc) { - struct function_desc *keembay_funcs, *new_funcs; + struct keembay_pinfunction *keembay_funcs, *new_funcs; int i; =20 /* @@ -1614,7 +1619,7 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) struct keembay_mux_desc *mux; =20 for (mux =3D pdesc->drv_data; mux->name; mux++) { - struct function_desc *fdesc; + struct keembay_pinfunction *fdesc; =20 /* Check if we already have function for this mux */ for (fdesc =3D keembay_funcs; fdesc->func.name; fdesc++) { @@ -1628,7 +1633,7 @@ static int keembay_build_functions(struct keembay_pin= ctrl *kpc) if (!fdesc->func.name) { fdesc->func.name =3D mux->name; fdesc->func.ngroups =3D 1; - fdesc->data =3D &mux->mode; + fdesc->mux_mode =3D mux->mode; kpc->nfuncs++; } } --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 141B22E62BA for ; Tue, 12 Aug 2025 08:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987250; cv=none; b=JmutPSfTAjc13TCbhlZKR/t97Jda1AeAFmb+Z77PDLZ1iS6WpoJD/7aVcq8lzJW9Fn7dczrWSFyuVkyMRRfFTZFkrAit6RAtYygXTunp5p2ky/DaXuMtpF1PdtRwVIuRQunw9QIzcppwIuKI9boA03FWPnu2goEC/vbt5tCaqjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987250; c=relaxed/simple; bh=oVtkZooniDAZ/zp3pp2Z7TEDxZG2RGAqbxcNXmmWQv4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bhdGlceuPmXRf0BowYfFGOV4xVt++hJDSbEz3av0E/U0v9XZDCdBN7BYIoovk7VrvDdW63aKuBDSh/XHDmyCYrKwZZuaRoH9o3VDCuLsC5A878ISW40rbOyf9yLcPkiEp1Qh9mKQ3cLvMOgCLeWP00jg+37YYni1TcijKjoRY6w= 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=rLiYTdys; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="rLiYTdys" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-455fdfb5d04so26171405e9.2 for ; Tue, 12 Aug 2025 01:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987244; x=1755592044; 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=IDUOUuYpI76iOVUogWQ/IDvtAHASSKUzmCarU5crSms=; b=rLiYTdysYBEPkNcRH0sgkZVVUVOWdB1yBLmzlTBVZPn14V0OkDjb8jseD5xfqp0Gw7 z2HVFedvxLkxiXouOdxdJsmb+kASqrCr8X7yPIx4eMSDakZZvWt6qrTqXqHGiXH0+p34 oIKp/4r1pzOK2x8dZB89hcQLtUYr+bqOwiUdao7nYJIF9A/W53vF3dFSkYDz62FrojhE Tyk2WXtuySEp12IjcJcDjFwmmoxQyofPpWXSKt1cwy+a66+YcjVMaC+0A4vmnQRGcrAv fkHNBi7nkdSG01o9wWsKNlwOLRr375zy7IHISe3W/8Hac93dPsoKJTXu7WP+Qc3FihAT UeKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987244; x=1755592044; 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=IDUOUuYpI76iOVUogWQ/IDvtAHASSKUzmCarU5crSms=; b=HGz0ckiDR78bZtpyrSinv+iUiOKrztlGLOgbv29n4bk3RHQQ3kRGP2NbfApKzdoECF O/LW86vy/kOqrFPerD974G8KswS4+fOkm5PdYdwaoiVnrl1nliF1uLFXfQbky9eq+DFA 3kbMd1hcJh4o/owjfFQ0Mydk6BhdWENzbtygn8eZLMO+QeSu9uo/XGONRqRhB+kmIHc1 SWV8BDRaUjL0Uz2Seqo1xnyGX/2HI4at1jg4wb90KrKfKRUt548aSwPyuEx85mIxEXzB ZkiDRdRF9Nv0nrOo1ici+CgBkct34ouf3W8+Z1aL8m3BQ6DPenTbyQjysXqvc18uvlA+ WIng== X-Forwarded-Encrypted: i=1; AJvYcCUY1OAX/je7N29uKhfcWEjo3aO73f9R5rMyM6LmG8QAb3dhC8WrKI4Us3oGa64zfQtX0SJrtt8VejYlvE8=@vger.kernel.org X-Gm-Message-State: AOJu0YyrEti2Vf9QcH4cyNGDYuRHJcvso3/VAUt8WZzpH1fJc6GLboda bJSIQrYa593SkVrOwgxy7Qgupb/7eGd0Qx81TVIFhl2LlnfCp3RHFOsj8Ij6FnmJNmA= X-Gm-Gg: ASbGncsxHJ8mW+HAz7dGVXtkPZky0jHQpQO6f4CM/uMmFlZZ62Iy3tvgYbulOtZAxt1 EXCCxcwJ1+jpcCiaG4Uf7uBmZ17CLno9Ra5ec0tbTSzJlh3mY0SboqRkizcexZZ0MF+HoTKjz+o WoVOYDrPNFahDohKXfi34Oy0S3JVjlV7DNsTHDKUCpAzXdaqaut1j8qMRTEgQdlE6xM82kX5fUk paElS5TE6Ox5g3yEFp/zsjCfVUrPAk6upb0fyPIXbfnWM3phQKSyQxn60/rsT15kjlF6GF5SIuy JQ9UQzhMEX6BlHXsqDEyb8GtTSD5wjkthWkFztZEbFH6DcFA0ocaUj7o69sRArwwdh8yaPL5DC/ WuaWbKlE1mi8vcEA= X-Google-Smtp-Source: AGHT+IEH0JxbXQ5+J2wfU2NJF1bGQPqex/0eJGKJqDW0LZU/RxFA+yyFi8vGdnIyOPGv/hEK3U8ySg== X-Received: by 2002:a05:600c:1f8e:b0:459:e35e:a90d with SMTP id 5b1f17b1804b1-45a10c06786mr19912515e9.27.1754987243736; Tue, 12 Aug 2025 01:27:23 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:23 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:08 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-9-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=9697; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=mUGhvFEd/o0H3Ei3zmVvmjlu+B7qT/I3GR1QZlTr8uw=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrYu4D+vFh+Czmvxoqz3WG+dyHkxejkwnS3s ny31IbhSO+JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62AAKCRARpy6gFHHX cik4D/9DC2W3IihPzcJB6UwDGtK22p+KLEHaeV1gP1a7shVgvtPPZNr5KjwVyNWsmx/glUQ0utm zXMIb465kspzrKyJ/r1skyJpkZBrInf0bkmDHEWd48nL4HZ2x3BFO859rHn+zbs2wFEyXkc1yR2 UYPOf3Dg3nu4uaQ5qu2a2EPt/NoHvCWsimCANj3Txt0Bk2OQl0io5nm804xGKdA6l9m/F8167fE WcntFBnMX5c0XQVdgUpy3FMvB/J1gXjRa8aiqtXu+l/MI1+mhAHUdugb5ZgjhxTU0mmUfWKOFEF 79jGO14D1N8sLd5VekbKXjNS3cr1Y1u6eVCrlxJGl0znKDzclKzOE4KIybSDf85BRU6+3838wAi vRxQHhuDY870rax34tE8+Dcf9xosjuYOcMoQyC0G0jw8l/fifL16/nuT/YRbrInv7sb+I1HF8h2 zeLDFFX1ztkYpBtf+r+e/Q2d/EZ+S9TrMeDNZEg1NadbJ4I4f+YIGPTfitFI+78STdloPF0uyLY kwmvjYKX47lE/LP2sW7VS06sKTWefUYgqztql9qfLwaS/IGVApiYCQKww3nNZoDM+xASn3hNpY4 vG8KY41/eJalMJ+iFvKD66p8OHIsRfYK9Qaye9axkWQy84on8Pf0g0TjAdrjbSoi7chZlBYmIaI OtRUPHwaRPvvB4Q== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski With all users of struct function_desc limited to only accessing it using the dedicated function and never modifying it, we can now constify the return value of pinmux_generic_get_function() treewide. Reviewed-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven # renesas Acked-by: Geert Uytterhoeven # renesas Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- drivers/pinctrl/mediatek/pinctrl-airoha.c | 2 +- drivers/pinctrl/mediatek/pinctrl-moore.c | 2 +- drivers/pinctrl/pinctrl-equilibrium.c | 2 +- drivers/pinctrl/pinctrl-ingenic.c | 2 +- drivers/pinctrl/pinctrl-keembay.c | 2 +- drivers/pinctrl/pinctrl-single.c | 4 ++-- drivers/pinctrl/pinmux.c | 4 ++-- drivers/pinctrl/pinmux.h | 4 ++-- drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +- drivers/pinctrl/renesas/pinctrl-rza2.c | 2 +- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 +- drivers/pinctrl/renesas/pinctrl-rzv2m.c | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index d5d42c9ad5fe9dcf7c25ad393688e714b02db678..9ed84479a5b43871861f46fe132= 6f1dfadc7f63c 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -245,7 +245,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, uns= igned selector, { struct imx_pinctrl *ipctl =3D pinctrl_dev_get_drvdata(pctldev); const struct imx_pinctrl_soc_info *info =3D ipctl->info; - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; struct imx_pin *pin; unsigned int npins; diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/me= diatek/pinctrl-airoha.c index 51cd0cdc2f5170d024fe984ce8882ed9b3ce6563..61aecc3555837ddada3bab9d7f2= 8a6af7afdd3b3 100644 --- a/drivers/pinctrl/mediatek/pinctrl-airoha.c +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c @@ -2446,7 +2446,7 @@ static int airoha_pinmux_set_mux(struct pinctrl_dev *= pctrl_dev, { struct airoha_pinctrl *pinctrl =3D pinctrl_dev_get_drvdata(pctrl_dev); const struct airoha_pinctrl_func *func; - struct function_desc *desc; + const struct function_desc *desc; struct group_desc *grp; int i; =20 diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/med= iatek/pinctrl-moore.c index 982b9887521d036538f67e9919de444693c458c0..17a08c73423fd089066e4894d23= 07c852bbbb661 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -43,7 +43,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int selector, unsigned int group) { struct mtk_pinctrl *hw =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; int i, err; =20 diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctr= l-equilibrium.c index fce804d42e7d7f9233b2da0fb26e482170629424..18f0da58c96d4f0fad6535fd88e= 69fc8acf96a94 100644 --- a/drivers/pinctrl/pinctrl-equilibrium.c +++ b/drivers/pinctrl/pinctrl-equilibrium.c @@ -319,7 +319,7 @@ static int eqbr_pinmux_set_mux(struct pinctrl_dev *pctl= dev, unsigned int selector, unsigned int group) { struct eqbr_pinctrl_drv_data *pctl =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; unsigned int *pinmux; int i; diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index af9d2f3081859bc4b22f6820f3b3753eba36f959..e13ef07850386e70cffc8301158= 9ceaf70a70a41 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -4000,7 +4000,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev = *pctldev, unsigned int selector, unsigned int group) { struct ingenic_pinctrl *jzpc =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; unsigned int i; uintptr_t mode; diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-ke= embay.c index e78c8b3ec245aad56e3e74a26d27c41ba4a98281..30122ca90cbef141ec456ca39ab= 4eb6f8bc334c5 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -935,7 +935,7 @@ static int keembay_set_mux(struct pinctrl_dev *pctldev,= unsigned int fun_sel, unsigned int grp_sel) { struct keembay_pinctrl *kpc =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; unsigned int val; u8 pin_mode; diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-sin= gle.c index 5cda6201b60f53e62f3f50b8641ec894106111e0..c9adf5fcb1c76445d4812de449e= df09878771a46 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -336,7 +336,7 @@ static int pcs_get_function(struct pinctrl_dev *pctldev= , unsigned pin, struct pcs_device *pcs =3D pinctrl_dev_get_drvdata(pctldev); struct pin_desc *pdesc =3D pin_desc_get(pctldev, pin); const struct pinctrl_setting_mux *setting; - struct function_desc *function; + const struct function_desc *function; unsigned fselector; =20 /* If pin is not described in DTS & enabled, mux_setting is NULL. */ @@ -360,7 +360,7 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, uns= igned fselector, unsigned group) { struct pcs_device *pcs; - struct function_desc *function; + const struct function_desc *function; struct pcs_function *func; int i; =20 diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 79814758a084570adea0ea1a3151d186f65d1d1f..62bd4aa53b2b22cb09eacfb0539= 8205f2fe391b9 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -847,8 +847,8 @@ EXPORT_SYMBOL_GPL(pinmux_generic_get_function_groups); * @pctldev: pin controller device * @selector: function number */ -struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctl= dev, - unsigned int selector) +const struct function_desc * +pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int sele= ctor) { struct function_desc *function; =20 diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index bdb5be1a636ead9695410824b5557937c5baa89a..549ab10f7afbda32fadf4ad1514= 01180bed2064f 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -152,8 +152,8 @@ int pinmux_generic_get_function_groups(struct pinctrl_d= ev *pctldev, const char * const **groups, unsigned int * const ngroups); =20 -struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctl= dev, - unsigned int selector); +const struct function_desc * +pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int sele= ctor); =20 int pinmux_generic_add_function(struct pinctrl_dev *pctldev, const char *name, diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renes= as/pinctrl-rza1.c index 23812116ef42682d8ef667525d4f4486c286b46a..70f22e0ef307a02d5b11d6626d2= 97a619f5b82e9 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza1.c +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c @@ -1120,7 +1120,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, = unsigned int selector, { struct rza1_pinctrl *rza1_pctl =3D pinctrl_dev_get_drvdata(pctldev); struct rza1_mux_conf *mux_confs; - struct function_desc *func; + const struct function_desc *func; struct group_desc *grp; int i; =20 diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renes= as/pinctrl-rza2.c index b78b5b4ec5afd9879373b406e0b8c391912a200d..29a9db19759906598ac55694439= cff8a5ec2c8aa 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza2.c +++ b/drivers/pinctrl/renesas/pinctrl-rza2.c @@ -442,7 +442,7 @@ static int rza2_set_mux(struct pinctrl_dev *pctldev, un= signed int selector, unsigned int group) { struct rza2_pinctrl_priv *priv =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; unsigned int i, *psel_val; struct group_desc *grp; =20 diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/rene= sas/pinctrl-rzg2l.c index c52263c2a7b093fccdb38e44ff3fbba0a86d4def..a9bcb3d7c45c269046df0a7d008= 8a1f48d089fd0 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -549,7 +549,7 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev *pc= tldev, { struct rzg2l_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); const struct rzg2l_hwcfg *hwcfg =3D pctrl->data->hwcfg; - struct function_desc *func; + const struct function_desc *func; unsigned int i, *psel_val; struct group_desc *group; const unsigned int *pins; diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c b/drivers/pinctrl/rene= sas/pinctrl-rzv2m.c index daaa986d994dac15860d328c81e28e2c9e678120..dce68f93d2d57f6a6c9b1bf9e1d= b27393ece8e44 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c +++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c @@ -162,7 +162,7 @@ static int rzv2m_pinctrl_set_mux(struct pinctrl_dev *pc= tldev, unsigned int group_selector) { struct rzv2m_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - struct function_desc *func; + const struct function_desc *func; unsigned int i, *psel_val; struct group_desc *group; const unsigned int *pins; --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAC9D2E716D for ; Tue, 12 Aug 2025 08:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987252; cv=none; b=gWmWeIWP9aYteyIkCZq6LP2NWPDkIlTYlhAMbQr3OBCOqWQ7OWnECarmb1TGuva3p6leDgR+dJnz+0QfUJqe/80UaMFSxYkLN3lVfgEeUFRidx4IxBx5CA6CdP2bvul4a0B2V63iWe8dVUxowH14Udx6GXU5OEujILRoWkCcrb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987252; c=relaxed/simple; bh=CuTz49b4GPinE1YCg+1bwJMe4eCZYLSKcvxUHG9oTsk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ge6776KmJ11RTd4oxteGleOzl1tqxYJFooC2Oe/q91LzEGA2XKLEc+I7/cphXYA7cTJy512wjMt4Yxuk5OuvFMcYeIAO+bP9P0PmmItoeRPUrEZ47b3mAf46LIKcKXLkTJqOl7whamJdLN8aiZnyLnI243hP8uby/PaTTeOWJKo= 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=HXz7v8ma; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="HXz7v8ma" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-459ddf9019cso16905435e9.0 for ; Tue, 12 Aug 2025 01:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987245; x=1755592045; 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=+YbWc4IE0U5a+ObdUmLxRXb/F+0HhyYqNMK8nrf3mHI=; b=HXz7v8maekSQIBY/++UzdgLpMmPm9kpA+mBSiJCoGI7SOtNl1fYLkwMAbjfZQvpy8c vOWTmnu4VBDWlyGByJq/wDgFqF2b9/FocUfKA/HGCMipb3bzGup1L0RCV8xjR5JbvjCn gBzGbYdzJxGFmiEBLXrBCqlL0RVEhUnzFtlx3IjFkuVlByjoplfVl1H8q4h53d6FT2yP ERb38gPILpnAbMRWblirPoX7U9grerT1pih3WAb2XCaywmMfy96z+Kw7Y2eu64pLreAb uSyYBZjDQaYzss88sQhxru57uJn+CFjBPz7LUlrQYktxgdi2Qw9y0iF2/UCtxTgTIOFw T7VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987245; x=1755592045; 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=+YbWc4IE0U5a+ObdUmLxRXb/F+0HhyYqNMK8nrf3mHI=; b=LxwKu+E4N8SIOBkDkxdGIlBK/HRUYJTdsJuIBNo0jpjAcRe8nwBRZpem44A8Ux+Kb0 ZGj+bdJR4eu73qU1+XPl7HX5fm+ubWcEm6gSOEDQLkJV1qXgfJiOqqKGTbvftsvZ9VE/ bPOkp73rw+JD0quguczAsryQByFRzea5w/9I8eevB3fbEdNrr45H3kDoVRad8G69YXPL 3Ufkn+aW/3Pcyjg7GP5oeRgNWmCDokpkUGUIzFuQJSOgdytsyn2RqDY1wh1SgEQqpbSs Rgr/57g99T5NT0n4NqeskPgM4HszpELXnz2QbLYRKD3sOuckhVdcBOoAkV+2u53trUyY oJgA== X-Forwarded-Encrypted: i=1; AJvYcCUkJg0E0EzBPMiFg5kbLYNBzDLdf0qAJP22Yef4pSWA01GD8jnrc7OOVQBa8l6cN8fRqZeVnS0oDNpNuQA=@vger.kernel.org X-Gm-Message-State: AOJu0YwdHz9JFAJcPSXTwSaKAZAnzO5Mwv6A1vAYBilOHOM8W9ek89zV CVf5RjC6osHXZitsD7l1jcsKngV2StKFTdLyl+0pRh3qDjYrO01T1pS7jFYE/u8E3UY= X-Gm-Gg: ASbGncv661sq4KR79/+qfljZtgKqVcbBGc5+Va2ctOkMeB5r//LFMicEEgRYdNeqmIH FfWDRDPjmPQR4Oq+lnPMAg+Anicdlx+f8h8zfJcmx7/78BnKgJEcQ6aFYONHMq5myEILP6nMJok sp+U0QJO0Dt7+D/aEAYfEV8eTPMXsdJ9fwneT+B5GEoQmM7vD36+qxzY7cs7cejqLdiY0Ehj+5G PzAZ3/Lf4ED2R9SrIcXeexAevZnt+Uish2Betb2TnQDs/HP09m1AAmVF+2B6j0AYwVWw0DEq9WZ CHUdN1XnfXcypQmErBXYSe7GPjF8X9O9A2Y9YxbByET0xzUISG5+iukGJtFs4n8lqTdxBsK0x5i aSVxbelK/PkdRzvc= X-Google-Smtp-Source: AGHT+IGi/j7vvT//K1tjjQhALtCZbmyRmQbp5AQVO+ecrZR25VCoPGpFE1cdkaigLNYXu36RBE9/0w== X-Received: by 2002:a05:6000:2f86:b0:3b8:d79a:6a60 with SMTP id ffacd0b85a97d-3b910fd0192mr2025994f8f.3.1754987245402; Tue, 12 Aug 2025 01:27:25 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:24 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:09 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-10-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5244; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=eGspcjc2EAjWh0rFUcHzIQ10C9gfQYuw/lhLS4OYQVY=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrYMe2y4vEPLm1kTppjWmg41eG4qsgyU3HfC 0ktdKcA63iJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62AAKCRARpy6gFHHX cgKuD/wL8IqveDOLws25gTN8uwaorjKGDFIvwi7VZNqVZ/hIyoeWKzjAK50/Voty9yhKi4Ld4Wv oWFw87sa48nxfIJnwVS8gzTcvWdSjcaR84jX0VpuIVa+fjyLzgnU0dcOwTV8zQhMg2Jc6lSkycy MOiQbuAZkcFQDmWe7xCQsUv0TYotfNPfHAw1HxytCwGs4ye1aDqiWacHAfizNJQT6WYRM8OOFwz Q+WtQHuM+3Eo6sGbj6kItR2CNMUg02Oal6VkreWZ8UhJ7lcHwrsGLPw9PCynOHmMo4WxvY3mDPh GtriQxOgBOxNLQPICuDdryD40vO8u/Bn1nmchxgo7skPK0/AC2SHreltuLzoaD+lkM/87au5j1h pTsqBZQBiGWfsfJYGS6jZWsLms9hmtVfrNyI3jQtX9IYmDBjpf/HcJN0gNyevodIPVMCtcNhycA E+MpTrh9F+daADG/PwKcNtDduobVUoJBLy22CdiL4i4+elQlNAdtzTmDFX7TAUODSArn2uLI7is uE6vdK4NKaVbHe6vEuZfKxzyf86wy+yuMU1m/rcWIN2Euey0LR197WJkHtSiB4x3fYMJlx6u4U6 0OR+My49drC5JYj3Ac0HX392d1wUcLysY9U4dsYnqySzLVVuTRHU3oyz6+Oo+csnKugonlolxPw 00T8opFSZuQHT2Q== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski We currently duplicate the entire struct pinfunction object in pinmux_generic_add_pinfunction(). While this is inevitable when the arguments come in split through pinmux_generic_add_function(), users of pinmux_generic_add_pinfunction() will typically pass addresses of structures in .rodata, meaning we can try to avoid the duplication with the help from kmemdup_const(). To that end: don't wrap the entire struct pinfunction in struct function_desc but rather just store the address. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- drivers/pinctrl/mediatek/pinctrl-airoha.c | 2 +- drivers/pinctrl/mediatek/pinctrl-moore.c | 2 +- drivers/pinctrl/pinctrl-ingenic.c | 2 +- drivers/pinctrl/pinmux.c | 18 ++++++++++++++---- drivers/pinctrl/pinmux.h | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index 9ed84479a5b43871861f46fe1326f1dfadc7f63c..0df7eba8ccd3209fbc4b2e67ffd= ea12b77b90858 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -266,7 +266,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, uns= igned selector, npins =3D grp->grp.npins; =20 dev_dbg(ipctl->dev, "enable function %s group %s\n", - func->func.name, grp->grp.name); + func->func->name, grp->grp.name); =20 for (i =3D 0; i < npins; i++) { /* diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/me= diatek/pinctrl-airoha.c index 61aecc3555837ddada3bab9d7f28a6af7afdd3b3..33421dabaaac597382e75c4e5ab= 009390a2eb1e4 100644 --- a/drivers/pinctrl/mediatek/pinctrl-airoha.c +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c @@ -2459,7 +2459,7 @@ static int airoha_pinmux_set_mux(struct pinctrl_dev *= pctrl_dev, return -EINVAL; =20 dev_dbg(pctrl_dev->dev, "enable function %s group %s\n", - desc->func.name, grp->grp.name); + desc->func->name, grp->grp.name); =20 func =3D desc->data; for (i =3D 0; i < func->group_size; i++) { diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/med= iatek/pinctrl-moore.c index 17a08c73423fd089066e4894d2307c852bbbb661..11dc525eb3a2dc8ceabf2278ee1= a2abaa425eec1 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -56,7 +56,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev, return -EINVAL; =20 dev_dbg(pctldev->dev, "enable function %s group %s\n", - func->func.name, grp->grp.name); + func->func->name, grp->grp.name); =20 for (i =3D 0; i < grp->grp.npins; i++) { const struct mtk_pin_desc *desc; diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index e13ef07850386e70cffc83011589ceaf70a70a41..e5b24fab12e11e443df25ffeb7b= 70d7c1a03c6bc 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -4015,7 +4015,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev = *pctldev, return -EINVAL; =20 dev_dbg(pctldev->dev, "enable function %s group %s\n", - func->func.name, grp->grp.name); + func->func->name, grp->grp.name); =20 mode =3D (uintptr_t)grp->data; if (mode <=3D 3) { diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 62bd4aa53b2b22cb09eacfb05398205f2fe391b9..6f5e3ede972bbfa78e279790df3= 59632e2d63485 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -810,7 +810,7 @@ pinmux_generic_get_function_name(struct pinctrl_dev *pc= tldev, if (!function) return NULL; =20 - return function->func.name; + return function->func->name; } EXPORT_SYMBOL_GPL(pinmux_generic_get_function_name); =20 @@ -835,8 +835,8 @@ int pinmux_generic_get_function_groups(struct pinctrl_d= ev *pctldev, __func__, selector); return -EINVAL; } - *groups =3D function->func.groups; - *ngroups =3D function->func.ngroups; + *groups =3D function->func->groups; + *ngroups =3D function->func->ngroups; =20 return 0; } @@ -903,7 +903,17 @@ int pinmux_generic_add_pinfunction(struct pinctrl_dev = *pctldev, if (!function) return -ENOMEM; =20 - function->func =3D *func; + /* + * FIXME: It's generally a bad idea to use devres in subsystem core + * code - managed interfaces are aimed at drivers - but pinctrl already + * uses it all over the place so it's a larger piece of technical debt + * to fix. + */ + function->func =3D devm_kmemdup_const(pctldev->dev, func, + sizeof(*func), GFP_KERNEL); + if (!function->func) + return -ENOMEM; + function->data =3D data; =20 error =3D radix_tree_insert(&pctldev->pin_function_tree, selector, functi= on); diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index 549ab10f7afbda32fadf4ad151401180bed2064f..653684290666d78fd725febb5f8= bc987b66a1afb 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -137,7 +137,7 @@ static inline void pinmux_init_device_debugfs(struct de= ntry *devroot, * @data: pin controller driver specific data */ struct function_desc { - struct pinfunction func; + const struct pinfunction *func; void *data; }; =20 --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21BC82E718B for ; Tue, 12 Aug 2025 08:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987252; cv=none; b=AoONujcdP+c3lSjHm9T0UYT3YcPCAbQvQToFPCKOrSpZOjdHMSddV5mjYKu7u62/uVy97ys+8qeiaOHYngEnv00rbAXqBTFZqjvDMR2Wn/5MuDFdrWohww+bGnMYDl9Bba+0kCko+b4h68uLdE9feJUgANN/oU6juhZdry5XN9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987252; c=relaxed/simple; bh=+QvEm53FGBL8kbed9CrGkfR7JQ0mUkCssMIU9hMIktU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e3ac2paYTXnhkg/qxwsZOepp/24La1pKx3ERx8BEAuRSFpsgjp0Qzg6SraAKhFDjxeFEe477Ij2ad/loQqyH2JVfkk6AAiXf8BJdO2q9vruYbHfXZxqFezFDf2re0mwtxj0OzzVEsZyjgoh8TXxi4mR3+o/Rf2lPozwsXtN1Ohw= 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=JM5vbmM9; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="JM5vbmM9" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-459d62184c9so30572145e9.1 for ; Tue, 12 Aug 2025 01:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987247; x=1755592047; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fkIrT982nu0l7atioMtbVH3OTcGWcWH7NZxVXh73dLg=; b=JM5vbmM9DRsPp3WjiceB66fPydz6iaLNxhRSir4GADMhX+PUE2BDDAtkn30deSHj1V m4OJE7Uz78EJcU5soMGWTswv4MYTdu85Wgj4lK4jCZlJ5/73K/bxftLEW0aTmc+0tRMX xU1okMc/TuCRoGbGb6MXBT6g7isUdFQhbi+2L3fqrkPHXNqgCzLQqu11NGbMSccd+hGS 8RjMZfINtEryw8TcbM7DYtaFhJkgRLlQDH0nzp8JgsbON+0h3nV0oxepYmk2X8DkoQ8o Zvf9N4aLHRUm2W5jx5t8uV7c/o692LsxQwe437mpRBfpqV//RKX/iWFXcX62THKWcplC +30w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987247; x=1755592047; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fkIrT982nu0l7atioMtbVH3OTcGWcWH7NZxVXh73dLg=; b=RvrgllN1GKpeZ2sbFEJAFzL69kRK9swJHAK5FdfSitqTDatoL/27d2dAh+qevomWer rWVaMG5fWcMxxQmnYx3FKaP2iMAX564EpUyc4eOAxpRXddzJvcbvtst/K26lFLi5gJY+ 1aNq+V6AmQD8OCKq7hCIuH+yPZhBVt97wmIx/FdT/GGjl/adOeuXWekVurJ8Ds9RtXEV +uEwzVOgNJzt3uj0PYwqkyg00FL6RDbOQNlUF7EYluAyF0lIGpKdRd4DSRM0peTVHnC2 jXuPzksu1XWqoVZIgFLHZHj7Z/vHTl0kBev3ELm6FQJhczmmLqWe4sqywhtqpj6N2mJA Tkrg== X-Forwarded-Encrypted: i=1; AJvYcCWYrobffcCmcn+Us5InIp7TmxZ3wwSH6/NGZ7jGYe4PXPZAiwSeaI2h6TSP7mkysv9AARj/Gtpu3kdUMxk=@vger.kernel.org X-Gm-Message-State: AOJu0YzqxLUXa3JOKo6vxYv6qFEtnR6sdRPoXnzcey6zHqmyHXfqpVYn xyp8eCC4V3a4qJ2L9Rg7TbA7U40Ep0W/sEcWlwZzAdDXbDrD9h437CL7Dc+bKrz1VnA= X-Gm-Gg: ASbGnct8bEFu/ZQGPaXIZczIx/ofcAKE5WMAOBVjiKY2V/i88DyLpp+fX2bb8UFGux5 9pkAETQfoqzW7a7+mbJyjv//afmirEu2X9loKtMyZtkmd/YzUDxMRVd75pFzMoGM1DrvgkU+sZW K0KQrh1FuV6H630jwpJ/UYuKgYvvZOTBIeSyWLe7+i0d2EZbxYK44TWo3Hy3dJj6EOxyXqTfaJx sPSAj73g+ad99EhSHlDL2tQOjm8h1F7bX5LCqZ7tLsofNNreSXJXYireiGHUf5dWjEqvfcYtXCZ HtCcss0ybc8gNSBeE7tNsYXn1D15xjBAS+UO/4ekNNA00f8gob5BBKxmZJDvdeKHvUc4PHyTrhT 7dirNGLQ0qqvTpNE= X-Google-Smtp-Source: AGHT+IFwsqbb1rEd24wsckY1+KDaOixyeJmTQXPivaE2uZXRqBDhR+NeTCmIev7yq9yZGKWaYyUBJA== X-Received: by 2002:a05:6000:310f:b0:3b7:7c3b:1073 with SMTP id ffacd0b85a97d-3b911014a84mr1715986f8f.52.1754987247118; Tue, 12 Aug 2025 01:27:27 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:26 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:10 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-11-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3269; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=chxUZAtCU37mhXCr4qzhIIkekcZb+5ZpnLwzXbUTM0A=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrZTBy24+EiQ0I9n9YAoAtc9GJc+mIbjLJ4c dVv83dQyiCJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62QAKCRARpy6gFHHX cnS7D/42s+kq9cudWSpcHFuc0USVQTKWUm9m7Hr3iADyqxdii9U6wnmYgtkZeD/gBnn6eZBEVM8 936OPO+6JoHACjR+Mrib1JBKvn+2EAhtvOxa2y8krmNl8HTrOwK24miaRuyQryIP2PDaUu9a/0v CCXeG9pcuY0VlCVndCfLAIvMBtoaf435NUcJbfRAUA1pqIBnAMgYNXixlJA8FtQj1cHIXYnoz12 NRcDaJrJJQBNezG7RIxA0m4pc7nknsJMic4H6VJuhEEDURLIX11SZosiXspOqRzpyjWrifX9JKM Ir+XQCb4e9wFmhsQb0WJyDW4DxOxxVHaxO9vl7HLgXd9OcX+TbJm6dmibj6OQY3tPabfLIv5t5b 91zGUu5y6bJ4d6/+OO0qmV6kzCOFxZBaFnx2uqKVn+ubzX7Vb20TGm0ArDrHQT8cG/W3iKRJf7D j/tojt9LnoVrmeBXBoFp75tWYfAtotKruu+kgi2o90mx5CL3RgXe+BHu8kcgoLmyby/jSygW3ei uD4SzRu96+iIJLTUjRzqRbv6WujNxkKHdcXIXO1VNvLuJ/rY5DhvLN9VFlnYGI0Pi1b4vN3ZwtG ZqR5bOzeHuNC/KkCJphUX/v8hHAqRSHlvHv1oCenO2VC8TSwJ/RtpstfLf8KL5mLGj+tYmim+md 2lrEOwVF6POBJpQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski With the pinmux core no longer duplicating memory used to store the struct pinfunction objects in .rodata, we can now use the existing infrastructure for storing and looking up pin functions in qualcomm drivers. Remove hand-crafted callbacks. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-msm.c | 43 ++++++++++++----------------------= ---- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinc= trl-msm.c index 83eb075b6bfa1728137e47741740fda78046514b..96e40c2342bdedb8857629e5038= 97f171a80e579 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -31,6 +31,7 @@ #include "../core.h" #include "../pinconf.h" #include "../pinctrl-utils.h" +#include "../pinmux.h" =20 #include "pinctrl-msm.h" =20 @@ -150,33 +151,6 @@ static int msm_pinmux_request(struct pinctrl_dev *pctl= dev, unsigned offset) return gpiochip_line_is_valid(chip, offset) ? 0 : -EINVAL; } =20 -static int msm_get_functions_count(struct pinctrl_dev *pctldev) -{ - struct msm_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - - return pctrl->soc->nfunctions; -} - -static const char *msm_get_function_name(struct pinctrl_dev *pctldev, - unsigned function) -{ - struct msm_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - - return pctrl->soc->functions[function].name; -} - -static int msm_get_function_groups(struct pinctrl_dev *pctldev, - unsigned function, - const char * const **groups, - unsigned * const num_groups) -{ - struct msm_pinctrl *pctrl =3D pinctrl_dev_get_drvdata(pctldev); - - *groups =3D pctrl->soc->functions[function].groups; - *num_groups =3D pctrl->soc->functions[function].ngroups; - return 0; -} - static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned function, unsigned group) @@ -288,9 +262,9 @@ static int msm_pinmux_request_gpio(struct pinctrl_dev *= pctldev, =20 static const struct pinmux_ops msm_pinmux_ops =3D { .request =3D msm_pinmux_request, - .get_functions_count =3D msm_get_functions_count, - .get_function_name =3D msm_get_function_name, - .get_function_groups =3D msm_get_function_groups, + .get_functions_count =3D pinmux_generic_get_function_count, + .get_function_name =3D pinmux_generic_get_function_name, + .get_function_groups =3D pinmux_generic_get_function_groups, .gpio_request_enable =3D msm_pinmux_request_gpio, .set_mux =3D msm_pinmux_set_mux, }; @@ -1552,6 +1526,7 @@ EXPORT_SYMBOL(msm_pinctrl_dev_pm_ops); int msm_pinctrl_probe(struct platform_device *pdev, const struct msm_pinctrl_soc_data *soc_data) { + const struct pinfunction *func; struct msm_pinctrl *pctrl; struct resource *res; int ret; @@ -1606,6 +1581,14 @@ int msm_pinctrl_probe(struct platform_device *pdev, return PTR_ERR(pctrl->pctrl); } =20 + for (i =3D 0; i < soc_data->nfunctions; i++) { + func =3D &soc_data->functions[i]; + + ret =3D pinmux_generic_add_pinfunction(pctrl->pctrl, func, NULL); + if (ret < 0) + return ret; + } + ret =3D msm_gpio_init(pctrl); if (ret) return ret; --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91EA02E62BB for ; Tue, 12 Aug 2025 08:27:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987254; cv=none; b=nS8RCKk0xTrDVClF2BbrDG8ev/wKXDAWxRh7DvufrdNbc3GDABEFl15sxzbKtHWiLx3rw+sONj6/fHlG7xXP87AYDGKwRcAF7gnLUsL3HCirzi/p/s5rMyHge2SqH8bGyGetyOatbPxdRdc7h7+tb+aCwdv7aCdraZzMJQfYqLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987254; c=relaxed/simple; bh=t6VnOHT23SNHvGQFb4pmKtrrlV85O/PWd2L720CuPrY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZLR/mDvqXwH0Ersek93RbpDUe1yB1MU+Vaii3Od8UsIsgH3u2KKIzjBPF/S2+yTeWehmmigPrBIPwyP6PGdR8EuMKoQzJlLy8lIvz6ex+pVy3CsSgvt9PC57TDyTucCG4Hgrne3gmVArqmcUxiGhYx7VtQ/kDnkfJU7UN7vnkFg= 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=nsYIZKRi; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="nsYIZKRi" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3b79bd3b1f7so2413282f8f.1 for ; Tue, 12 Aug 2025 01:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987249; x=1755592049; 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=qNkdBhL4SofepKXOMLPV0ruEBSHstnzYJRcPgI9HdoA=; b=nsYIZKRiLlYWJJNHxDSShQHkqCpXeOs1GawSjACa6bz+7Gsr4pe0EdYz8WJz20fvOE 8URlOfR3+9bZb929KSBzOSQ1XkY8H/agXyGENCot5vdB3eoS4VrDwOQs1EYyOEscqo+6 MGfWWlZYLbiRLfIWc8vhbq6pEuSCsNcl3TeLCm9kqrnGnhE00bZeNqwmX3fVi8OHMj8G cDgD7yQPFfOUH8I47xNUkMneJ4om3UJoMtoE332SXLWLeFwlAxF07EBzqrWKV57n2Y8Z M7z/hOoIBqtRiFD9gaf0fkBayIbO49Tf8MqNHjl9s8A8ORS2nc/+5DssysClk/VTLqs+ GrCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987249; x=1755592049; 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=qNkdBhL4SofepKXOMLPV0ruEBSHstnzYJRcPgI9HdoA=; b=Pt/2NqcMihmXiVnb8XdY+ZKuynhvy1zQ00XQOYzHMMP5yBfClCiEa7U+QI/x2F1Hb5 J3mu6Uo1RYD6oXmVNWr/nkrWlTWm9cKB1Ap/boT3rXSZIQ/RlAP8WqwN28J8725Xmuuo ChrCkaPmho+wWr6n5mElUVRBiz7CoVhPt78SRU/DTc0Qa2II6GBnRW+YbNSSotulOgxk 7xXCG5CNpiiYPPTzeMrtox2lFKgWOclkzH0HcegdrVthcxYJB4V3B5iT9Mgxkhv1Dv5E ov/GRghKD3ePp9zskaxcZ9EIclnuQPmDG9IaJkmtGNFyuI/oXeSWePkyHh0nsvF11vGO K6sQ== X-Forwarded-Encrypted: i=1; AJvYcCUOHkFZfejcCIxboaqzmTThXkp0kcLXxi93jugPGy/k6eUqQxVUZg75pRAdZScgouZPps5FF0063Wwqc5Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxBdN5H4LraPcTUDjoegdyXi3E5J9ooP2Bg4IjiTcqcXgeWJQFT XgijL174Rb9j4Vsw1sqWCArNGmjvaM9ZQRQ9j0VqzA8xHn9UZJibl3gvtNKbMfryU8U= X-Gm-Gg: ASbGncsMVbXsPetoa6OiCnvYYYKU+cFSP5JqKjtqSFF0wDsPjIGiCsLuSgwCVSv8TUh nxjtI4sU4MpAqOUuI44F00Bm/VHS2R3HdpxHvPblIqATburvT5qdYkSO3gGlgqWsppqgpvjw917 ClDxv4rjxJOdOBLvNaL0897OTP2bJve5mA66GH4T+fMBXNmDuIuYAX8I3VEWmUu/7g2EXyI1Ys1 um+eXSbhzoVlj9zISKdDtO7OJNN6dgXRe9euAtntxyz3oksChzZvh55jdpvVw5v/8jhWFhvS+TG OKiBSBVqisJvdM9PoBAtNwpmZYBvkviGdnIaSfX7lVAZlgg26f+Ci3z0RnLS+P61syPNwZ8yget Jr5GmSuMiXKDx3Ko= X-Google-Smtp-Source: AGHT+IF1aOctmbWm54Tz9TzOo9LheJ0g+HtTHoUDuTShXnMfH1+OQDhTbVjjMEL+NvcX3+PUPhfyHA== X-Received: by 2002:a05:6000:24c3:b0:3b6:d95:a3a4 with SMTP id ffacd0b85a97d-3b910fd0076mr2224430f8f.4.1754987248840; Tue, 12 Aug 2025 01:27:28 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:28 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:11 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-12-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6831; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=O5vQZ4MKE8bL3a5x2rEAk2QUL7J9Hk6iGEI+vVX0jVg=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrZe3Gk6A7K6BuZ6C7ogxwBSW/5+axg5EzCc cPcQp7eSOWJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62QAKCRARpy6gFHHX cr5pEADQKhyLMmGAMuIfT6I9nesZoE3YTWBvYFEsHrpHOXW7IcwofY+k/j4lTrHXWiFSH2aSHiH h09HksFuzIbVBj3KRssbgyxg1qec25nBDbuq+SG327Y8lzA/ElXT7l06ZMgLIhC6WbM+MwKsbmZ fK1xMMKfxJ/FbO2+CMtw2ZK1JEcpsOWRLy48UNMqhQvWhg47T3lFxxjxqJQK75Ga5zNGJif47oG SL4wNsfpGlfU1Ol5kRE1A6Bzp8ET/WvJ0S4SHCf9XLEdnkRFfckWCxKnsm3J7OlXIzUQl8D5ahM YhgYiQcXC3QYeQ26JOOa4soGndCYmSj48a5PTH+zGR7YM25kOINjlq/okZ0YsGLdZnNDudPbi4d ZxpU62lK0QknRASPsHd0k34j6edoSRowVsIJ/81b2ZyduahX2oGqZVO5b4nmaXxWQb14txOwfYf LB1eEbstCLY3GEBhgjPb0rvctBDxQxC1W/EPi2AVS0tNMSEte35/6dBiOunvTpLifOS7kV6UJ2C 0SSFrUGBZGIudW/RB4Giyakl25Mz771OvscKs1Z6m7ebofkxHrHIoQRkKGeEVhs3DrKbP3VQcdk +XtwiXOJbfTT8I/2s/LLdvqGESE5IYGwSFp01drsYWOUm79oxdipIdgQjqexu/b1xGghJkJhzXt 0MEwMGHjLVNQrqg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The name of the pin function has no real meaning to pinctrl core and is there only for human readability of device properties. Some pins are muxed as GPIOs but for "strict" pinmuxers it's impossible to request them as GPIOs if they're bound to a devide - even if their function name explicitly says "gpio". Add a new field to struct pinfunction that allows to pass additional flags to pinctrl core. While we could go with a boolean "is_gpio" field, a flags field is more future-proof. If the PINFUNCTION_FLAG_GPIO is set for a given function, the pin muxed to it can be requested as GPIO even on strict pin controllers. Add a new callback to struct pinmux_ops - function_is_gpio() - that allows pinmux core to inspect a function and see if it's a GPIO one. Provide a generic implementation of this callback. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinmux.c | 37 +++++++++++++++++++++++++++++++++++-- drivers/pinctrl/pinmux.h | 3 +++ include/linux/pinctrl/pinctrl.h | 14 ++++++++++++++ include/linux/pinctrl/pinmux.h | 2 ++ 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 6f5e3ede972bbfa78e279790df359632e2d63485..1f99547deebe085e907a6fc5d66= b01deb55cb41c 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -89,13 +89,18 @@ 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 =3D desc->mux_setting; + bool func_is_gpio =3D false; =20 /* Can't inspect pin, assume it can be used */ if (!desc || !ops) return true; =20 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 +121,9 @@ static int pin_request(struct pinctrl_dev *pctldev, { struct pin_desc *desc; const struct pinmux_ops *ops =3D pctldev->desc->pmxops; + const struct pinctrl_setting_mux *mux_setting; int status =3D -EINVAL; + bool func_is_gpio =3D false; =20 desc =3D pin_desc_get(pctldev, pin); if (desc =3D=3D NULL) { @@ -126,11 +133,16 @@ static int pin_request(struct pinctrl_dev *pctldev, goto out; } =20 + mux_setting =3D desc->mux_setting; + dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n", pin, desc->name, owner); =20 scoped_guard(mutex, &desc->mux_lock) { - if ((!gpio_range || ops->strict) && + if (ops->function_is_gpio && mux_setting) + func_is_gpio =3D ops->function_is_gpio(pctldev, + mux_setting->func); + if ((!gpio_range || ops->strict) && !func_is_gpio && desc->mux_usecount && strcmp(desc->mux_owner, owner)) { dev_err(pctldev->dev, "pin %s already requested by %s; cannot claim for %s\n", @@ -861,6 +873,27 @@ pinmux_generic_get_function(struct pinctrl_dev *pctlde= v, unsigned int selector) } EXPORT_SYMBOL_GPL(pinmux_generic_get_function); =20 +/** + * pinmux_generic_function_is_gpio() - returns true if given function is a= GPIO + * @pctldev: pin controller device + * @selector: function number + * + * Returns: + * True if given function is a GPIO, false otherwise. + */ +bool pinmux_generic_function_is_gpio(struct pinctrl_dev *pctldev, + unsigned int selector) +{ + struct function_desc *function; + + function =3D radix_tree_lookup(&pctldev->pin_function_tree, selector); + if (!function) + return false; + + return function->func->flags & PINFUNCTION_FLAG_GPIO; +} +EXPORT_SYMBOL_GPL(pinmux_generic_function_is_gpio); + /** * pinmux_generic_add_function() - adds a function group * @pctldev: pin controller device diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index 653684290666d78fd725febb5f8bc987b66a1afb..4e826c1a5246cf8b1ac814c8c0d= f24c4e036edd2 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -169,6 +169,9 @@ int pinmux_generic_remove_function(struct pinctrl_dev *= pctldev, =20 void pinmux_generic_free_functions(struct pinctrl_dev *pctldev); =20 +bool pinmux_generic_function_is_gpio(struct pinctrl_dev *pctldev, + unsigned int selector); + #else =20 static inline void pinmux_generic_free_functions(struct pinctrl_dev *pctld= ev) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctr= l.h index d138e18156452e008f24ca06358fcab45135632f..1a8084e2940537f8f0862761d3e= 47c56c8783193 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -11,6 +11,7 @@ #ifndef __LINUX_PINCTRL_PINCTRL_H #define __LINUX_PINCTRL_PINCTRL_H =20 +#include #include =20 struct device; @@ -206,16 +207,20 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev = *pctldev, const char *pin_group, const unsigned int **pins, unsigned int *num_pins); =20 +#define PINFUNCTION_FLAG_GPIO BIT(0) + /** * struct pinfunction - Description about a function * @name: Name of the function * @groups: An array of groups for this function * @ngroups: Number of groups in @groups + * @flags: Additional pin function flags */ struct pinfunction { const char *name; const char * const *groups; size_t ngroups; + unsigned long flags; }; =20 /* Convenience macro to define a single named pinfunction */ @@ -226,6 +231,15 @@ struct pinfunction { .ngroups =3D (_ngroups), \ } =20 +/* Same as PINCTRL_PINFUNCTION() but for the GPIO category of functions */ +#define PINCTRL_GPIO_PINFUNCTION(_name, _groups, _ngroups) \ +(struct pinfunction) { \ + .name =3D (_name), \ + .groups =3D (_groups), \ + .ngroups =3D (_ngroups), \ + .flags =3D PINFUNCTION_FLAG_GPIO, \ + } + #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL) extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); #else diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h index d6f7b58d6ad0cce421aad80463529c9ccc65d68e..6db6c3e1ccc2249d4b4204e6fc1= 9bf7b4397cc81 100644 --- a/include/linux/pinctrl/pinmux.h +++ b/include/linux/pinctrl/pinmux.h @@ -66,6 +66,8 @@ struct pinmux_ops { unsigned int selector, const char * const **groups, unsigned int *num_groups); + bool (*function_is_gpio) (struct pinctrl_dev *pctldev, + unsigned int selector); int (*set_mux) (struct pinctrl_dev *pctldev, unsigned int func_selector, unsigned int group_selector); int (*gpio_request_enable) (struct pinctrl_dev *pctldev, --=20 2.48.1 From nobody Sat Oct 4 22:34:47 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 86EEF2E2DD7 for ; Tue, 12 Aug 2025 08:27:32 +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=1754987256; cv=none; b=fL2ufbwiRJCKl8WYy2FZQZ5iihf63O86VK2UckEmC1bK6/BX4BE54I/P8SVhE8OvskWsrErld9+S4XFA7zhmUm1+cOzrjOtjLIGTEwlQ2YrY7bZhAUoWgx2dlaMrCEOgI39D/2u4my9/4Ytk86fxwODrkhAY2Saa1oX+/eX3X7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987256; c=relaxed/simple; bh=d+pkakvHisIo5B7fnb5foS5HS7QjQMAp1P2iWKiGNdo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RX9569AHQ0stsAl6IIHW9yc0AL0BdzUpyZnUdE8t9fOCg9a/0AhVK0yMi6iL0/BByiqo728a4nbfcsy0iMVi8CjfLBl3nGO4I9XLMEypl4eLHb4y2WJ8favD7TiekRcx7ufhS04Irg6slsGSe7Ni8oO/nDGvcW7j6wFFQp3R7cY= 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=oeKCm8Bs; 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="oeKCm8Bs" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-458b49c98a7so32981665e9.1 for ; Tue, 12 Aug 2025 01:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987250; x=1755592050; 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=oeKCm8BsdOQl4noenc9fnWUoAMXYBMRMyGzcnG/qcUpcOj3i7+9aR6xSrFPPKt0h0/ /eiuWHqNjcMZz+czcoRMU+sHQsVEQ+niDFv3hCIgkmiNATLK+HITlmgb5X6ZDTxkklcr 2YVKCMFmwnTN2eG5PJyx9NqQOOUJWL2P4IXYgiKYmoWHrqbBYeqPZY/svKcm7TxIHJFq kUg38mt7RQvBed5Nh43+2CTW+Ii2a+psZCBQmN1i1r/Adrq4SjEc5UoryXdt7erGS800 vToDoGAoRhUCJ2EF7VJrYfKXdZ2GxcK3pHAmt6Clm89DGvfVi/4RpmZTYpRboLUHyCgD udXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987250; x=1755592050; 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=gXFzSKxNZ6DnVeK8kqqxQbKZ4uT9Fs9wMZiugVQLsMbjnQlgklGmisQE3gbDOFR+ZT EvXKEth/0yhSUh4cSSXD9rPsvaoKG6wPWbXsnzeAEvIaiyqzuSa/8RjqNYibEr9waVcJ AQ2OvnvR/G6MtQG5lSkhcNXzvLHYPpVWWpNj+2iZOf5BxAZun//lCCHbr7VSvjV2bFta Ev6aqzUxWc26xz7vLa7kUw6bUJrV7YPUlAk0GGBqIFQjApW9tIrblsldCgYkX16/w6kC Jgjh9SUMa5LPJvW9DJUC4i/g2DGuFA1fBYvd8Uaw4+Gfv4+5Kc05aTWn+rahqw7XGdG/ 8BRA== X-Forwarded-Encrypted: i=1; AJvYcCVxMvB+4Pu/+BMnOcPHauff4Bspngnau+QbOdS2x1zp9i0mzTeG/WYQh0O00ZsBwOsgEYsdvQbSGcv9AQo=@vger.kernel.org X-Gm-Message-State: AOJu0YzS+582xQQKfcGgr9UCUfwPFwXlcWoXQCUKFkv1N6G0heHGuxLg si1oF8QoSL1SC5CN230U6LbUh1S/ldIckltBTPLUOJnoQici+8bxG437MqTWdI3JAro= X-Gm-Gg: ASbGnctE8fpr+qERvK70Mgsbt71i3+4KKh45JJZogx/N9qwaFdahAyklO6toFjv6Ywr kmeVY11T989kSP2fRPTV8IA1g0ElLk0EHmEK6+ZJJzPXgi+l22y2+P84A4ZhpFVdGEbedGavpxw ooktH9zEnOfty/P/TaBrppzfkhyN20Wa5FZZGAWq1Uw6zhEr7G8nXqFtzzufViC8Tg02gNnwpAo J0o8H40NgytoFiK2tG8FzkQjruPUJLXnFEfy3Jv3mS3q8YMrvNQCcLUmnDeIhp7HW2E1SEs0BHU RnErqORTImQqS+5e1iX8u+/TxFE/NRT3R6XjGKTu6wohCQzw2+bdcCnbLB9dRLQgxvqHhJiXHwP YeLT2JJKoqVfSaZE= X-Google-Smtp-Source: AGHT+IFshlOvFK729Q2HiNSttBuhYGO5t1MHAK8R1Tl8WnDbe/OVg6KL0Aon7hXzH1skJVAbXFREsA== X-Received: by 2002:a5d:64ce:0:b0:3b7:8473:31bd with SMTP id ffacd0b85a97d-3b910f9ab5emr2145237f8f.0.1754987250520; Tue, 12 Aug 2025 01:27:30 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:30 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:12 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-13-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1755; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=1TtCXH0c1SnNyHC+v6gZsytFHMfkLN/q6H3Fm9nBNlI=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrZ/VR1c42/G4TctgjID2K26TyPL0+Vrg6x4 9ryMo61KYWJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62QAKCRARpy6gFHHX cvCLEACYvBW59+M3gJi5bBpvwd53LIDA7Fi09bh7cf6sZQwrhnc+q7Z7XDWdo3gOU7A4yZx8nrE lf5eZ6c3y4GemvfNQDbmd0gu0FBsb/49YwP4k87d87Cdt8fNQd/08Gh/u32vbVpO16l2Je9VuY8 3WZS7KC5/KJQPKXbmxUpP5C2z8mULdzAb4PKQT3dZ3s7f2T+hMUUwinrZx5u1klaFQrlOXkNTTE ba1l7tJFuZ8cxCTDfvpt3YSkOLMkDNM5HWjtfxL/gfiQ11OM42MAVw/QrrA0hu0Ez37gjOlTBx8 ZfQwmRq7Gx7f8H5yXUyG7PrHQL+qjkqv673/8cqJFGcqwAse7K8jlSiu5yAKyPafqYT3neO/k4u APj8e2LBEwVjTBl0IhJdS6/+3AlWncZFxd6E60ROpK0huq9Ds5Fv1bIjzPvmGW2GKpF9MFCbdd/ LX+uj8t8HrERHsIxj8Mov/RLEFgf1ECdyKINeMXsW0lLsbYkkDL62TYt2+/nXHkr6BSKZ1JX3gQ HmqI5/Ni9xR1d9/yvtzD91OFmakZA9BucAoum0WdD/tWCaF24vSjO/wdUntMJqmkxYWMM4CY0ro B/bQkovAcHO+am85u11GmUCv0se9FwLnggtnVe9u5hXKsKp22bC+38tNUX6xqHYV+hSPyXCLYu8 hN8vLrtlGpDakqA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Add a helper macro that wraps PINCTRL_GPIO_PINFUNCTION() for pinctrl-msm pin functions and assign the .function_is_gpio() callback in pinmux_ops. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-msm.c | 1 + drivers/pinctrl/qcom/pinctrl-msm.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinc= trl-msm.c index 96e40c2342bdedb8857629e503897f171a80e579..a5f69464827119dfe2a7781b558= 094b283fca215 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -265,6 +265,7 @@ static const struct pinmux_ops msm_pinmux_ops =3D { .get_functions_count =3D pinmux_generic_get_function_count, .get_function_name =3D pinmux_generic_get_function_name, .get_function_groups =3D pinmux_generic_get_function_groups, + .function_is_gpio =3D pinmux_generic_function_is_gpio, .gpio_request_enable =3D msm_pinmux_request_gpio, .set_mux =3D msm_pinmux_set_mux, }; diff --git a/drivers/pinctrl/qcom/pinctrl-msm.h b/drivers/pinctrl/qcom/pinc= trl-msm.h index d7dc0947bb161868c8f433dc2536719b8afc8bd8..4625fa5320a95a4d24e3a0c98a2= 49e4f163dd4c7 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.h +++ b/drivers/pinctrl/qcom/pinctrl-msm.h @@ -29,6 +29,11 @@ struct pinctrl_pin_desc; fname##_groups, \ ARRAY_SIZE(fname##_groups)) =20 +#define MSM_GPIO_PIN_FUNCTION(fname) \ + [msm_mux_##fname] =3D PINCTRL_GPIO_PINFUNCTION(#fname, \ + fname##_groups, \ + ARRAY_SIZE(fname##_groups)) + #define QCA_PIN_FUNCTION(fname) \ [qca_mux_##fname] =3D PINCTRL_PINFUNCTION(#fname, \ fname##_groups, \ --=20 2.48.1 From nobody Sat Oct 4 22:34:47 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 917F62E7F10 for ; Tue, 12 Aug 2025 08:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987260; cv=none; b=S4XmFTNdC5SOv8f0nuCUBWAp309GFJgyD4yX6NzGiTFqbcXuW/Aep3BIFORs9BLk6TmpV66sCsYWi4RYKSytnZfIHes9NVUnYquF4jDm8ly2hjylxs7DzluENwoToAVBeydXtDrUmmXs1BDF2NN7a90O20GFnO3Yvb3Nifckz4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987260; c=relaxed/simple; bh=vf1MyQqTUh906uie0wJuo8fzAwB562VUK/aVO4anVkc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=olQmdDj0n5KZ/7u0WWt8cr9s9xfXPp/dZm8T5In0vI37F30Ya4eI/mSWhigUM3dNzURbZHlo+ApzhGlPSGRrsxVYuvaUB4GbVE+yOIU3F2caejSlMBudxWLPAyyoMiYMVXkHeIPhBJiaM79c5+Jw2CBkbChtaq4ODd1GIJsv50I= 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=zK4g7WD9; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="zK4g7WD9" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-458baf449cbso50042005e9.0 for ; Tue, 12 Aug 2025 01:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987252; x=1755592052; 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=zK4g7WD902LqM0I4M/xu6VNoB3UkAaUX1amIUWVOkE0BAAsSEPm834ui0UE8/NE5W6 TS0TeYsbZBc+HPDPL+yG8HqmENvcdz0ubSoGxL6yOMkBukBR2son3v9/WdIsUMkHO1pu ox+2EwbhcnbXIgV5C50ehIxSYzcVjGj6oDBWzsLE3acHTuqoWfxCAX1bxxHsQnzTNL/E 9EcSMQ+ftI7qxcScBL9t4gwZGLt5wy4ZGmoZr8axgG4tw9Uqyi1bgGqZ+CivYJ6nlA8o bOWdVBeYiLoYmVjhVgMa4mabAztJgjzo8P69w7RPpazhk2r179EiumcJFQWg5w5UejAs XZGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987252; x=1755592052; 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=AtXA7C9DSHW9dioPiML2w9vvqVPLGrpXF7D0U+8mA6DVV5gFhplQFx1gupam1TxAge 0ztK/uq3M1wPPUyu27sc8uOZoevujkYGR2NMWhTkT9JkPQ2jbWG3oZr4y1xJahSbYbep TFk/8A0iQgv2pvgulk/iZqmqfwwE4VNhGp9EU/pWBmSriD+Z9EAuzIJ7ee4IDP2f5JbM kfnRiUeCzn3XFJJNyJ+2jD37fQ0DVmAjlLnXUtrjNu/jjOwv8CKRYaOdvyktTLSAtCnD bTQnNKXLy6aa+ITjTF1IhN8gBvPyfl0zqNyQTg/tvgfU2pSrRQjoe2qpZI60IrPhCRCk VvDw== X-Forwarded-Encrypted: i=1; AJvYcCX/Qa4/50YeceXUxmz4CdoRQN82ypdOPbiSqclEBBBm4iDTXCr1eBinKGJ6TFW8NsC/FyJReK6zUmy36wo=@vger.kernel.org X-Gm-Message-State: AOJu0YyJpdd+QNVFdoz7LdgjoLL2y1RbNVIaQi7JIMJCwgp1kYkkLvgs WB3S80NWir/oOInmdchKb3Kjc7cVjOuSwz7NrxIwdGf4RZz1d6ASXIrRuOov3uHtMSo= X-Gm-Gg: ASbGnct199q4iHXq80oQ82L4uK4O4XfuX7zbo0zmJmXMikiRAeMq01ulzEt1b0xDkAC VTuIEfwAAfc3FPbNXezKrLARu+RClLZ7l8y0a/hu8QF4mOOIGy+CS5JLUTg6p/lO+Q8zBzIK1gr UwOAOiex+qPwCo5hki90QvoJp+DY3xv5y2Py1bzLIx6yvK1iLN38/0BYghfqAt0KNUBOl5Z9lz+ XJVdR3mS9PmI846pYPnUmtKlp3hfNnZiLs2ut5FBj5a0vzaTB+0y29NNtInyYDFQGFN/ZSVsBU2 gF/agYGOzcNVdtgmbPrkmKNq6Zhnf5HH8lXOoCePvPSybik+VJ9SIB5Zs6z0pkaY/3utIW4lUOH 9zpPYIOfWnZ++rnc= X-Google-Smtp-Source: AGHT+IGAT+yrW4EGuKkhDjsCd9DDEzxiwycfLIQ7ogC+jspy9kzADQyf9wP5ZP0khrlyZA2+JvOX6Q== X-Received: by 2002:a05:6000:178c:b0:3b7:8a49:eed0 with SMTP id ffacd0b85a97d-3b910fd9b17mr2078998f8f.22.1754987252291; Tue, 12 Aug 2025 01:27:32 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:31 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:13 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-14-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=35951; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=nHsco2Wzr2CAT5gE0mq3nSAwj0pKQdcWwYpWK83YXU0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrZhBeY5SG4bny1pFhK5ASy4hfy0jGaYtAfn v3nW8fb7b6JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62QAKCRARpy6gFHHX cmDMD/492yEQV6iiYDVthHLZuIylGSQggBfIHXJMBVonlBr7xr4kKdUXqxWOAi5IzexJgsfTxun 0gUJ0NAfn3EB0qJxShxYytT20u1K8tFn/BJPe8BuHvR1CS4w37ik3Idu/kqEp1y8w22xa5PR69u KCcvSen9TLRHnwN/zYBy2JYPYSk7TdUUAfoBG55raAexVtVEePaVWcEC5aDIoKkJpFJv3JvmE25 VNM5OAWBFrVO5l04tL9RQOhqz3/HZggLqGP4kCMUPNjjXjAOsr4wg6A1+tAWeXIYzrRo2kdQxGL MhTdOy+YPQBZrq36UNPDilG9UJlCSWS8Exk6JSMu07Gup+221ScGdews0CRUmgMpn3bZwSEtgDI PlxBLEzXQQ2jfGLJqGNCyUgPHRJU6BxTrEoj7kOkFniWngbQ7KLeuP1/cRUhv67tFl/Fqqzsymq kYvnjry9miFLiufXVnPapqvvDCiOjxaAZnwuTN+6uIz+AVM1zWRfKylySLr+5BuPkTd6x8uB19F 9XaqBa5c8LBPux5YUo6mmlFf405w/TmnGo1iBt4r1c5cskVv1hc8jCgAE4fFE1w85uIBdb2C2ZY JSJKn5QsJr3BaZ1kumpHyX/liUQrKcZfFE6DWuNgOvaD2TcJq3gsyyadZW/v/iLTha5/fZvRwiS CYrTwh6XK5rb+fA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Allow pins muxed to the "gpio" or "egpio" function to be requested as GPIOs even if pinmux_ops say the controller should be strict. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-ipq5018.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq5332.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq5424.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq6018.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq8074.c | 2 +- drivers/pinctrl/qcom/pinctrl-ipq9574.c | 2 +- drivers/pinctrl/qcom/pinctrl-mdm9607.c | 2 +- drivers/pinctrl/qcom/pinctrl-mdm9615.c | 2 +- drivers/pinctrl/qcom/pinctrl-milos.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8226.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8660.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8909.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8916.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8917.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8953.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8960.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8976.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8994.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8996.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8998.c | 2 +- drivers/pinctrl/qcom/pinctrl-msm8x74.c | 2 +- drivers/pinctrl/qcom/pinctrl-qcm2290.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-qcs404.c | 2 +- drivers/pinctrl/qcom/pinctrl-qcs615.c | 2 +- drivers/pinctrl/qcom/pinctrl-qcs8300.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-qdu1000.c | 2 +- drivers/pinctrl/qcom/pinctrl-sa8775p.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sar2130p.c | 2 +- drivers/pinctrl/qcom/pinctrl-sc7180.c | 2 +- drivers/pinctrl/qcom/pinctrl-sc7280.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sc8180x.c | 2 +- drivers/pinctrl/qcom/pinctrl-sc8280xp.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sdm660.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdm670.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdm845.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdx55.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdx65.c | 2 +- drivers/pinctrl/qcom/pinctrl-sdx75.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm4450.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6115.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6125.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6350.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm6375.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm7150.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8150.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8250.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8350.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8450.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sm8550.c | 2 +- drivers/pinctrl/qcom/pinctrl-sm8650.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sm8750.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-x1e80100.c | 2 +- 52 files changed, 60 insertions(+), 60 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5018.c b/drivers/pinctrl/qcom/= pinctrl-ipq5018.c index 10b99d5d8a11db644e974a80b9d7d04ffc09bd4c..cbf34854f8826507430a9bb5a52= 7bdc5d87b9a8c 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq5018.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq5018.c @@ -630,7 +630,7 @@ static const struct pinfunction ipq5018_functions[] =3D= { MSM_PIN_FUNCTION(eud_gpio), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(led0), MSM_PIN_FUNCTION(led2), MSM_PIN_FUNCTION(mac0), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5332.c b/drivers/pinctrl/qcom/= pinctrl-ipq5332.c index 1ac2fc09c11923cd716495b16a7f4af5686ce398..239cbe75f198d3fadf39ed13387= f5cea625a8f63 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq5332.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq5332.c @@ -692,7 +692,7 @@ static const struct pinfunction ipq5332_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(lock_det), MSM_PIN_FUNCTION(mac0), MSM_PIN_FUNCTION(mac1), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5424.c b/drivers/pinctrl/qcom/= pinctrl-ipq5424.c index 7ff1f8acc1a3a81037298464130fda59f329d53e..67b452a033d62340d669bfff4b6= ae7b6d6cc430d 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq5424.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq5424.c @@ -641,7 +641,7 @@ static const struct pinfunction ipq5424_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2c0_scl), MSM_PIN_FUNCTION(i2c0_sda), MSM_PIN_FUNCTION(i2c1_scl), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq6018.c b/drivers/pinctrl/qcom/= pinctrl-ipq6018.c index a4ba980252e187879947e7057004fa48815f2620..be177fb0a92d957bd57126df9c2= a495b69ef1457 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq6018.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq6018.c @@ -891,7 +891,7 @@ static const struct pinfunction ipq6018_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(lpass_aud), MSM_PIN_FUNCTION(lpass_aud0), MSM_PIN_FUNCTION(lpass_aud1), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq8074.c b/drivers/pinctrl/qcom/= pinctrl-ipq8074.c index 482f13282fc2be951032cbe6dc5100bf9129ea5f..e94de90833140c83d50535778e6= 4044bb315c4ea 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq8074.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq8074.c @@ -838,7 +838,7 @@ static const struct pinfunction ipq8074_functions[] =3D= { MSM_PIN_FUNCTION(dbg_out), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(ldo_en), MSM_PIN_FUNCTION(ldo_update), MSM_PIN_FUNCTION(led0), diff --git a/drivers/pinctrl/qcom/pinctrl-ipq9574.c b/drivers/pinctrl/qcom/= pinctrl-ipq9574.c index 89c05d8eb55034dea3e1c7299ede6567c20e0159..3ed093ea8eb9074426934336dcf= b9d74e3b8af22 100644 --- a/drivers/pinctrl/qcom/pinctrl-ipq9574.c +++ b/drivers/pinctrl/qcom/pinctrl-ipq9574.c @@ -651,7 +651,7 @@ static const struct pinfunction ipq9574_functions[] =3D= { MSM_PIN_FUNCTION(dwc_ddrphy), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(mac), MSM_PIN_FUNCTION(mdc), MSM_PIN_FUNCTION(mdio), diff --git a/drivers/pinctrl/qcom/pinctrl-mdm9607.c b/drivers/pinctrl/qcom/= pinctrl-mdm9607.c index 3e18ba124fede923f56eab1aec5aaf875f06e343..cef330547ce78d4c8cc873251d7= 7f18b29aff57b 100644 --- a/drivers/pinctrl/qcom/pinctrl-mdm9607.c +++ b/drivers/pinctrl/qcom/pinctrl-mdm9607.c @@ -861,7 +861,7 @@ static const struct pinfunction mdm9607_functions[] =3D= { MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), MSM_PIN_FUNCTION(gmac_mdio), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(lcd_rst), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-mdm9615.c b/drivers/pinctrl/qcom/= pinctrl-mdm9615.c index bea1ca3d1b7f84c28c23af2a52cc464da44a90b0..729fe3d7e14efcfa247da2daac9= 99c4038e1613c 100644 --- a/drivers/pinctrl/qcom/pinctrl-mdm9615.c +++ b/drivers/pinctrl/qcom/pinctrl-mdm9615.c @@ -313,7 +313,7 @@ static const char * const cdc_mclk_groups[] =3D { }; =20 static const struct pinfunction mdm9615_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsbi2_i2c), MSM_PIN_FUNCTION(gsbi3), MSM_PIN_FUNCTION(gsbi4), diff --git a/drivers/pinctrl/qcom/pinctrl-milos.c b/drivers/pinctrl/qcom/pi= nctrl-milos.c index d11a7bbcd7331675bdd979f5a9933d9ff226c823..19abd5233a2c54e9a5fcf3a2ed4= 4056471196146 100644 --- a/drivers/pinctrl/qcom/pinctrl-milos.c +++ b/drivers/pinctrl/qcom/pinctrl-milos.c @@ -974,7 +974,7 @@ static const char *const wcn_sw_ctrl_groups[] =3D { }; =20 static const struct pinfunction milos_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8226.c b/drivers/pinctrl/qcom/= pinctrl-msm8226.c index f9a957347340813f87e58d3bcbea81faa9d6255e..a81aa092ef1240c9e951352720d= 48db6d269aff9 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8226.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8226.c @@ -483,7 +483,7 @@ static const struct pinfunction msm8226_functions[] =3D= { MSM_PIN_FUNCTION(cci_i2c0), MSM_PIN_FUNCTION(gp0_clk), MSM_PIN_FUNCTION(gp1_clk), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(sdc3), MSM_PIN_FUNCTION(wlan), }; diff --git a/drivers/pinctrl/qcom/pinctrl-msm8660.c b/drivers/pinctrl/qcom/= pinctrl-msm8660.c index 4dbc19ffd80efcdab059a253904e1ffe95fd36f7..5ded00396cd949f432c4bdcd3b1= 224cbfae34f8c 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8660.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8660.c @@ -714,7 +714,7 @@ static const char * const ebi2_groups[] =3D { }; =20 static const struct pinfunction msm8660_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(cam_mclk), MSM_PIN_FUNCTION(dsub), MSM_PIN_FUNCTION(ext_gps), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8909.c b/drivers/pinctrl/qcom/= pinctrl-msm8909.c index 0aa4f77b774f45947ffade7d167dd25cc4da5297..544a52fb8f3d6e6abfd97e2c073= 6e8242b51d7ba 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8909.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8909.c @@ -696,7 +696,7 @@ static const struct pinfunction msm8909_functions[] =3D= { MSM_PIN_FUNCTION(gcc_gp3_clk_a), MSM_PIN_FUNCTION(gcc_gp3_clk_b), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(ldo_en), MSM_PIN_FUNCTION(ldo_update), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8916.c b/drivers/pinctrl/qcom/= pinctrl-msm8916.c index 0dfc6dd33d58b2d9df7a5cc3f7ff8890976207d3..b1b6934bb4b6357f04d84ce9c24= 4ba930c1916ba 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8916.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8916.c @@ -743,7 +743,7 @@ static const struct pinfunction msm8916_functions[] =3D= { MSM_PIN_FUNCTION(gcc_gp2_clk_b), MSM_PIN_FUNCTION(gcc_gp3_clk_a), MSM_PIN_FUNCTION(gcc_gp3_clk_b), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx0), MSM_PIN_FUNCTION(gsm0_tx1), MSM_PIN_FUNCTION(gsm1_tx0), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8917.c b/drivers/pinctrl/qcom/= pinctrl-msm8917.c index 2e1a94ab18b219f818c591ff3b07280578822d1a..f23d92d6615b8926dc04ba0056c= bce6715cc7b21 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8917.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8917.c @@ -1302,7 +1302,7 @@ static const struct pinfunction msm8917_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3_clk_b), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(key_focus), MSM_PIN_FUNCTION(key_snapshot), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8953.c b/drivers/pinctrl/qcom/= pinctrl-msm8953.c index 956383341a7a777edf28c710353dc6deab124ef9..67db062fdf5628fb41588f2dc5a= 79a9e3499e5b6 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8953.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8953.c @@ -1533,7 +1533,7 @@ static const struct pinfunction msm8953_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3_clk_b), MSM_PIN_FUNCTION(gcc_plltest), MSM_PIN_FUNCTION(gcc_tlmm), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm0_tx), MSM_PIN_FUNCTION(gsm1_tx), MSM_PIN_FUNCTION(gyro_int), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8960.c b/drivers/pinctrl/qcom/= pinctrl-msm8960.c index a937ea867de709326a2aea77f980cae1d8480f35..2fb15208aba050a1bf669a2e304= e389fd10fe0be 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8960.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8960.c @@ -974,7 +974,7 @@ static const struct pinfunction msm8960_functions[] =3D= { MSM_PIN_FUNCTION(gp_pdm_1b), MSM_PIN_FUNCTION(gp_pdm_2a), MSM_PIN_FUNCTION(gp_pdm_2b), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsbi1), MSM_PIN_FUNCTION(gsbi1_spi_cs1_n), MSM_PIN_FUNCTION(gsbi1_spi_cs2a_n), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8976.c b/drivers/pinctrl/qcom/= pinctrl-msm8976.c index 3bcb03387781f803bf7e0251496a88a43b562b8d..345539b9e696f0decdb02b24eb0= f966c7439af9d 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8976.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8976.c @@ -812,7 +812,7 @@ static const char * const ss_switch_groups[] =3D { }; =20 static const struct pinfunction msm8976_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(blsp_spi1), MSM_PIN_FUNCTION(smb_int), MSM_PIN_FUNCTION(blsp_i2c1), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8994.c b/drivers/pinctrl/qcom/= pinctrl-msm8994.c index 7a3b6cbccb687c8b5040ee6bf372f092f21aa872..94e042d1f4b2a5f20c3c3e9287b= 254e1e06c4050 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8994.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8994.c @@ -1071,7 +1071,7 @@ static const struct pinfunction msm8994_functions[] = =3D { MSM_PIN_FUNCTION(uim2), MSM_PIN_FUNCTION(uim3), MSM_PIN_FUNCTION(uim4), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), }; =20 static const struct msm_pingroup msm8994_groups[] =3D { diff --git a/drivers/pinctrl/qcom/pinctrl-msm8996.c b/drivers/pinctrl/qcom/= pinctrl-msm8996.c index d86d83106d3ba12343a4685e5b87c661f823c35b..e5b55693d02377c1bd992504a9d= 15a9ce015cf84 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8996.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8996.c @@ -1532,7 +1532,7 @@ static const struct pinfunction msm8996_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp2_clk_b), MSM_PIN_FUNCTION(gcc_gp3_clk_a), MSM_PIN_FUNCTION(gcc_gp3_clk_b), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gsm_tx), MSM_PIN_FUNCTION(hdmi_cec), MSM_PIN_FUNCTION(hdmi_ddc), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8998.c b/drivers/pinctrl/qcom/= pinctrl-msm8998.c index 1daee815888f54b711505dfacefd614df83affc0..b727593af34af94925fd9c938e3= c03c40ad59eaa 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8998.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8998.c @@ -1160,7 +1160,7 @@ static const char * const mss_lte_groups[] =3D { }; =20 static const struct pinfunction msm8998_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-msm8x74.c b/drivers/pinctrl/qcom/= pinctrl-msm8x74.c index 8253aa25775b247dc54a377c9781094e465e22b6..202bec003e96f1d2d68703676e6= e8a88f1ffdae5 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8x74.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8x74.c @@ -778,7 +778,7 @@ static const char * const slimbus_groups[] =3D { "gpio7= 0", "gpio71" }; static const char * const hsic_ctl_groups[] =3D { "hsic_strobe", "hsic_dat= a" }; =20 static const struct pinfunction msm8x74_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(cci_i2c0), MSM_PIN_FUNCTION(cci_i2c1), MSM_PIN_FUNCTION(uim1), diff --git a/drivers/pinctrl/qcom/pinctrl-qcm2290.c b/drivers/pinctrl/qcom/= pinctrl-qcm2290.c index eeeec6434f6a68a588ff58641b7c25c261b5749a..38200957451e1975b7215eae6a2= d10329a30a57d 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcm2290.c +++ b/drivers/pinctrl/qcom/pinctrl-qcm2290.c @@ -870,11 +870,11 @@ static const struct pinfunction qcm2290_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi1), MSM_PIN_FUNCTION(ddr_pxi2), MSM_PIN_FUNCTION(ddr_pxi3), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), diff --git a/drivers/pinctrl/qcom/pinctrl-qcs404.c b/drivers/pinctrl/qcom/p= inctrl-qcs404.c index 54e3b44353494e9398a88702945b7a85ff901b4d..0b8db2c7e58a9b6f6b832c89987= 66f2711068dd2 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcs404.c +++ b/drivers/pinctrl/qcom/pinctrl-qcs404.c @@ -1296,7 +1296,7 @@ static const char * const i2s_3_ws_a_groups[] =3D { }; =20 static const struct pinfunction qcs404_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(hdmi_tx), MSM_PIN_FUNCTION(hdmi_ddc), MSM_PIN_FUNCTION(blsp_uart_tx_a2), diff --git a/drivers/pinctrl/qcom/pinctrl-qcs615.c b/drivers/pinctrl/qcom/p= inctrl-qcs615.c index 2a943bc46a6299899abd87523f24e7e291f24c57..4dfa820d4e77ce8157a3503ee8e= c6e426b54e030 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcs615.c +++ b/drivers/pinctrl/qcom/pinctrl-qcs615.c @@ -819,7 +819,7 @@ static const char *const wsa_data_groups[] =3D { }; =20 static const struct pinfunction qcs615_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(aoss_cti), diff --git a/drivers/pinctrl/qcom/pinctrl-qcs8300.c b/drivers/pinctrl/qcom/= pinctrl-qcs8300.c index d6437e26392b60f5d345f2591e98516a9d933a0f..f1af1a620684cd48e0282d4452c= 3f00af6ca0302 100644 --- a/drivers/pinctrl/qcom/pinctrl-qcs8300.c +++ b/drivers/pinctrl/qcom/pinctrl-qcs8300.c @@ -929,7 +929,7 @@ static const char *const vsense_trigger_groups[] =3D { }; =20 static const struct pinfunction qcs8300_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb2), @@ -949,7 +949,7 @@ static const struct pinfunction qcs8300_functions[] =3D= { MSM_PIN_FUNCTION(edp0_hot), MSM_PIN_FUNCTION(edp0_lcd), MSM_PIN_FUNCTION(edp1_lcd), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(emac0_mcg0), MSM_PIN_FUNCTION(emac0_mcg1), MSM_PIN_FUNCTION(emac0_mcg2), diff --git a/drivers/pinctrl/qcom/pinctrl-qdu1000.c b/drivers/pinctrl/qcom/= pinctrl-qdu1000.c index eacb89fa388850ef39ceb50497df9e5cca54191c..7c535698a780041c2660c08d221= 46c8d700ce081 100644 --- a/drivers/pinctrl/qcom/pinctrl-qdu1000.c +++ b/drivers/pinctrl/qcom/pinctrl-qdu1000.c @@ -904,7 +904,7 @@ static const char * const vsense_trigger_groups[] =3D { }; =20 static const struct pinfunction qdu1000_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(cmo_pri), MSM_PIN_FUNCTION(si5518_int), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sa8775p.c b/drivers/pinctrl/qcom/= pinctrl-sa8775p.c index 1b62eb3e6620c978225c5fd2ab541451cbe93093..53f28b9c49ba2dba7cfbbeb1377= 4d011bd31fae9 100644 --- a/drivers/pinctrl/qcom/pinctrl-sa8775p.c +++ b/drivers/pinctrl/qcom/pinctrl-sa8775p.c @@ -1181,7 +1181,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction sa8775p_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb2), MSM_PIN_FUNCTION(audio_ref), @@ -1217,7 +1217,7 @@ static const struct pinfunction sa8775p_functions[] = =3D { MSM_PIN_FUNCTION(edp2_lcd), MSM_PIN_FUNCTION(edp3_hot), MSM_PIN_FUNCTION(edp3_lcd), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(emac0_mcg0), MSM_PIN_FUNCTION(emac0_mcg1), MSM_PIN_FUNCTION(emac0_mcg2), diff --git a/drivers/pinctrl/qcom/pinctrl-sar2130p.c b/drivers/pinctrl/qcom= /pinctrl-sar2130p.c index 3dd1b5e5cfee489ec34b16ee2ae1c8d2c2756553..4a53f4ee20418e755926770693f= 81a582c431e6f 100644 --- a/drivers/pinctrl/qcom/pinctrl-sar2130p.c +++ b/drivers/pinctrl/qcom/pinctrl-sar2130p.c @@ -1128,7 +1128,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction sar2130p_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(qup0), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sc7180.c b/drivers/pinctrl/qcom/p= inctrl-sc7180.c index c43fe10b71add7d6294c90e86578ed472b8759a3..3eae51472b137372f358278a7fb= 04ace7430bcf4 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc7180.c +++ b/drivers/pinctrl/qcom/pinctrl-sc7180.c @@ -903,7 +903,7 @@ static const struct pinfunction sc7180_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), diff --git a/drivers/pinctrl/qcom/pinctrl-sc7280.c b/drivers/pinctrl/qcom/p= inctrl-sc7280.c index 1b070e9d41f5972470d245edb821d202ca24522b..44e09608aad07acbd8354d5cb3e= 7f02b6e736f01 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc7280.c +++ b/drivers/pinctrl/qcom/pinctrl-sc7280.c @@ -1153,11 +1153,11 @@ static const struct pinfunction sc7280_functions[] = =3D { MSM_PIN_FUNCTION(dp_lcd), MSM_PIN_FUNCTION(edp_hot), MSM_PIN_FUNCTION(edp_lcd), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(host2wlan_sol), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sc8180x.c b/drivers/pinctrl/qcom/= pinctrl-sc8180x.c index 26dd165d154348a8659720335ec16c3e5ace30ef..d494e176383d25a369c217d1c64= 9b580c374d35b 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc8180x.c +++ b/drivers/pinctrl/qcom/pinctrl-sc8180x.c @@ -1272,7 +1272,7 @@ static const struct pinfunction sc8180x_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_gp4), MSM_PIN_FUNCTION(gcc_gp5), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps), MSM_PIN_FUNCTION(grfc), MSM_PIN_FUNCTION(hs1_mi2s), diff --git a/drivers/pinctrl/qcom/pinctrl-sc8280xp.c b/drivers/pinctrl/qcom= /pinctrl-sc8280xp.c index 6ccd7e5648d420072f7ce467d92ef0764a6d7764..cf8297e8b8f8c98add4cc5d305e= 99a2cd1f7a52a 100644 --- a/drivers/pinctrl/qcom/pinctrl-sc8280xp.c +++ b/drivers/pinctrl/qcom/pinctrl-sc8280xp.c @@ -1506,7 +1506,7 @@ static const struct pinfunction sc8280xp_functions[] = =3D { MSM_PIN_FUNCTION(edp2_lcd), MSM_PIN_FUNCTION(edp3_lcd), MSM_PIN_FUNCTION(edp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(emac0_dll), MSM_PIN_FUNCTION(emac0_mcg0), MSM_PIN_FUNCTION(emac0_mcg1), @@ -1527,7 +1527,7 @@ static const struct pinfunction sc8280xp_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_gp4), MSM_PIN_FUNCTION(gcc_gp5), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(hs1_mi2s), MSM_PIN_FUNCTION(hs2_mi2s), MSM_PIN_FUNCTION(hs3_mi2s), diff --git a/drivers/pinctrl/qcom/pinctrl-sdm660.c b/drivers/pinctrl/qcom/p= inctrl-sdm660.c index 1a78288f1bc832837d5c72d9eb1659f397d79b94..687d986de75c4df5d91c6cda3c4= 3beecfb24795b 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdm660.c +++ b/drivers/pinctrl/qcom/pinctrl-sdm660.c @@ -1157,7 +1157,7 @@ static const struct pinfunction sdm660_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps_tx_a), MSM_PIN_FUNCTION(gps_tx_b), MSM_PIN_FUNCTION(gps_tx_c), diff --git a/drivers/pinctrl/qcom/pinctrl-sdm670.c b/drivers/pinctrl/qcom/p= inctrl-sdm670.c index 0fe1fa94cd6da13591397442a63ce8daec9f4674..486b72edf7b4ec9d30bbbffbf53= d41db2c9e8157 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdm670.c +++ b/drivers/pinctrl/qcom/pinctrl-sdm670.c @@ -991,7 +991,7 @@ static const char * const mss_lte_groups[] =3D { }; =20 static const struct pinfunction sdm670_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sdm845.c b/drivers/pinctrl/qcom/p= inctrl-sdm845.c index 0446e291aa4831da439af12b7934fbda5915ee5a..4cf8575797a0f49646e0dd7a934= 80dfbd6ba3a04 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdm845.c +++ b/drivers/pinctrl/qcom/pinctrl-sdm845.c @@ -976,7 +976,7 @@ static const char * const tsif1_sync_groups[] =3D { }; =20 static const struct pinfunction sdm845_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sdx55.c b/drivers/pinctrl/qcom/pi= nctrl-sdx55.c index 2c17bf889146362edf9f482d33b17d35a255882e..79a7010b73f187f4aeab8ff7e27= 461984c1c9c3f 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdx55.c +++ b/drivers/pinctrl/qcom/pinctrl-sdx55.c @@ -796,7 +796,7 @@ static const struct pinfunction sdx55_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2s_mclk), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-sdx65.c b/drivers/pinctrl/qcom/pi= nctrl-sdx65.c index 85b5c0206dbd199c6efc15aad10784d20c1addde..cc8a99a6a91ed253883535f3eb0= 338939db9a677 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdx65.c +++ b/drivers/pinctrl/qcom/pinctrl-sdx65.c @@ -732,7 +732,7 @@ static const struct pinfunction sdx65_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2s_mclk), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-sdx75.c b/drivers/pinctrl/qcom/pi= nctrl-sdx75.c index ab13a3a57a830781f35916ff508ca65d6699271d..4078d83d818c3352253563fc452= 73a293cfe4ce8 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdx75.c +++ b/drivers/pinctrl/qcom/pinctrl-sdx75.c @@ -852,7 +852,7 @@ static const struct pinfunction sdx75_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp2_clk), MSM_PIN_FUNCTION(gcc_gp3_clk), MSM_PIN_FUNCTION(gcc_plltest), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(i2s_mclk), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(ldo_en), diff --git a/drivers/pinctrl/qcom/pinctrl-sm4450.c b/drivers/pinctrl/qcom/p= inctrl-sm4450.c index 1ecdf1ab4f275ede7cb629321f9c37d3f81a25e9..d51e271e336101796b75d64e56f= 573f3547f1121 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm4450.c +++ b/drivers/pinctrl/qcom/pinctrl-sm4450.c @@ -722,7 +722,7 @@ static const char * const wlan1_adc_dtest1_groups[] =3D= { }; =20 static const struct pinfunction sm4450_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb0), MSM_PIN_FUNCTION(audio_ref_clk), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6115.c b/drivers/pinctrl/qcom/p= inctrl-sm6115.c index c273efa4399630a2187845382e231fe150d997fd..06700685ea2a380b84464d17955= d040e55eb587c 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6115.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6115.c @@ -687,7 +687,7 @@ static const struct pinfunction sm6115_functions[] =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6125.c b/drivers/pinctrl/qcom/p= inctrl-sm6125.c index 5092f20e0c1bdee2e99b768f12cfbec31972c24c..5d3d1e402345ebb86524b508c45= cf9fc9a0f2031 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6125.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6125.c @@ -943,7 +943,7 @@ static const char * const dmic1_data_groups[] =3D { =20 static const struct pinfunction sm6125_functions[] =3D { MSM_PIN_FUNCTION(qup00), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(qdss), MSM_PIN_FUNCTION(qup01), MSM_PIN_FUNCTION(qup02), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6350.c b/drivers/pinctrl/qcom/p= inctrl-sm6350.c index ba4686c86c54b8c1dc32522c83587521e149a5ae..220fb582cac9fcc97271cc0feb2= adc5b32c85994 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6350.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6350.c @@ -1048,7 +1048,7 @@ static const struct pinfunction sm6350_functions[] = =3D { MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps_tx), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sm6375.c b/drivers/pinctrl/qcom/p= inctrl-sm6375.c index 49031571e65ee3291fb1e5269e071a08a77c87de..08b8ef6efaf09741e8826e08a2c= 12ef49680504a 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm6375.c +++ b/drivers/pinctrl/qcom/pinctrl-sm6375.c @@ -1172,7 +1172,7 @@ static const struct pinfunction sm6375_functions[] = =3D { MSM_PIN_FUNCTION(gp_pdm0), MSM_PIN_FUNCTION(gp_pdm1), MSM_PIN_FUNCTION(gp_pdm2), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(gps_tx), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), diff --git a/drivers/pinctrl/qcom/pinctrl-sm7150.c b/drivers/pinctrl/qcom/p= inctrl-sm7150.c index 6e89966cd70e34bcb74cfb50e80e110e40655b0e..78dd8153a4d4e5bb68dd5d22aa7= f2b6dc6a5fddb 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm7150.c +++ b/drivers/pinctrl/qcom/pinctrl-sm7150.c @@ -960,7 +960,7 @@ static const char * const wsa_data_groups[] =3D { }; =20 static const struct pinfunction sm7150_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(adsp_ext), MSM_PIN_FUNCTION(agera_pll), MSM_PIN_FUNCTION(aoss_cti), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8150.c b/drivers/pinctrl/qcom/p= inctrl-sm8150.c index 794ed99463f76032f56be9464a4aa3018537df94..ad861cd66958c4faa929737e508= 8b82a35ffc95b 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8150.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8150.c @@ -1217,7 +1217,7 @@ static const struct pinfunction sm8150_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(hs1_mi2s), MSM_PIN_FUNCTION(hs2_mi2s), MSM_PIN_FUNCTION(hs3_mi2s), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8250.c b/drivers/pinctrl/qcom/p= inctrl-sm8250.c index fb6f005d64f53f318d58e69681f07e36404439cf..6021d9f6e407ef57a6b1ebaaa27= 039c0fea7e18c 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8250.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8250.c @@ -1021,7 +1021,7 @@ static const struct pinfunction sm8250_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(lpass_slimbus), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8350.c b/drivers/pinctrl/qcom/p= inctrl-sm8350.c index c8a3f39ce6f1b8565a783f04100269b3cadb9bcc..99949b552021131f5aade06a80b= d01799835e67a 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8350.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8350.c @@ -1267,7 +1267,7 @@ static const struct pinfunction sm8350_functions[] = =3D { MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(ibi_i3c), MSM_PIN_FUNCTION(jitter_bist), MSM_PIN_FUNCTION(lpass_slimbus), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8450.c b/drivers/pinctrl/qcom/p= inctrl-sm8450.c index f2e52d5a0f9369d21922d0651539908d592301e5..9889fc5dc2cd204588abd06cfd7= d1ae0e4513af0 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8450.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8450.c @@ -1269,7 +1269,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction sm8450_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aon_cam), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), @@ -1291,7 +1291,7 @@ static const struct pinfunction sm8450_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi2), MSM_PIN_FUNCTION(ddr_pxi3), MSM_PIN_FUNCTION(dp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8550.c b/drivers/pinctrl/qcom/p= inctrl-sm8550.c index 1b4496cb39eb46b2b660ef213e1f3c8fdac2b21e..10a62031fdfd044f851165e3460= 59d1834ff7c9c 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8550.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8550.c @@ -1340,7 +1340,7 @@ static const char *const vsense_trigger_mirnat_groups= [] =3D { }; =20 static const struct pinfunction sm8550_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aon_cci), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8650.c b/drivers/pinctrl/qcom/p= inctrl-sm8650.c index 449a0077f4b10666ecd9dfaae8e0057a91e181a6..e2ae038002060d2f93c091c716b= 1ec7fb9b6498d 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8650.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8650.c @@ -1328,7 +1328,7 @@ static const char *const vsense_trigger_mirnat_groups= [] =3D { }; =20 static const struct pinfunction sm8650_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), @@ -1359,7 +1359,7 @@ static const struct pinfunction sm8650_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi3), MSM_PIN_FUNCTION(do_not), MSM_PIN_FUNCTION(dp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), diff --git a/drivers/pinctrl/qcom/pinctrl-sm8750.c b/drivers/pinctrl/qcom/p= inctrl-sm8750.c index 8516693d1db51d3e890e298ea6500ae62333bc69..6f92f176edd4593563a95dc8b0c= fde2b6ad3a213 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8750.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8750.c @@ -1290,7 +1290,7 @@ static const char *const wcn_sw_ctrl_groups[] =3D { }; =20 static const struct pinfunction sm8750_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(aoss_cti), MSM_PIN_FUNCTION(atest_char), MSM_PIN_FUNCTION(atest_usb), @@ -1319,7 +1319,7 @@ static const struct pinfunction sm8750_functions[] = =3D { MSM_PIN_FUNCTION(ddr_pxi2), MSM_PIN_FUNCTION(ddr_pxi3), MSM_PIN_FUNCTION(dp_hot), - MSM_PIN_FUNCTION(egpio), + MSM_GPIO_PIN_FUNCTION(egpio), MSM_PIN_FUNCTION(gcc_gp1), MSM_PIN_FUNCTION(gcc_gp2), MSM_PIN_FUNCTION(gcc_gp3), diff --git a/drivers/pinctrl/qcom/pinctrl-x1e80100.c b/drivers/pinctrl/qcom= /pinctrl-x1e80100.c index d4b215f34c39bf67a0656a3f894b8639491e898b..bb36f40b19fa53eedf68d46d029= 86410d07a733c 100644 --- a/drivers/pinctrl/qcom/pinctrl-x1e80100.c +++ b/drivers/pinctrl/qcom/pinctrl-x1e80100.c @@ -1407,7 +1407,7 @@ static const char * const vsense_trigger_groups[] =3D= { }; =20 static const struct pinfunction x1e80100_functions[] =3D { - MSM_PIN_FUNCTION(gpio), + MSM_GPIO_PIN_FUNCTION(gpio), MSM_PIN_FUNCTION(RESOUT_GPIO), MSM_PIN_FUNCTION(aon_cci), MSM_PIN_FUNCTION(aoss_cti), --=20 2.48.1 From nobody Sat Oct 4 22:34:47 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 1F69D2E283F for ; Tue, 12 Aug 2025 08:27:35 +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=1754987260; cv=none; b=cc2TUVxXNzU0WXuN49/tA4b27M7wiLjHLJl88WmPAnl+GVSBLpz7JpE84VDQqoLOxkEVxK2HxWuJDmgy3zu0F2kPeBRcucLtBtRkqBVmSJ0A0i9L7mRCFpFN7Gdp487YQBVvXma38n6ibq82s+fHX1V/aQ0HpyNu/KvdOqNf1Xk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754987260; c=relaxed/simple; bh=RFujl0Cr/YaORxwURfe0zTKDzCwOsKiOevFTrddSrvg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GD2strGFnfjeM6mwbsiaA1GBvsfqtuKIjfY7THxsWOmOdzxikzCZ+IUV8wgZUXC4yxQTP+/gS9kXL1D09vNq5bF31iCToqYWSX2C/Q1T9O0uLQJ+PMPilWv8XBxJeulxJ1dnOKJJF2aDrHPF0/FWr0vuMJuD5fkJwr3lJQW3Wq8= 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=eMTt1x/n; 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="eMTt1x/n" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3b7920354f9so4249589f8f.2 for ; Tue, 12 Aug 2025 01:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1754987254; x=1755592054; 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=eMTt1x/n1qgzpLXyHDo6MeIY4+ABzJ1/h6XwcjcSjBY8i4oEErGGJvm96NP7ZKL1ZE RXo41IishSEJjQGnZyqdFwr2Ely5coNK7Sonl7CW/iQjuQJwWPA/5ulSPkzbJREn3Tgn ItP1zxFMSppYm2uvC74UwX0VSbNhStsWMwGqI7rgRjSrpeluaqVqufJtLf6aNyqWqN6T +qESXRX5qhzM/4BacuWQuWpoAjMVhEcDFmg2Gk4bCOlb2H2m4b+QE5pXYY/IrHUeBDCZ gzVgkNBfVDNYUpv+pU165as8TndN+xeoIb5EPhLXMkb38ad31ptnJ4kIw7c14EqsKkmJ 8n2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987254; x=1755592054; 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=rczhFWxRrPJjPKoGDC37GQokHEJfaur2wFmdN0fV/5YQqKjTD+41+b0yEMQaAwRZXl RmfevWAHQQzYBfiGOGpWMgJ9hE0j9jFcG8aj/u9HHsOPMqzb9va2DfuCAEmI79QoccrU FKFeAg2Zt2sez5908taePn6NanZbOS5V9ryG1AWL4mB+kp3pXOIXJVKjKLKppcBu8j4d lrEHmAs6VN88t/maST5+QEYnnwZWyNmO4xhhPjYdeM8nGjvJUQeDQhUxvSxBfTGa5Pti CbduocLUJjHFJpOgGsmUatmh5Er6nj2tzY+u9P2CEyfMx1rV1OA9hZ6VxLu3Y72mxPwR HwQw== X-Forwarded-Encrypted: i=1; AJvYcCVpmjCMd5VpVkLilZB7LLM4wPJz9/mH05CWbAt4AODX9bbQPxjKC1nXWkure43GbRx/lbR/+U/5FgMkHio=@vger.kernel.org X-Gm-Message-State: AOJu0YwELirU6CvI1eT6MOgF4NwIbqZtui3SOo883cawGSQFMB0AUHvS FpblS+mQKtBxsxosOgR2X5KgQskErVwBs3YUFNNH1dhWDX8iIX2qzZA6QtefDuMNNwg= X-Gm-Gg: ASbGncsL9LQ7Cc0k0kjkJxNN5r1WSd2/ftaEucfC4VVkkdW0V0G2XfKvlTcEySZTjEW XnPsJbLpkIyflt/GxjhZUydRQrCUR5WGH+9uGCoqWy6Yd14a+p2zybuunS8YXSFAIWAE+hnHb8S PUt0SVa0hA4Diy6HcBDy+Xk1rh5RDxixkDslysY/0oii1uWgDmxO8WMFW41jljYvDJyIjIUjz4e QXJ9f3FLmWsNuOiJn68gtcqACoqZDZDXIAeh/3o4IxJX1JowzhObQFMPRRpjBgPc5RKXaoi6JC3 EEQf5yz3eK6LnY4YZ9kGnlTFWpFMkaVUKcsLag1EkzN+8Dr4tOcRvylnx8vXdq0lKoG57eylvC1 hNxJsnJW5KWKvIso= X-Google-Smtp-Source: AGHT+IEIkGK210eX4oaAWTvIndQdBKgODaVv89WdHuLZ5yZCYfAUy5DwGLKFKR8W9EpKo9YtXUOSDA== X-Received: by 2002:a05:6000:2501:b0:3b7:7904:58e1 with SMTP id ffacd0b85a97d-3b910fd9b5bmr1926776f8f.18.1754987253948; Tue, 12 Aug 2025 01:27:33 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:16c8:50:27fe:4d94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm43549423f8f.18.2025.08.12.01.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:27:33 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 12 Aug 2025 10:27:14 +0200 Subject: [PATCH v4 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: <20250812-pinctrl-gpio-pinfuncs-v4-15-bb3906c55e64@linaro.org> References: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> In-Reply-To: <20250812-pinctrl-gpio-pinfuncs-v4-0-bb3906c55e64@linaro.org> To: Linus Walleij , Bjorn Andersson , Konrad Dybcio , Alexey Klimov , Lorenzo Bianconi , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Paul Cercueil , Kees Cook , Andy Shevchenko , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , NXP S32 Linux Team , Sascha Hauer , Tony Lindgren , Haojian Zhuang , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1142; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=M6AAfE1ZYIqFZsBoDZ4O1bJllvK/6bMXFJ6Zryc+i/E=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBomvrZaBmeISpiHCVh1NKR4JJvKfvoR7+4TGM34 qACMSZiq0aJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaJr62QAKCRARpy6gFHHX ci+8EACxohGvZiGTBr0Y9QxyJzsEN0JDEuMPPP2/XSq+kOTHcKkmHErEtvBcohO7KLJzJuDM92q Iw3+IzM052WTxd4daM2zpMgweo/2dwzZfR5YEUer3WEroEGm+Bj1fVPmMiit7p1Urk63XsoIjrL iIqOXmtlteGyRTKCzz3k/xmfTyEyU7VBHczMECuT5uEu155Bu8nJCumD+wzbe8mmIlfgHaOMDUI EhNzoSXVeYCY0FHD/wqktUBCPUxVj3EGM965wJpVDJiroVIyzBPsjcH9gW4ZMI3gsrpLkKSn7/b B1DQKX5Md99KuFnktDMJfMeRA9VTUveqdFKrzKWO4O1PCOiNZYTlwh/00gXu8zMpM4AK1/xeHy6 xv2CMDqxOQQE9pNYsgFWdMK5+GZYlQTAYrjZncSo6RYTzLN9weKlo0cKuhBe3wUVAZQntaTYy8i k/Zxwl8sT/axdwTsi8ewRtM0DJYHR7QWCXofS6dAiEDIgSKdzkZJ4mIec2cmwKInyd1Ja38qeyo BaUmY5FfX7ADJQDEVQD8b/C/oeUP+bk/MkxTefH5hvrw5RZW6Rm5jF7NwkotqyJwbEKJFZVea+T cJiJ5bAYHdIENT0OWfDZvACcGaK8OCdLW3UJoLXH1IZbWn2imkJ1JInadg5ZknF41i/olNLfmrS vdUH6mCryqoAAIg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The strict flag in struct pinmux_ops disallows the usage of the same pin as a GPIO and for another function. Without it, a rouge user-space process with enough privileges (or even a buggy driver) can request a used pin as GPIO and drive it, potentially confusing devices or even crashing the system. Set it globally for all pinctrl-msm users. Reviewed-by: Konrad Dybcio Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/qcom/pinctrl-msm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinc= trl-msm.c index a5f69464827119dfe2a7781b558094b283fca215..1751d838ce95d6138c824b90098= f74891dec7656 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -268,6 +268,7 @@ static const struct pinmux_ops msm_pinmux_ops =3D { .function_is_gpio =3D pinmux_generic_function_is_gpio, .gpio_request_enable =3D msm_pinmux_request_gpio, .set_mux =3D msm_pinmux_set_mux, + .strict =3D true, }; =20 static int msm_config_reg(struct msm_pinctrl *pctrl, --=20 2.48.1