From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B738C4332F for ; Mon, 11 Dec 2023 19:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344352AbjLKTD1 (ORCPT ); Mon, 11 Dec 2023 14:03:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLKTD0 (ORCPT ); Mon, 11 Dec 2023 14:03:26 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82BB19B; Mon, 11 Dec 2023 11:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321412; x=1733857412; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LiqBDpyusmg3WhaebVfG+XnzpgrEpQqtzwlk9RFgoFg=; b=KS1SCDrXLSDNGecFAC1F9x87cMCOBC7egCBxlNLJBRfxmg3zKPTCWeHS H3QGAUbjohQxBqi0kGCYPcQW/5Tji9nWgNle1yS06X/YStmW7Pj85PXvx 86gzwKiV6sFYUegrmwTdQL0ulknctQfNW9fNmVCyaqkxjgqTj4OqWzbJG XC/7omnXONUm7KXIfDc8k5CA4jkslghdb5sAqPZsjybrEtP/medEXV8YZ xDBXGIinSuULnyzXR2Wx/v1W8ZpIo3CGvJ/yH31XlKKdLPlJ3DhI5F95D 0VX0ASoxVc1Kdbna80KDmNMZ4hyA5B/VvXJzcOY28A/Qw9ysqRhvnnnN0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692467" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692467" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445046" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445046" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 58B9CE7; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 01/13] pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC() Date: Mon, 11 Dec 2023 20:57:54 +0200 Message-ID: <20231211190321.307330-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add PINCTRL_GROUP_DESC() macro for inline use. Reviewed-by: Geert Uytterhoeven Signed-off-by: Andy Shevchenko --- drivers/pinctrl/core.c | 5 +---- drivers/pinctrl/core.h | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 6380e1fa6509..75f2689c3bad 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -658,10 +658,7 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctl= dev, const char *name, if (!group) return -ENOMEM; =20 - group->name =3D name; - group->pins =3D pins; - group->num_pins =3D num_pins; - group->data =3D data; + *group =3D PINCTRL_GROUP_DESC(name, pins, num_pins, data); =20 error =3D radix_tree_insert(&pctldev->pin_group_tree, selector, group); if (error) diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 8ef4b536bca5..bf971e6a7846 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -208,6 +208,15 @@ struct group_desc { void *data; }; =20 +/* Convenience macro to define a generic pin group descriptor */ +#define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \ +(struct group_desc) { \ + .name =3D _name, \ + .pins =3D _pins, \ + .num_pins =3D _num_pins, \ + .data =3D _data, \ +} + int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev); =20 const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev, --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D894C4167D for ; Mon, 11 Dec 2023 19:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344364AbjLKTD2 (ORCPT ); Mon, 11 Dec 2023 14:03:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344329AbjLKTD0 (ORCPT ); Mon, 11 Dec 2023 14:03:26 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A6A8BD; Mon, 11 Dec 2023 11:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321413; x=1733857413; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=o9xH9REOc7U2Jz5qGq2LitS6IQi1RegQo5JSLG1MyU0=; b=Gc2SjSopfEpd4fJZxlhcIkNMYibVfjYyUEYL6j2vASURukNnDb/5eVr2 ecmLqwQNqZxP4yWadlk4XARzWzCUMsRMQ4QlaHDo3tfebnPoOyQgqWYUJ ancuzZeXbw5VMaF6OZfQM0zwwMWJgk6e1E/+yEHPBpSJ0nFaIw5i52bFz t4/FKj8hy/67aBMglf1RGPm6atLsUQjFORMG/CtRfGHA44xI7oVhrFRyy dolxnxNKuN5/CO9R4K5Gp8JU9HGQZdbF+NDqp+q9k+mcCgxFZQ2yvTJ98 OzonFdZOKJaiC60J+6cmi5k0rL6zEK4MpQcJJxguqBQ0sKsyhc6nw/Noe A==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692491" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692491" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445048" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445048" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 699FE39B; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 02/13] pinctrl: mediatek: Use C99 initializers in PINCTRL_PIN_GROUP() Date: Mon, 11 Dec 2023 20:57:55 +0200 Message-ID: <20231211190321.307330-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" For the better flexibility use C99 initializers in PINCTRL_PIN_GROUP(). Signed-off-by: Andy Shevchenko --- drivers/pinctrl/mediatek/pinctrl-moore.h | 12 ++++++------ drivers/pinctrl/mediatek/pinctrl-paris.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.h b/drivers/pinctrl/med= iatek/pinctrl-moore.h index e1b4b82b9d3d..36ee0021cf7e 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.h +++ b/drivers/pinctrl/mediatek/pinctrl-moore.h @@ -37,12 +37,12 @@ .funcs =3D NULL, \ } =20 -#define PINCTRL_PIN_GROUP(name, id) \ - { \ - name, \ - id##_pins, \ - ARRAY_SIZE(id##_pins), \ - id##_funcs, \ +#define PINCTRL_PIN_GROUP(_name_, id) \ + { \ + .name =3D _name_, \ + .pins =3D id##_pins, \ + .num_pins =3D ARRAY_SIZE(id##_pins), \ + .data =3D id##_funcs, \ } =20 int mtk_moore_pinctrl_probe(struct platform_device *pdev, diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.h b/drivers/pinctrl/med= iatek/pinctrl-paris.h index 8762ac599329..5c4e5b74e43e 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.h +++ b/drivers/pinctrl/mediatek/pinctrl-paris.h @@ -49,12 +49,12 @@ __VA_ARGS__, { } }, \ } =20 -#define PINCTRL_PIN_GROUP(name, id) \ - { \ - name, \ - id##_pins, \ - ARRAY_SIZE(id##_pins), \ - id##_funcs, \ +#define PINCTRL_PIN_GROUP(_name_, id) \ + { \ + .name =3D _name_, \ + .pins =3D id##_pins, \ + .num_pins =3D ARRAY_SIZE(id##_pins), \ + .data =3D id##_funcs, \ } =20 int mtk_paris_pinctrl_probe(struct platform_device *pdev); --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ABFFC4332F for ; Mon, 11 Dec 2023 19:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344426AbjLKTDe (ORCPT ); Mon, 11 Dec 2023 14:03:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLKTD1 (ORCPT ); Mon, 11 Dec 2023 14:03:27 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C13CCF; Mon, 11 Dec 2023 11:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321414; x=1733857414; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ACcmTJgIefDIVYbDCBBfrcMa7Src+AAIG2eWNqY+244=; b=VN0VLnBkLVZd56vDxcQq35CzDxiJWdp4aU8EM06q3n+QIa3nbovwOyFd xfrrOjl+7dlXsQa0K/HmqksZWPqB3j0a1ozVC464hqDOgTkwYpgJb4rmK 3ZGpMsrleOAP0Q0NmLAT96A2dkFnLaX9QtmmKa88yW4SOhS14DGkGcmCn cZXGcCuC14nDlD45+1lIX/BqsIcDxjWZSMEUr8TxfV/lIH6RbjOXbYr9N JSgVfHBoCLJEaj2bELxuYAgLCKAUWT51oWLxiVKMGyUctLnqkzOWVEYl+ V1FZKG9aE3HJCksGUlilIKPM569wrDvCRcukAFe1t4DV67Q6vnG1kIDBD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692511" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692511" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445054" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445054" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7601E3AE; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 03/13] pinctrl: ingenic: Use C99 initializers in PINCTRL_PIN_GROUP() Date: Mon, 11 Dec 2023 20:57:56 +0200 Message-ID: <20231211190321.307330-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" For the better flexibility use C99 initializers in PINCTRL_PIN_GROUP(). Signed-off-by: Andy Shevchenko Acked-by: Paul Cercueil --- drivers/pinctrl/pinctrl-ingenic.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index ee718f6e2556..f5661dcdedf5 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -82,16 +82,21 @@ #define PINS_PER_GPIO_CHIP 32 #define JZ4730_PINS_PER_PAIRED_REG 16 =20 -#define INGENIC_PIN_GROUP_FUNCS(name, id, funcs) \ - { \ - name, \ - id##_pins, \ - ARRAY_SIZE(id##_pins), \ - funcs, \ +#define INGENIC_PIN_GROUP_FUNCS(_name_, id, funcs) \ + { \ + .name =3D _name_, \ + .pins =3D id##_pins, \ + .num_pins =3D ARRAY_SIZE(id##_pins), \ + .data =3D funcs, \ } =20 -#define INGENIC_PIN_GROUP(name, id, func) \ - INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) +#define INGENIC_PIN_GROUP(_name_, id, func) \ + { \ + .name =3D _name_, \ + .pins =3D id##_pins, \ + .num_pins =3D ARRAY_SIZE(id##_pins), \ + .data =3D (void *)func, \ + } =20 enum jz_version { ID_JZ4730, --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A0C3C4332F for ; Mon, 11 Dec 2023 19:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344361AbjLKTDb (ORCPT ); Mon, 11 Dec 2023 14:03:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344351AbjLKTD1 (ORCPT ); Mon, 11 Dec 2023 14:03:27 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F60EC0; Mon, 11 Dec 2023 11:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321413; x=1733857413; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=b7CPcX9ouwRk1xx4HWTOwic7NJnDx4rISU5WcRjGp/M=; b=DWNyxQE4oaZRpxZDGY0tyETWojJG1jRg64OkIG/vxPxHxfCBtmixEejL +WfCPuZ2f1BnZcZaqyP5T8IKZKZ7T/4kAe7P32XQBd/DYe52fm96Ui3HS /IINvWs9s/loB9BhibQmxRB1LA4X2ZUCpZg00otkVQUHE4Ggko389H3zl A1v6N+KGTGJ3GF5gZTzPuUd3MIxYfRqMZLp99/y+V3cyELlTH7Rk/o4ng aBba2A0UtF8XVPYbgfSX2S84LSSutLAVyIwPqvRVFRhz6d0AjyUZ0jdn9 5NpgBfKHllYmbMe0dOV8spNidlXQKuHMSbg1xlZBGgx0xBCBHTBuZh14D g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692506" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692506" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445050" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445050" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 82B943D2; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 04/13] pinctrl: core: Embed struct pingroup into struct group_desc Date: Mon, 11 Dec 2023 20:57:57 +0200 Message-ID: <20231211190321.307330-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" struct group_desc is a particular version of the struct pingroup with associated opaque data. Start switching pin control core and drivers to use it explicitly. Reviewed-by: Geert Uytterhoeven Signed-off-by: Andy Shevchenko --- drivers/pinctrl/core.c | 15 ++++++++++++--- drivers/pinctrl/core.h | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 75f2689c3bad..48cc5571dea6 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -557,7 +557,10 @@ const char *pinctrl_generic_get_group_name(struct pinc= trl_dev *pctldev, if (!group) return NULL; =20 - return group->name; + if (group->name) + return group->name; + + return group->grp.name; } EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_name); =20 @@ -583,8 +586,14 @@ int pinctrl_generic_get_group_pins(struct pinctrl_dev = *pctldev, return -EINVAL; } =20 - *pins =3D group->pins; - *num_pins =3D group->num_pins; + if (group->pins) { + *pins =3D group->pins; + *num_pins =3D group->num_pins; + return 0; + } + + *pins =3D group->grp.pins; + *num_pins =3D group->grp.npins; =20 return 0; } diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index bf971e6a7846..a3b75ec7b54b 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -194,14 +194,18 @@ struct pinctrl_maps { =20 #ifdef CONFIG_GENERIC_PINCTRL_GROUPS =20 +#include + /** * struct group_desc - generic pin group descriptor + * @grp: generic data of the pin group (name and pins) * @name: name of the pin group * @pins: array of pins that belong to the group * @num_pins: number of pins in the group * @data: pin controller driver specific data */ struct group_desc { + struct pingroup grp; const char *name; const unsigned int *pins; int num_pins; @@ -211,6 +215,7 @@ struct group_desc { /* Convenience macro to define a generic pin group descriptor */ #define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \ (struct group_desc) { \ + .grp =3D PINCTRL_PINGROUP(_name, _pins, _num_pins), \ .name =3D _name, \ .pins =3D _pins, \ .num_pins =3D _num_pins, \ --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2649C4332F for ; Mon, 11 Dec 2023 19:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344656AbjLKTD6 (ORCPT ); Mon, 11 Dec 2023 14:03:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344456AbjLKTDm (ORCPT ); Mon, 11 Dec 2023 14:03:42 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A099FE; Mon, 11 Dec 2023 11:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321422; x=1733857422; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0WWCPRg7bqetBK8gitn1hlA0oD/JGzynriYGlfQpHWc=; b=j8KHTGVMrwNeJnqgjoUsE1BJwKOjRznVAZRKM+LVtTOJZcyo2I6K9+bf VZGS/CwxlG4WzcD7NZI8MiL4SbPorrF9pTJMP/w6mOtEY4mL35BskY8F3 wstYMStnzy67X6hIaCqzZN28qTfQuD8DT48n0jihnXUPzckALX29cQ56Z raVAaXyuUw4ysIZOC2i4EVj1eKee0G4UW7F+g2qiZRpBWiqSGLgdo4wq7 9n72lapf50iHee3LlvpzhfmAKs/9E6qK7IKq1OfnBiDmiZ2DmvlG1HrXy CPYvFxMxBELDLwFy+8/Xe0AssgRZ6NJhJ37q1qDncjU/JtdNBwSsJaa8q w==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692559" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692559" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445105" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445105" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 91C7765E; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng , Florian Fainelli Subject: [PATCH v5 05/13] pinctrl: bcm: Convert to use grp member Date: Mon, 11 Dec 2023 20:57:58 +0200 Message-ID: <20231211190321.307330-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Tested-by: Florian Fainelli Reviewed-by: Florian Fainelli Signed-off-by: Andy Shevchenko --- drivers/pinctrl/bcm/pinctrl-ns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-ns.c b/drivers/pinctrl/bcm/pinctrl= -ns.c index d099a7f25f64..6bb2b461950b 100644 --- a/drivers/pinctrl/bcm/pinctrl-ns.c +++ b/drivers/pinctrl/bcm/pinctrl-ns.c @@ -171,8 +171,8 @@ static int ns_pinctrl_set_mux(struct pinctrl_dev *pctrl= _dev, if (!group) return -EINVAL; =20 - for (i =3D 0; i < group->num_pins; i++) - unset |=3D BIT(group->pins[i]); + for (i =3D 0; i < group->grp.npins; i++) + unset |=3D BIT(group->grp.pins[i]); =20 tmp =3D readl(ns_pinctrl->base); tmp &=3D ~unset; --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ACF3C4332F for ; Mon, 11 Dec 2023 19:04:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344808AbjLKTDv (ORCPT ); Mon, 11 Dec 2023 14:03:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344452AbjLKTDm (ORCPT ); Mon, 11 Dec 2023 14:03:42 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00273DB; Mon, 11 Dec 2023 11:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321420; x=1733857420; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pR6KztyzF48ZfW/LMuH4jmtjyuPZgNrAFpCKVgU8ZAk=; b=jLo/+B++pcwjeQP7if1IBCK9DZV2l0M1cZ9h+88+uJcbGQMj3OOwrbOf uyOicso97VYb+V9jVc64eThXCYWgamj6GH00DSpSxlvAKTgOUV1Mms6Ii g1vLLyz/QNrsVw9cggVdQSLaenQr+yIqUXFI6191e9abShUwHE4dkje9r gW+6FZK0oNvlKlYVmP+mKHR1j+Gks6eIDzqgT1WVyQ7dTl6YN+50qc4eu O94Zi2M2eM4AmLR2zupCODeJScyOAlQqsr0IqD8bmox7EeJTjg3E+xEGN ww2r21PToLHtKwIS02AhcVTCdxm/0D5j0Z5eQDJHeNelhSMlJHPkfVvdj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="480893532" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="480893532" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="766491692" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="766491692" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2023 11:03:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id A2556690; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 06/13] pinctrl: equilibrium: Convert to use grp member Date: Mon, 11 Dec 2023 20:57:59 +0200 Message-ID: <20231211190321.307330-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-equilibrium.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctr= l-equilibrium.c index 4ebae516d1b1..6e1be38865c3 100644 --- a/drivers/pinctrl/pinctrl-equilibrium.c +++ b/drivers/pinctrl/pinctrl-equilibrium.c @@ -331,8 +331,8 @@ static int eqbr_pinmux_set_mux(struct pinctrl_dev *pctl= dev, return -EINVAL; =20 pinmux =3D grp->data; - for (i =3D 0; i < grp->num_pins; i++) - eqbr_set_pin_mux(pctl, pinmux[i], grp->pins[i]); + for (i =3D 0; i < grp->grp.npins; i++) + eqbr_set_pin_mux(pctl, pinmux[i], grp->grp.pins[i]); =20 return 0; } --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 767C0C4167D for ; Mon, 11 Dec 2023 19:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344672AbjLKTDp (ORCPT ); Mon, 11 Dec 2023 14:03:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344353AbjLKTDl (ORCPT ); Mon, 11 Dec 2023 14:03:41 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCBC3D6; Mon, 11 Dec 2023 11:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321420; x=1733857420; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jBgMUxoaE0sg0WlUT7okBsBkokT5icXyzOHzcQhn8e4=; b=KBzL0mJuoHnNHSoi0QVeGbRry3vfsHxQgI2Ap50f62hnzDQs3CjgzMRS 4BbI2xpn8MV0IxJLjLVlL5TLM13Zq5raqEPEeRXKVcUhxnJseHnhJXtEd wkPL4zssAO9CNhMBft/kdUG9XsaM42UVCMk/s3M7ErJqNfyfI2t4axH6v WHJM5WDpW7gQtV2xPq4/m1bV9OplbZ20LOmLM7u5ywj+JM7AELtEh042H sF6JYj/5zGBfOcbl/HXJuEV/MCkC1LcFokszHjULKIcE9mYtOl2ndjHpU udxFA+O/hFoWtNgzPr6PRfErj1juImI1wVD7NOBeXQEupJlwRZzIuKKQj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692535" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692535" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445103" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445103" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id ADD346A6; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 07/13] pinctrl: imx: Convert to use grp member Date: Mon, 11 Dec 2023 20:58:00 +0200 Message-ID: <20231211190321.307330-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/freescale/pinctrl-imx.c | 31 +++++++++++-------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/free= scale/pinctrl-imx.c index 28164b04b1be..2d3d80921c0d 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -42,7 +42,7 @@ static inline const struct group_desc *imx_pinctrl_find_g= roup_by_name( =20 for (i =3D 0; i < pctldev->num_groups; i++) { grp =3D pinctrl_generic_get_group(pctldev, i); - if (grp && !strcmp(grp->name, name)) + if (grp && !strcmp(grp->grp.name, name)) break; } =20 @@ -79,9 +79,9 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, } =20 if (info->flags & IMX_USE_SCU) { - map_num +=3D grp->num_pins; + map_num +=3D grp->grp.npins; } else { - for (i =3D 0; i < grp->num_pins; i++) { + for (i =3D 0; i < grp->grp.npins; i++) { pin =3D &((struct imx_pin *)(grp->data))[i]; if (!(pin->conf.mmio.config & IMX_NO_PAD_CTL)) map_num++; @@ -109,7 +109,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctld= ev, =20 /* create config map */ new_map++; - for (i =3D j =3D 0; i < grp->num_pins; i++) { + for (i =3D j =3D 0; i < grp->grp.npins; i++) { pin =3D &((struct imx_pin *)(grp->data))[i]; =20 /* @@ -263,10 +263,10 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, u= nsigned selector, if (!func) return -EINVAL; =20 - npins =3D grp->num_pins; + npins =3D grp->grp.npins; =20 dev_dbg(ipctl->dev, "enable function %s group %s\n", - func->name, grp->name); + func->name, grp->grp.name); =20 for (i =3D 0; i < npins; i++) { /* @@ -423,7 +423,7 @@ static void imx_pinconf_group_dbg_show(struct pinctrl_d= ev *pctldev, if (!grp) return; =20 - for (i =3D 0; i < grp->num_pins; i++) { + for (i =3D 0; i < grp->grp.npins; i++) { struct imx_pin *pin =3D &((struct imx_pin *)(grp->data))[i]; =20 name =3D pin_get_name(pctldev, pin->pin); @@ -526,7 +526,7 @@ static int imx_pinctrl_parse_groups(struct device_node = *np, pin_size =3D FSL_PIN_SIZE; =20 /* Initialise group */ - grp->name =3D np->name; + grp->grp.name =3D np->name; =20 /* * the binding format is fsl,pins =3D , @@ -554,19 +554,17 @@ static int imx_pinctrl_parse_groups(struct device_nod= e *np, return -EINVAL; } =20 - grp->num_pins =3D size / pin_size; - grp->data =3D devm_kcalloc(ipctl->dev, - grp->num_pins, sizeof(struct imx_pin), - GFP_KERNEL); + grp->grp.npins =3D size / pin_size; + grp->data =3D devm_kcalloc(ipctl->dev, grp->grp.npins, sizeof(*pin), GFP_= KERNEL); if (!grp->data) return -ENOMEM; =20 - pins =3D devm_kcalloc(ipctl->dev, grp->num_pins, sizeof(*pins), GFP_KERNE= L); + pins =3D devm_kcalloc(ipctl->dev, grp->grp.npins, sizeof(*pins), GFP_KERN= EL); if (!pins) return -ENOMEM; - grp->pins =3D pins; + grp->grp.pins =3D pins; =20 - for (i =3D 0; i < grp->num_pins; i++) { + for (i =3D 0; i < grp->grp.npins; i++) { pin =3D &((struct imx_pin *)(grp->data))[i]; if (info->flags & IMX_USE_SCU) info->imx_pinctrl_parse_pin(ipctl, &pins[i], pin, &list); @@ -613,8 +611,7 @@ static int imx_pinctrl_parse_functions(struct device_no= de *np, =20 i =3D 0; for_each_child_of_node(np, child) { - grp =3D devm_kzalloc(ipctl->dev, sizeof(struct group_desc), - GFP_KERNEL); + grp =3D devm_kzalloc(ipctl->dev, sizeof(*grp), GFP_KERNEL); if (!grp) { of_node_put(child); return -ENOMEM; --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21BDFC4167B for ; Mon, 11 Dec 2023 19:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344803AbjLKTDs (ORCPT ); Mon, 11 Dec 2023 14:03:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344446AbjLKTDl (ORCPT ); Mon, 11 Dec 2023 14:03:41 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BBE9CF; Mon, 11 Dec 2023 11:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321420; x=1733857420; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jT5aMdLnWQi+FETkAhi9wCFmGc0jKKEFEHjIqYKnUWw=; b=Nn0voCmGPJDA6IHhoxweSVvkDnFsTplswe3WMvdYStBVtaxT7KK8PcRn hUsRNyK6icv2qm2rd4bVoxaYCX9KQa+edS4KbYQtoW9+17mONRe2yOxwV jKP7EBi0YpVYFYl+vK1mbYBFLuUxCSyL0oNJ+NxAbcM+S86ZxVVsO9aTp dkPBZrOC1oU8HgM0Gdg7TntCHYuSVDewBd5HBkh6t4d7Tssl0ba9l673I EpFaW9A6lhbOdIKaN3gmsln0D7aEWRHqJ1Kvw0CFvvxcFxW57fD8Mfiu0 izVzqnt2UQOVkqkGU4/lJWFVNxLpD0klyLd7HpjUFtbFfW1S0ygoxJHmi g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="480893504" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="480893504" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="766491687" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="766491687" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2023 11:03:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BB59872F; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 08/13] pinctrl: ingenic: Convert to use grp member Date: Mon, 11 Dec 2023 20:58:01 +0200 Message-ID: <20231211190321.307330-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Acked-by: Paul Cercueil Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-ingenic.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-in= genic.c index f5661dcdedf5..bc6358a686fc 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -84,17 +84,13 @@ =20 #define INGENIC_PIN_GROUP_FUNCS(_name_, id, funcs) \ { \ - .name =3D _name_, \ - .pins =3D id##_pins, \ - .num_pins =3D ARRAY_SIZE(id##_pins), \ + .grp =3D PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \ .data =3D funcs, \ } =20 #define INGENIC_PIN_GROUP(_name_, id, func) \ { \ - .name =3D _name_, \ - .pins =3D id##_pins, \ - .num_pins =3D ARRAY_SIZE(id##_pins), \ + .grp =3D PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \ .data =3D (void *)func, \ } =20 @@ -3766,17 +3762,17 @@ static int ingenic_pinmux_set_mux(struct pinctrl_de= v *pctldev, return -EINVAL; =20 dev_dbg(pctldev->dev, "enable function %s group %s\n", - func->name, grp->name); + func->name, grp->grp.name); =20 mode =3D (uintptr_t)grp->data; if (mode <=3D 3) { - for (i =3D 0; i < grp->num_pins; i++) - ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], mode); + for (i =3D 0; i < grp->grp.npins; i++) + ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], mode); } else { pin_modes =3D grp->data; =20 - for (i =3D 0; i < grp->num_pins; i++) - ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], pin_modes[i]); + for (i =3D 0; i < grp->grp.npins; i++) + ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], pin_modes[i]); } =20 return 0; @@ -4303,12 +4299,12 @@ static int __init ingenic_pinctrl_probe(struct plat= form_device *pdev) =20 for (i =3D 0; i < chip_info->num_groups; i++) { const struct group_desc *group =3D &chip_info->groups[i]; + const struct pingroup *grp =3D &group->grp; =20 - err =3D pinctrl_generic_add_group(jzpc->pctl, group->name, - group->pins, group->num_pins, group->data); + err =3D pinctrl_generic_add_group(jzpc->pctl, grp->name, grp->pins, grp-= >npins, + group->data); if (err < 0) { - dev_err(dev, "Failed to register group %s\n", - group->name); + dev_err(dev, "Failed to register group %s\n", grp->name); return err; } } --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FB04C35274 for ; Mon, 11 Dec 2023 19:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjLKTED (ORCPT ); Mon, 11 Dec 2023 14:04:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344458AbjLKTDm (ORCPT ); Mon, 11 Dec 2023 14:03:42 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48309FF; Mon, 11 Dec 2023 11:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321422; x=1733857422; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UE0Gnq7QTOX0XZMLVZj8fxiT9b1zuhOQUELXDpvqOXI=; b=D8SyTugKuhsqWbuHVlL3uXBdzj3gkTH2MdurSxtUJkLE8eRI6AIdbpdY upxoym7Cj/Vv9dN/8ik2EaTu8uuZqx8iA3Ftr9Q13YPXzOL+eWBjcGrp1 mpcbOZ5C2QlNeMJOdqf24GzjEvYCkTv4BENzplLrNvaNMfeTlNh/nnR2I vUfQGZWedP+mME2sBxZGEUvMoO6PpMpumOK+eUpfTuFD1k3XBcI+pyRZ4 DGquZyxJ0Sce9Ggc68c0Gvbk8y1nNwO0iB+Rpo2zbmS5OK7rURK1GcQow enEWbX622ZJ5wBVli8bzygoygmmfbL8o81a2tAJ5o/B06+/0bg52jpSlX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692563" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692563" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445107" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445107" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id C8AAD865; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 09/13] pinctrl: keembay: Convert to use grp member Date: Mon, 11 Dec 2023 20:58:02 +0200 Message-ID: <20231211190321.307330-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-keembay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-ke= embay.c index 87d328853ae4..b1349ee22799 100644 --- a/drivers/pinctrl/pinctrl-keembay.c +++ b/drivers/pinctrl/pinctrl-keembay.c @@ -945,7 +945,7 @@ static int keembay_set_mux(struct pinctrl_dev *pctldev,= unsigned int fun_sel, return -EINVAL; =20 /* Change modes for pins in the selected group */ - pin =3D *grp->pins; + pin =3D *grp->grp.pins; pin_mode =3D *(u8 *)(func->data); =20 val =3D keembay_read_reg(kpc->base1 + KEEMBAY_GPIO_MODE, pin); --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75755C4332F for ; Mon, 11 Dec 2023 19:04:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344814AbjLKTDz (ORCPT ); Mon, 11 Dec 2023 14:03:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344455AbjLKTDm (ORCPT ); Mon, 11 Dec 2023 14:03:42 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 738D5C0; Mon, 11 Dec 2023 11:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321421; x=1733857421; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6S0za2ArzaZgRtTIp/prxGbnlaukelwxoBpv7MAxWdo=; b=Nr4iFZJlcm4Qb3UFhaOmzd1gnUIQ3t+gQg2BC9de72+Fo4fy7NsmpJZl Uk1Mz3OoHm5Ik5tOtEsdtYhkK3KfI/YyQJbJ8am/DLfHzZOaIQ8E9fT3q l2nz9Xv+PGsFUb9QwQrgD3Nwf3/fhBiPuZcmgNccsc44BNNYMmXd6if2q 0l3ryQRbQzI8uB1CD1C7LOM2o9H1PuBu9xKi6CUYc/74tYsKkfuxjEo4Y f2eSvDsoG/GzcFlDm7l0GKrFGgJXg0ajioi+jSm+lkhgQFEoWwB024CcQ sGMTIY8VBdLBgdmg7LsYx+1swwxF1OVhmdRf7ymFGck/By24DtuKgAVIX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="480893544" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="480893544" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="766491696" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="766491696" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2023 11:03:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D5A28892; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 10/13] pinctrl: mediatek: Convert to use grp member Date: Mon, 11 Dec 2023 20:58:03 +0200 Message-ID: <20231211190321.307330-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/mediatek/pinctrl-moore.c | 13 ++++++------- drivers/pinctrl/mediatek/pinctrl-moore.h | 4 +--- drivers/pinctrl/mediatek/pinctrl-paris.h | 4 +--- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/med= iatek/pinctrl-moore.c index c3d59eddd994..d972584c0519 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -56,12 +56,12 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctld= ev, return -EINVAL; =20 dev_dbg(pctldev->dev, "enable function %s group %s\n", - func->name, grp->name); + func->name, grp->grp.name); =20 - for (i =3D 0; i < grp->num_pins; i++) { + for (i =3D 0; i < grp->grp.npins; i++) { const struct mtk_pin_desc *desc; int *pin_modes =3D grp->data; - int pin =3D grp->pins[i]; + int pin =3D grp->grp.pins[i]; =20 desc =3D (const struct mtk_pin_desc *)&hw->soc->pins[pin]; if (!desc->name) @@ -602,13 +602,12 @@ static int mtk_build_groups(struct mtk_pinctrl *hw) =20 for (i =3D 0; i < hw->soc->ngrps; i++) { const struct group_desc *group =3D hw->soc->grps + i; + const struct pingroup *grp =3D &group->grp; =20 - err =3D pinctrl_generic_add_group(hw->pctrl, group->name, - group->pins, group->num_pins, + err =3D pinctrl_generic_add_group(hw->pctrl, grp->name, grp->pins, grp->= npins, group->data); if (err < 0) { - dev_err(hw->dev, "Failed to register group %s\n", - group->name); + dev_err(hw->dev, "Failed to register group %s\n", grp->name); return err; } } diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.h b/drivers/pinctrl/med= iatek/pinctrl-moore.h index 36ee0021cf7e..e0313e7a1fe0 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.h +++ b/drivers/pinctrl/mediatek/pinctrl-moore.h @@ -39,9 +39,7 @@ =20 #define PINCTRL_PIN_GROUP(_name_, id) \ { \ - .name =3D _name_, \ - .pins =3D id##_pins, \ - .num_pins =3D ARRAY_SIZE(id##_pins), \ + .grp =3D PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \ .data =3D id##_funcs, \ } =20 diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.h b/drivers/pinctrl/med= iatek/pinctrl-paris.h index 5c4e5b74e43e..948ce126aa0c 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.h +++ b/drivers/pinctrl/mediatek/pinctrl-paris.h @@ -51,9 +51,7 @@ =20 #define PINCTRL_PIN_GROUP(_name_, id) \ { \ - .name =3D _name_, \ - .pins =3D id##_pins, \ - .num_pins =3D ARRAY_SIZE(id##_pins), \ + .grp =3D PINCTRL_PINGROUP(_name_,id##_pins, ARRAY_SIZE(id##_pins)), \ .data =3D id##_funcs, \ } =20 --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96B42C4332F for ; Mon, 11 Dec 2023 19:04:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344423AbjLKTEQ (ORCPT ); Mon, 11 Dec 2023 14:04:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344445AbjLKTDn (ORCPT ); Mon, 11 Dec 2023 14:03:43 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B7D10B; Mon, 11 Dec 2023 11:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321423; x=1733857423; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dl5meZK/9OQqeSluMo8zI6v5kxMv/grswCooUcDxnbw=; b=B8MzZACmW9ENGnghUSffSx/RWhP2voYL1wo5+hKymxDztamcXxp0ub+l mzz5CcP0PUivuap6fHey9k3zIu+DDOdioHu6/0ImnxHdKYr+sXRaI9hmp OT/m5QD5/iOpya/lZDA7UIWIPB+qxUyQOolD2tU7GDBVEdQxT9d6Owxto D6RDNKGF1sOqP2vxCBoHwsltxm9tZFLcqLBGrJPCWs+Vjy0oAo3FUmIkD IDu6b1B/dtBdfSXDd5uo9O3RrEpQMjJpfKoAFVUzsGq9Ef45cGq/ExW8e PVyYHnlXXc4tOcRGb316KSTawnDkAGeo/fFNe+rsWupoMSb21jWPAplzq g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692588" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692588" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445109" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445109" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:33 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DF69A30D; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 11/13] pinctrl: renesas: Convert to use grp member Date: Mon, 11 Dec 2023 20:58:04 +0200 Message-ID: <20231211190321.307330-12-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Andy Shevchenko --- drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +- drivers/pinctrl/renesas/pinctrl-rza2.c | 10 +++++----- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 4 ++-- drivers/pinctrl/renesas/pinctrl-rzv2m.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renes= as/pinctrl-rza1.c index ab334de89b69..b03f22c54ca8 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza1.c +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c @@ -1131,7 +1131,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, = unsigned int selector, return -EINVAL; =20 mux_confs =3D (struct rza1_mux_conf *)func->data; - for (i =3D 0; i < grp->num_pins; ++i) { + for (i =3D 0; i < grp->grp.npins; ++i) { int ret; =20 ret =3D rza1_pin_mux_single(rza1_pctl, &mux_confs[i]); diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renes= as/pinctrl-rza2.c index 990b96d45967..af689d7c117f 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza2.c +++ b/drivers/pinctrl/renesas/pinctrl-rza2.c @@ -447,15 +447,15 @@ static int rza2_set_mux(struct pinctrl_dev *pctldev, = unsigned int selector, =20 psel_val =3D func->data; =20 - for (i =3D 0; i < grp->num_pins; ++i) { + for (i =3D 0; i < grp->grp.npins; ++i) { dev_dbg(priv->dev, "Setting P%c_%d to PSEL=3D%d\n", - port_names[RZA2_PIN_ID_TO_PORT(grp->pins[i])], - RZA2_PIN_ID_TO_PIN(grp->pins[i]), + port_names[RZA2_PIN_ID_TO_PORT(grp->grp.pins[i])], + RZA2_PIN_ID_TO_PIN(grp->grp.pins[i]), psel_val[i]); rza2_set_pin_function( priv->base, - RZA2_PIN_ID_TO_PORT(grp->pins[i]), - RZA2_PIN_ID_TO_PIN(grp->pins[i]), + RZA2_PIN_ID_TO_PORT(grp->grp.pins[i]), + RZA2_PIN_ID_TO_PIN(grp->grp.pins[i]), psel_val[i]); } =20 diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/rene= sas/pinctrl-rzg2l.c index 68fcc2a4efbc..f01aa51b00c4 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -283,9 +283,9 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev *pc= tldev, return -EINVAL; =20 psel_val =3D func->data; - pins =3D group->pins; + pins =3D group->grp.pins; =20 - for (i =3D 0; i < group->num_pins; i++) { + for (i =3D 0; i < group->grp.npins; i++) { unsigned int *pin_data =3D pctrl->desc.pins[pins[i]].drv_data; u32 off =3D RZG2L_PIN_CFG_TO_PORT_OFFSET(*pin_data); u32 pin =3D RZG2L_PIN_ID_TO_PIN(pins[i]); diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c b/drivers/pinctrl/rene= sas/pinctrl-rzv2m.c index eb304fab1796..0767a5ac23e0 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c +++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c @@ -175,9 +175,9 @@ static int rzv2m_pinctrl_set_mux(struct pinctrl_dev *pc= tldev, return -EINVAL; =20 psel_val =3D func->data; - pins =3D group->pins; + pins =3D group->grp.pins; =20 - for (i =3D 0; i < group->num_pins; i++) { + for (i =3D 0; i < group->grp.npins; i++) { dev_dbg(pctrl->dev, "port:%u pin: %u PSEL:%u\n", RZV2M_PIN_ID_TO_PORT(pins[i]), RZV2M_PIN_ID_TO_PIN(pins[i]), psel_val[i]); --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12350C35273 for ; Mon, 11 Dec 2023 19:04:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344848AbjLKTEH (ORCPT ); Mon, 11 Dec 2023 14:04:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344402AbjLKTDm (ORCPT ); Mon, 11 Dec 2023 14:03:42 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86B08100; Mon, 11 Dec 2023 11:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321422; x=1733857422; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RimL0SIQXjPeHNJa1LOYK4/Xp//ezirAmpPsqYTrLlY=; b=PC5zrcIL14J9af/O+He5wSWMwSX56g61/jO6udTFieNglrZW+PH3rcvD qUy5Y66yfmdFTfTsyNSqpOVlKgh7RsSNFQnMx3eZJ6rxXUS8SUdLjGgk1 xGKr0/w29/CL+QBve3kU1ZAAL2OHeLQ4ZoiReH4hbwbDq3k0Xgscw4dNM reGKdhHLZ8oIv38M/d1pWozXhyYD1sDBJmcPMsbiIyvYKeIOeiadob+NT KockyW9C78/hhgr0G2fIxtlPAcq+KIq6LTln07S2211G6ShhKEACDC001 zeF2gqlEW8hzGn+3PUnHIpRG4+EMkUgRadmj15F53pJcDoEbAUTkPlj6z A==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="480893550" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="480893550" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="766491704" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="766491704" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2023 11:03:33 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id F1D16A11; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng , Emil Renner Berthing Subject: [PATCH v5 12/13] pinctrl: starfive: Convert to use grp member Date: Mon, 11 Dec 2023 20:58:05 +0200 Message-ID: <20231211190321.307330-13-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Reviewed-by: Emil Renner Berthing Signed-off-by: Andy Shevchenko --- drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 8 ++++---- drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/p= inctrl/starfive/pinctrl-starfive-jh7100.c index b29b0ab9892b..6df7a310c7ed 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c @@ -654,7 +654,7 @@ static int starfive_set_mux(struct pinctrl_dev *pctldev, return -EINVAL; =20 pinmux =3D group->data; - for (i =3D 0; i < group->num_pins; i++) { + for (i =3D 0; i < group->grp.npins; i++) { u32 v =3D pinmux[i]; unsigned int gpio =3D starfive_pinmux_to_gpio(v); u32 dout =3D starfive_pinmux_to_dout(v); @@ -797,7 +797,7 @@ static int starfive_pinconf_group_get(struct pinctrl_de= v *pctldev, if (!group) return -EINVAL; =20 - return starfive_pinconf_get(pctldev, group->pins[0], config); + return starfive_pinconf_get(pctldev, group->grp.pins[0], config); } =20 static int starfive_pinconf_group_set(struct pinctrl_dev *pctldev, @@ -876,8 +876,8 @@ static int starfive_pinconf_group_set(struct pinctrl_de= v *pctldev, } } =20 - for (i =3D 0; i < group->num_pins; i++) - starfive_padctl_rmw(sfp, group->pins[i], mask, value); + for (i =3D 0; i < group->grp.npins; i++) + starfive_padctl_rmw(sfp, group->grp.pins[i], mask, value); =20 return 0; } diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/p= inctrl/starfive/pinctrl-starfive-jh7110.c index 6de11a405734..9609eb1ecc3d 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c @@ -307,7 +307,7 @@ static int jh7110_set_mux(struct pinctrl_dev *pctldev, return -EINVAL; =20 pinmux =3D group->data; - for (i =3D 0; i < group->num_pins; i++) { + for (i =3D 0; i < group->grp.npins; i++) { u32 v =3D pinmux[i]; =20 if (info->jh7110_set_one_pin_mux) @@ -437,7 +437,7 @@ static int jh7110_pinconf_group_get(struct pinctrl_dev = *pctldev, if (!group) return -EINVAL; =20 - return jh7110_pinconf_get(pctldev, group->pins[0], config); + return jh7110_pinconf_get(pctldev, group->grp.pins[0], config); } =20 static int jh7110_pinconf_group_set(struct pinctrl_dev *pctldev, @@ -508,8 +508,8 @@ static int jh7110_pinconf_group_set(struct pinctrl_dev = *pctldev, } } =20 - for (i =3D 0; i < group->num_pins; i++) - jh7110_padcfg_rmw(sfp, group->pins[i], mask, value); + for (i =3D 0; i < group->grp.npins; i++) + jh7110_padcfg_rmw(sfp, group->grp.pins[i], mask, value); =20 return 0; } --=20 2.43.0.rc1.1.gbec44491f096 From nobody Thu Nov 14 05:03:28 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED09CC4332F for ; Mon, 11 Dec 2023 19:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344375AbjLKTEK (ORCPT ); Mon, 11 Dec 2023 14:04:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344423AbjLKTDn (ORCPT ); Mon, 11 Dec 2023 14:03:43 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40A9B10C; Mon, 11 Dec 2023 11:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321423; x=1733857423; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=stiM9aExenYBLsXThMdeP0DZZbWSelPRFbvz2eZsYe4=; b=A8ZcbaZOU0mWbb1Vq2CDuwty02OwVVQRFWy94mmYAAfZA6PyIh6fwwPF hkTYb0vaCRWxl5juwwaDIzFQcAdnVkFhv/5lsw2L4TPMLk5kBnOLjl+ZO lcj7Mt9XI8PLVK3F9Pog2eMuxFmhQeO4uI4hFQrXQCB1FNIbtvYFFZoyR DRDwo2xtC6VAOJJrl0KMtpgnoPBPzKH+aPcT76ZIugQ/u8PdcHz484o7A E0mIoGywiI2KHxVIwtlWFRxwCnDqsaRQz0uQTFfSB6MueabMAX4OLwqr8 nGnwcW9zD3PeGBxx1aOa8G6j3/HyNHtCEV+dNv/pm3G52rjFq7yACTn6T g==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692591" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692591" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445111" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445111" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:33 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0B5D5A22; Mon, 11 Dec 2023 21:03:24 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes , Biju Das , Claudiu Beznea , Jianlong Huang , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui , Scott Branden , Broadcom internal kernel review list , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , Sean Wang , Paul Cercueil , Lakshmi Sowjanya D , Emil Renner Berthing , Hal Feng Subject: [PATCH v5 13/13] pinctrl: core: Remove unused members from struct group_desc Date: Mon, 11 Dec 2023 20:58:06 +0200 Message-ID: <20231211190321.307330-14-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" All drivers are converted to use embedded struct pingroup. Remove unused members from struct group_desc. Reviewed-by: Geert Uytterhoeven Signed-off-by: Andy Shevchenko --- drivers/pinctrl/core.c | 9 --------- drivers/pinctrl/core.h | 9 --------- 2 files changed, 18 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 48cc5571dea6..ee56856cb80c 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -557,9 +557,6 @@ const char *pinctrl_generic_get_group_name(struct pinct= rl_dev *pctldev, if (!group) return NULL; =20 - if (group->name) - return group->name; - return group->grp.name; } EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_name); @@ -586,12 +583,6 @@ int pinctrl_generic_get_group_pins(struct pinctrl_dev = *pctldev, return -EINVAL; } =20 - if (group->pins) { - *pins =3D group->pins; - *num_pins =3D group->num_pins; - return 0; - } - *pins =3D group->grp.pins; *num_pins =3D group->grp.npins; =20 diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index a3b75ec7b54b..837fd5bd903d 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -199,16 +199,10 @@ struct pinctrl_maps { /** * struct group_desc - generic pin group descriptor * @grp: generic data of the pin group (name and pins) - * @name: name of the pin group - * @pins: array of pins that belong to the group - * @num_pins: number of pins in the group * @data: pin controller driver specific data */ struct group_desc { struct pingroup grp; - const char *name; - const unsigned int *pins; - int num_pins; void *data; }; =20 @@ -216,9 +210,6 @@ struct group_desc { #define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \ (struct group_desc) { \ .grp =3D PINCTRL_PINGROUP(_name, _pins, _num_pins), \ - .name =3D _name, \ - .pins =3D _pins, \ - .num_pins =3D _num_pins, \ .data =3D _data, \ } =20 --=20 2.43.0.rc1.1.gbec44491f096