[{"id":3679563,"web_url":"http://patchwork.ozlabs.org/comment/3679563/","msgid":"<1f8ca89f-0740-4ac6-bd18-4cb376518ddd@baylibre.com>","list_archive_url":null,"date":"2026-04-20T19:54:22","subject":"Re: [PATCH] pinctrl: mediatek: add airoha an7581/an7583 pinctrl\n driver","submitter":{"id":87228,"url":"http://patchwork.ozlabs.org/api/people/87228/","name":"David Lechner","email":"dlechner@baylibre.com"},"content":"On 4/20/26 12:21 PM, Mikhail Kshevetskiy wrote:\n> The patch adds pinctrl and gpio drivers for an7581/an7583 SoCs.\n> The code is based on linux airoha pinctrl driver.\n> \n> There are several '#if 0' .. '#endif' in the code. This was done\n\nIMHO, `#if 0` is just noise and we should delete it.\n\n> to make it easier to compare Linux and U-Boot pinctrl drivers.\n> \n> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>\n> ---\n>  drivers/pinctrl/mediatek/Kconfig          |   22 +-\n>  drivers/pinctrl/mediatek/Makefile         |    3 +\n>  drivers/pinctrl/mediatek/pinctrl-airoha.c | 3297 +++++++++++++++++++++\n\nWowsers! This is a lot of code for one file, let alone one patch. hopefully\nwe can split it up. For example, move the SoC-specific tables to separate\nfiles.\n\n>  drivers/pinctrl/mediatek/pinctrl-airoha.h |   84 +\n>  4 files changed, 3405 insertions(+), 1 deletion(-)\n>  create mode 100644 drivers/pinctrl/mediatek/pinctrl-airoha.c\n>  create mode 100644 drivers/pinctrl/mediatek/pinctrl-airoha.h\n> \n> diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig\n> index 8a588d17c4b..1ee44ff16d7 100644\n> --- a/drivers/pinctrl/mediatek/Kconfig\n> +++ b/drivers/pinctrl/mediatek/Kconfig\n> @@ -1,4 +1,4 @@\n> -if ARCH_MEDIATEK\n> +if ARCH_MEDIATEK || ARCH_AIROHA\n\nWhy does this need to be mixed in with MediaTek? It doesn't look like\nthey actually share any code here.\n\n>  \n>  config PINCTRL_MTK\n>  \tdepends on PINCTRL_GENERIC\n> @@ -6,6 +6,26 @@ config PINCTRL_MTK\n>  \tselect SYSCON\n>  \tbool\n>  \n> +endif\n> +\n> +if ARCH_AIROHA\n> +\n> +config PINCTRL_AIROHA\n> +\tbool \"Airoha an7581/an7583 SoC pinctrl driver\"\n\nAs above, to keep binary size down, it would be better to have each platform\nindividually enabled.\n\n> +\tselect PINCTRL_MTK\n> +\tselect PINCTRL_FULL\n> +\tselect PINMUX\n> +\tselect PINCONF\n> +\thelp\n> +\t  Say yes here to support pin control on the Airoha SoC.\n> +\t  This also provides an interface to the GPIO pins not used by other\n> +\t  peripherals supporting inputs, outputs, configuring pull-up/pull-down\n> +\t  and interrupts on input changes.\n> +\n> +endif\n> +\n> +if ARCH_MEDIATEK\n> +\n>  config PINCTRL_MT7622\n>  \tbool \"MT7622 SoC pinctrl driver\"\n>  \tselect PINCTRL_MTK\n> diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile\n> index b9116c073ea..e3f245bb9d1 100644\n> --- a/drivers/pinctrl/mediatek/Makefile\n> +++ b/drivers/pinctrl/mediatek/Makefile\n> @@ -1,8 +1,11 @@\n>  # SPDX-License-Identifier: GPL-2.0\n>  # Core\n> +ifneq (CONFIG_ARCH_MEDIATEK,)\n\nAs above, I don't think this needs to be in the mediatek folder.\nIf it really does though, I don't think we need the ifneq here\nsince obj-$(CONFIG_PINCTRL_MTK) should already do the right thing.\n\n>  obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o\n> +endif\n>  \n>  # SoC Drivers\n> +obj-$(CONFIG_PINCTRL_AIROHA) += pinctrl-airoha.o\n>  obj-$(CONFIG_PINCTRL_MT7622) += pinctrl-mt7622.o\n>  obj-$(CONFIG_PINCTRL_MT7623) += pinctrl-mt7623.o\n>  obj-$(CONFIG_PINCTRL_MT7629) += pinctrl-mt7629.o\n> diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/mediatek/pinctrl-airoha.c\n> new file mode 100644\n> index 00000000000..0bce5bf97dc\n> --- /dev/null\n> +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c\n> @@ -0,0 +1,3297 @@\n> +// SPDX-License-Identifier: GPL-2.0-only\n> +/*\n> + * Author: Lorenzo Bianconi <lorenzo@kernel.org>\n> + * Author: Benjamin Larsson <benjamin.larsson@genexis.eu>\n> + * Author: Markus Gothe <markus.gothe@genexis.eu>\n> + *\n> + * Adapted for U-Boot by Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>\n> + */\n> +\n> +#include <config.h>\n> +#include <dm.h>\n> +#include <dm/device_compat.h>\n> +#include <dm/device-internal.h>\n> +#include <dm/devres.h>\n> +#include <dm/lists.h>\n> +#include <dm/pinctrl.h>\n> +#include <dm/root.h>\n> +#include <errno.h>\n> +#include <asm/io.h>\n> +#include <asm-generic/gpio.h>\n> +\n> +#include <dt-bindings/pinctrl/mt65xx.h>\n> +#include <linux/bitfield.h>\n> +#include <syscon.h>\n> +#include <regmap.h>\n> +#include <asm/arch/scu-regmap.h>\n> +\n> +#include \"pinctrl-airoha.h\"\n> +\n> +#define PINCTRL_GET_STATE\n\nIt seems like all of these names that start with PINCTRL_ would have a high\nchance of conflicting with generic pinctrl stuff in the future. I suggest\nto add AIROHA_ or airoha_ prefix to all identifiers to avoid this. \n\n> +\n> +#define PINCTRL_PIN_GROUP(id, table)\t\t\t\t\t\\\n> +\tPINCTRL_PINGROUP(id, table##_pins, ARRAY_SIZE(table##_pins))\n> +\n> +#define PINCTRL_FUNC_DESC(id, table)\t\t\t\t\t\\\n> +\t{\t\t\t\t\t\t\t\t\\\n> +\t\t.desc = PINCTRL_PINFUNCTION(id, table##_groups,\t\t\\\n> +\t\t\t\t\t    ARRAY_SIZE(table##_groups)),\\\n> +\t\t.groups = table##_func_group,\t\t\t\t\\\n> +\t\t.group_size = ARRAY_SIZE(table##_func_group),\t\t\\\n> +\t}\n> +\n> +#define PINCTRL_CONF_DESC(p, offset, mask)\t\t\t\t\\\n> +\t{\t\t\t\t\t\t\t\t\\\n> +\t\t.pin = p,\t\t\t\t\t\t\\\n> +\t\t.reg = { offset, mask },\t\t\t\t\\\n> +\t}\n> +\n\n...\n\n> diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.h b/drivers/pinctrl/mediatek/pinctrl-airoha.h\n> new file mode 100644\n> index 00000000000..972a4fb171e\n> --- /dev/null\n> +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.h\n> @@ -0,0 +1,84 @@\n\nIf we split this up and things defined in this file are used in multiple files,\nthen keeping this header is fine. If there is anything that is used in just one\nfile though, I would move it to that .c file.\n\n> +/**\n> + * struct pinfunction - Description about a function\n> + * @name: Name of the function\n> + * @groups: An array of groups for this function\n> + * @ngroups: Number of groups in @groups\n> + * @flags: Additional pin function flags\n> + */\n> +struct pinfunction {\n> +\tconst char *name;\n> +\tconst char * const *groups;\n> +\tsize_t ngroups;\n> +};\n\nAs above, everything in this file should have a airoha_ or AIROHA_\nnamespace prefix.\n\n> +\n> +/* Convenience macro to define a single named pinfunction */\n> +#define PINCTRL_PINFUNCTION(_name, _groups, _ngroups)\t\\\n> +(struct pinfunction) {\t\t\t\t\t\\\n> +\t\t.name = (_name),\t\t\t\\\n> +\t\t.groups = (_groups),\t\t\t\\\n> +\t\t.ngroups = (_ngroups),\t\t\t\\\n> +\t}\n> +\n> +/**\n> + * struct pingroup - provides information on pingroup\n> + * @name: a name for pingroup\n> + * @pins: an array of pins in the pingroup\n> + * @npins: number of pins in the pingroup\n> + */\n> +struct pingroup {\n> +\tconst char *name;\n> +\tconst unsigned int *pins;\n> +\tsize_t npins;\n> +};\n> +\n> +/* Convenience macro to define a single named or anonymous pingroup */\n> +#define PINCTRL_PINGROUP(_name, _pins, _npins)\t\\\n> +(struct pingroup) {\t\t\t\t\\\n> +\t.name = _name,\t\t\t\t\\\n> +\t.pins = _pins,\t\t\t\t\\\n> +\t.npins = _npins,\t\t\t\\\n> +}\n> +\n> +/**\n> + * struct pinctrl_pin_desc - boards/machines provide information on their\n> + * pins, pads or other muxable units in this struct\n> + * @number: unique pin number from the global pin number space\n> + * @name: a name for this pin\n> + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this\n> + */\n> +struct pinctrl_pin_desc {\n> +\tunsigned int number;\n> +\tconst char *name;\n> +\tvoid *drv_data;\n> +};\n> +\n> +/* Convenience macro to define a single named or anonymous pin descriptor */\n> +#define PINCTRL_PIN(a, b) { .number = a, .name = b }\n> +\n> +/*\n> + * Helpful configuration macro to be used in tables etc.\n> + */\n> +#define PIN_CONF_PACKED(p, a) ((a << 8) | ((unsigned long) p & 0xffUL))\n> +\n> +/*\n> + * The following inlines stuffs a configuration parameter and data value\n> + * into and out of an unsigned long argument, as used by the generic pin config\n> + * system. We put the parameter in the lower 8 bits and the argument in the\n> + * upper 24 bits.\n> + */\n> +\n> +static inline enum pin_config_param pinconf_to_config_param(unsigned long config)\n> +{\n> +\treturn (enum pin_config_param) (config & 0xffUL);\n> +}\n> +\n> +static inline u32 pinconf_to_config_argument(unsigned long config)\n> +{\n> +\treturn (u32) ((config >> 8) & 0xffffffUL);\n> +}\n> +\n> +static inline unsigned long pinconf_to_config_packed(enum pin_config_param param,\n> +\t\t\t     u32 argument)\n> +{\n> +\treturn PIN_CONF_PACKED(param, argument);\n> +}\n\nIf some of these are meant to be generic functions or macros used by any driver,\nthen they should be moved to a more generic header file.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=wxBYndP0;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=baylibre.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.b=\"wxBYndP0\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=baylibre.com","phobos.denx.de;\n spf=pass smtp.mailfrom=dlechner@baylibre.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzx5j5zzXz1yHB\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 05:54:33 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id C71A4843D1;\n\tMon, 20 Apr 2026 21:54:30 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 48154843D1; Mon, 20 Apr 2026 21:54:29 +0200 (CEST)","from mail-oi1-x233.google.com (mail-oi1-x233.google.com\n [IPv6:2607:f8b0:4864:20::233])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 7CE87843AF\n for <u-boot@lists.denx.de>; Mon, 20 Apr 2026 21:54:26 +0200 (CEST)","by mail-oi1-x233.google.com with SMTP id\n 5614622812f47-4779b2497b4so2051271b6e.3\n for <u-boot@lists.denx.de>; Mon, 20 Apr 2026 12:54:26 -0700 (PDT)","from ?IPV6:2600:8803:e7e4:500:49fb:b337:a968:94e7?\n ([2600:8803:e7e4:500:49fb:b337:a968:94e7])\n by smtp.gmail.com with ESMTPSA id\n 5614622812f47-479a016b7f7sm7635181b6e.10.2026.04.20.12.54.22\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Mon, 20 Apr 2026 12:54:23 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1776714865;\n x=1777319665;\n darn=lists.denx.de;\n h=content-transfer-encoding:in-reply-to:from:content-language\n :references:to:subject:user-agent:mime-version:date:message-id:from\n :to:cc:subject:date:message-id:reply-to;\n bh=7r5WOeRAyQvorcxqTHtGfwthmVIA5cwJmgJdbvK8MkA=;\n b=wxBYndP0tXT1OAUjz9/F6/B+s0sOfngpv7W2Nu+r1y+gt524xW8wcEhOKKdpMYA99b\n 3kWYrW7kqMZeOprrjATnhjdPcd7DWLVe2w7lVme/DuTHFEMGv11sZWYSXEuS7RCcm6N0\n 5sZU/jtzyN5bd5LzJ+aB7nxzSNOrqRI5pDWGGrcJa7Z1IuVYA8cIpDXp2bJvPjCyP0Pk\n 4rIihrQSOT0KMRd5zAvduaWYcEhgyyihEaI5UGP8I5XWLRSrRv/IC932NFvU0ohvlHsz\n UkjdMoJR+G5ZhsCXLPnTQEkhM/pKWBfGChH4B53Qja8PGLEivSH5GZ2RVtVPBtX9f3kJ\n jbTQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776714865; x=1777319665;\n h=content-transfer-encoding:in-reply-to:from:content-language\n :references:to:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=7r5WOeRAyQvorcxqTHtGfwthmVIA5cwJmgJdbvK8MkA=;\n b=HuXEmmSvgP3OftfqRVXbF35XQvO0wgMifGtzryL4KzmQxncOiJQb5GIti5kN/PHyda\n VjCTlXL+rRZ/UBOjr7d+7dJ4pGIcD8UqKdTqQ+Y0jqXeIsQTf4JGhOuEGw3llxFsHi7G\n 1iC6p/7hERGcXr8LS2gcFvA/FaScR2XWiw5ZqjITtAnMW/kx9SC0j4l6OVAH7/BZ09bX\n SCfY4NbZ1FhU4IceR70chDVBFQ+blpndG0VVExXkzjoYPru6kchIRVKForvqstrR8nj5\n 5Fgp5rfk9JlsC2wEb/1ZJsUoXbENLSA5iASQmWYXBVEnfvXco1so00lsgJIM79c7qBN8\n na6Q==","X-Forwarded-Encrypted":"i=1;\n AFNElJ+yAjJKit8MxkJ4C5/R9/UoyFE6xigGW3CJ2h60K+aV7JlohCCkrp6TUmGGPmwVGyn9Ev+X5vs=@lists.denx.de","X-Gm-Message-State":"AOJu0YyCr7gfDWztSPrLqmkY695Yfh2bRPw0QgQ6JiRoQ6mAx13Lou/6\n Jwn60+eRbYUe6U7GCFBJcPGD+LRcRG36+N2hdgXnUXTCamNVlQ+V7AuCBajvwdqKs7U=","X-Gm-Gg":"AeBDiesOnoS3FfoPBFkuhoxJ0XM8AuIy59I+FFlBxXCqG4JwHBbfPeULCLXOHn1elG1\n cDLLZYKSecPOYoUeT4rQiDRJJ8o6Get+2AibzQIsPtODzVtAAqIq+Kr1Haz2JGJrXU1TwLWTK87\n iFazbLpaoaQLlyrWwFwYNE++p/pG7j1BS1LhrPN7poX+VLNTXWjxx85fuOq2Ku9W+vDtO5pz6ZS\n a26rG2eYLXPiSr9qtvc5ND0IVQDIzxnYGboHN1wZHyeyrrAFPTwZN2T7qFumjMhj470B9jmtgnX\n EjHb8FmziUA+TKGyyG5RQ5Lf51HaxEkWUjrR6T7OpcJGFCMK+LCx3sfSqHwOBZpLXTq8JqaXQSJ\n h+C9Du49qOdkE3gzfJkMUOXsHy4fO7ciWpHKyXhPQCERfyMJMkj426+0W4iIKFTaupOtVLTpx2f\n 3Qeq6iOXLUULGPsu92A3Oe6nF5HTjwB5Hm24436TL8GPvJPW2HsElssknWp3a54spNMCDo4NLkE\n gKgKXONxdGn","X-Received":"by 2002:a05:6808:f06:b0:467:1462:a9a0 with SMTP id\n 5614622812f47-4799c8f26e1mr9843061b6e.15.1776714865107;\n Mon, 20 Apr 2026 12:54:25 -0700 (PDT)","Message-ID":"<1f8ca89f-0740-4ac6-bd18-4cb376518ddd@baylibre.com>","Date":"Mon, 20 Apr 2026 14:54:22 -0500","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] pinctrl: mediatek: add airoha an7581/an7583 pinctrl\n driver","To":"Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,\n Tom Rini <trini@konsulko.com>, Ryder Lee <ryder.lee@mediatek.com>,\n Weijie Gao <weijie.gao@mediatek.com>,\n Chunfeng Yun <chunfeng.yun@mediatek.com>,\n Igor Belwon <igor.belwon@mentallysanemainliners.org>,\n GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,\n Christian Marangi <ansuelsmth@gmail.com>,\n Vitor Sato Eschholz <vsatoes@baylibre.com>,\n Julien Masson <jmasson@baylibre.com>, Julien Stephan\n <jstephan@baylibre.com>, Chris-QJ Chen <chris-qj.chen@mediatek.com>,\n Macpaul Lin <macpaul.lin@mediatek.com>, u-boot@lists.denx.de,\n Lorenzo Bianconi <lorenzo@kernel.org>,\n Benjamin Larsson <benjamin.larsson@genexis.eu>,\n Markus Gothe <markus.gothe@genexis.eu>","References":"<20260420172158.838063-1-mikhail.kshevetskiy@iopsys.eu>","Content-Language":"en-US","From":"David Lechner <dlechner@baylibre.com>","In-Reply-To":"<20260420172158.838063-1-mikhail.kshevetskiy@iopsys.eu>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3682899,"web_url":"http://patchwork.ozlabs.org/comment/3682899/","msgid":"<c6eab955-e5d1-4738-8fcf-f887a6902b65@baylibre.com>","list_archive_url":null,"date":"2026-04-27T19:12:11","subject":"Re: [PATCH] pinctrl: mediatek: add airoha an7581/an7583 pinctrl\n driver","submitter":{"id":87228,"url":"http://patchwork.ozlabs.org/api/people/87228/","name":"David Lechner","email":"dlechner@baylibre.com"},"content":"On 4/23/26 5:20 AM, Benjamin Larsson wrote:\n> On 20/04/2026 21:54, David Lechner wrote:\n>> On 4/20/26 12:21 PM, Mikhail Kshevetskiy wrote:\n>>> The patch adds pinctrl and gpio drivers for an7581/an7583 SoCs.\n>>> The code is based on linux airoha pinctrl driver.\n>>>\n>>> There are several '#if 0' .. '#endif' in the code. This was done\n>> IMHO, `#if 0` is just noise and we should delete it.\n>>\n>>> to make it easier to compare Linux and U-Boot pinctrl drivers.\n>>>\n>>> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>\n>>> ---\n>>>   drivers/pinctrl/mediatek/Kconfig          |   22 +-\n>>>   drivers/pinctrl/mediatek/Makefile         |    3 +\n>>>   drivers/pinctrl/mediatek/pinctrl-airoha.c | 3297 +++++++++++++++++++++\n>> Wowsers! This is a lot of code for one file, let alone one patch. hopefully\n>> we can split it up. For example, move the SoC-specific tables to separate\n>> files.\n> Hi, we have a split patch for linux here:\n> \n> https://sirherobrine23.com.br/airoha_an7523/kernel/pulls/17/files\n> \n> So the code could look something like that and it would make it easier to add more targets later.\n\nYes, splitting it up like this is what I had in mind.\n\n> \n> It would be nice if we could get pointed in a general direction where to take this. The AN7581 and AN7583 are very similar and the Linux kernel reuses lots of tables but I think that optimization makes it harder to add other targets and it adds complexity in the maintenance perspective.\n> \n> Any comments?\n\nPersonally, I don't have a problem with duplicating some tables in the\nchip-specific files to make it easier to maintain.\n\n> \n> MvH\n> \n> Benjamin Larsson\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=GKqhRETy;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=baylibre.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.b=\"GKqhRETy\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=baylibre.com","phobos.denx.de;\n spf=pass smtp.mailfrom=dlechner@baylibre.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4Cqr1xB4z1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 05:12:23 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id D51FC83693;\n\tMon, 27 Apr 2026 21:12:20 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 6B50F83BC4; Mon, 27 Apr 2026 21:12:19 +0200 (CEST)","from mail-oi1-x231.google.com (mail-oi1-x231.google.com\n [IPv6:2607:f8b0:4864:20::231])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id A8D41805D7\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 21:12:15 +0200 (CEST)","by mail-oi1-x231.google.com with SMTP id\n 5614622812f47-479932ccab1so5585983b6e.0\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 12:12:15 -0700 (PDT)","from ?IPV6:2600:8803:e7e4:500:96f5:eee9:c87c:c599?\n ([2600:8803:e7e4:500:96f5:eee9:c87c:c599])\n by smtp.gmail.com with ESMTPSA id\n 5614622812f47-47c28f51315sm2983b6e.3.2026.04.27.12.12.12\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Mon, 27 Apr 2026 12:12:13 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777317133;\n x=1777921933;\n darn=lists.denx.de;\n h=content-transfer-encoding:in-reply-to:from:content-language\n :references:to:subject:user-agent:mime-version:date:message-id:from\n :to:cc:subject:date:message-id:reply-to;\n bh=4OmG8FyQeNIT2fT+fuWv3k9OQc1v2irCbuLgdNyYDLk=;\n b=GKqhRETy8W8c2Jm8W0MHcrfvCfrrZr409REKiith1vSB6KdAoLlIKG7rd9ulbmr5mr\n 3QM8EGZywM3gE8DtwJhgLkYrkvHRjujqdS2BxTfLmq6zxmjYLfgWFnqqTcLQkMmbjFlh\n 1i6K6EZbxKuhUnvsMeBwUtmEgyHe3e6IydV/TI6Izp/QzYljaGHVP5+EIXQbxVqMFsPZ\n Vwxh0q599GmpUNSt/Rr2FLTQHYMMgbbd0bPMPue0Rjj5lCemB5hjxHxCIAp7BLFUDn3r\n MpblzgOPvyTxVM34nPy5moXoB+l17YgV8EKTxdaAP+BHJDBxHw+LiC8bLeKCdLYKzosn\n RE/w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777317133; x=1777921933;\n h=content-transfer-encoding:in-reply-to:from:content-language\n :references:to:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=4OmG8FyQeNIT2fT+fuWv3k9OQc1v2irCbuLgdNyYDLk=;\n b=K2kXFhmxK73LzU7MeoE+pHAGanFKG0IRaWkVfaB8BwCvc1D+0u3YVkzXL1hbfR0XGR\n 7lNvWySlO/07Nx+f4lUYAPIVcbn2r0Yxzu3g40WbUO0xaeGadt3hjPeFTVxe7OX2tMLZ\n +LbueN7m/81pUATelldm//vB6ho62AF8ekYWnuinmfZjOZkuk7prHqSg7zKrw1q2SdGP\n zwFBLOEw2VnywYUmi2P1AYTqEprUHi/SHTBbATX4VCRCH2q2QSIbp6bYPX8q71JQSGj6\n pLV7iCRbHMwW4dJvHNdyMEMI/8U1OCE8hvdFYGVE4bYhPz7YACE54gjcpDZl9IHE6Ezd\n XyTg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/bOP7xR/30oyV9f+gndYk/NC/6XhzZeY4x03Q1gvYgpzud2z0DqLwS/r63KCsWr0lRD8S62g8=@lists.denx.de","X-Gm-Message-State":"AOJu0Ywpw9KlhRzuagVGKoV2HeANS/5g2a7gE0CL6vFyqGS3N3yvzGmS\n GI5XpbecFU2BsSDf5ZAPXqqMiwKudEMIbDKbfSY5g+fm6CS/gL3AXHUa/DwulRqOC2w=","X-Gm-Gg":"AeBDiesRrAFaDz39n5qpXLpwgPLXKvovqNmIM7I9XcamFCqTH+VFLsANBnV6IJUp0uZ\n 6SbyveRBGMSHAXcSs45VsXk/MSxeBVbSfQlXKU6avsgf3e63Wrxm5FH+TUU5sZBmyRGzc88boqu\n fpTttrEsexD1Goi7zxxujAdA9dE4AlBq7eVMmLODRDM9lgC6ky5HPy/YjzaHU23BV8MZIra9meP\n 7X9OhsjdiHGfeiWoxDMSIb6bosfnNbqHAianIsSoEWA6DOmjA+TsLuzreFHJOHA2UAmigDJq1dY\n L2ZVfbI2lWuOnrwDSW5k7h7jImt33OjzsZZd/aEnYMJR3kw/Uy3gsBwVd8fhjiQylr55gt4kF6+\n Psg1yqdlufPSjMu3ywTEfCPcyA/GJFPDMSuDHIzFnINRTdLArKfIqWhEasLl4BsF74ymQ96sDJI\n mxR8ipjoSMovF2pLUNCXHck1H7eHclRoZ5STpCVmH4KV9lbyi+z3Hu3Z4iG7nCoosmwTkluu5FW\n Hcb9X5ssDZa","X-Received":"by 2002:a05:6808:1b10:b0:479:e9d2:26cf with SMTP id\n 5614622812f47-47c28e77201mr19230b6e.15.1777317133496;\n Mon, 27 Apr 2026 12:12:13 -0700 (PDT)","Message-ID":"<c6eab955-e5d1-4738-8fcf-f887a6902b65@baylibre.com>","Date":"Mon, 27 Apr 2026 14:12:11 -0500","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] pinctrl: mediatek: add airoha an7581/an7583 pinctrl\n driver","To":"Benjamin Larsson <benjamin.larsson@genexis.eu>,\n Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,\n Tom Rini <trini@konsulko.com>, Ryder Lee <ryder.lee@mediatek.com>,\n Weijie Gao <weijie.gao@mediatek.com>,\n Chunfeng Yun <chunfeng.yun@mediatek.com>,\n Igor Belwon <igor.belwon@mentallysanemainliners.org>,\n GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,\n Christian Marangi <ansuelsmth@gmail.com>,\n Vitor Sato Eschholz <vsatoes@baylibre.com>,\n Julien Masson <jmasson@baylibre.com>, Julien Stephan\n <jstephan@baylibre.com>, Chris-QJ Chen <chris-qj.chen@mediatek.com>,\n Macpaul Lin <macpaul.lin@mediatek.com>, u-boot@lists.denx.de,\n Lorenzo Bianconi <lorenzo@kernel.org>, Markus Gothe\n <markus.gothe@genexis.eu>, Matheus Sampaio Queiroga\n <srherobrine20@gmail.com>, Linus Walleij <linus.walleij@linaro.org>","References":"<20260420172158.838063-1-mikhail.kshevetskiy@iopsys.eu>\n <1f8ca89f-0740-4ac6-bd18-4cb376518ddd@baylibre.com>\n <79f0b0cc-d412-4dcd-b8d6-8b85946142d5@genexis.eu>","Content-Language":"en-US","From":"David Lechner <dlechner@baylibre.com>","In-Reply-To":"<79f0b0cc-d412-4dcd-b8d6-8b85946142d5@genexis.eu>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]