mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Frank Wunderlich <linux@fw-web.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Sean Wang <sean.wang@kernel.org>
Cc: "Frank Wunderlich" <frank-w@public-files.de>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, daniel@makrotopia.org,
	john@phrozen.org, ansuelsmth@gmail.com, eladwf@gmail.com,
	"Sam Shih" <sam.shih@mediatek.com>,
	"Arınç ÜNAL" <arinc.unal@arinc9.com>
Subject: Re: [PATCH v4 2/4] pinctrl: mediatek: add MT7988 pinctrl driver
Date: Thu, 10 Oct 2024 14:28:07 +0200	[thread overview]
Message-ID: <d1a9f533-3a9e-47c2-9476-c54653b56e68@collabora.com> (raw)
In-Reply-To: <20241009165222.5670-3-linux@fw-web.de>

Il 09/10/24 18:52, Frank Wunderlich ha scritto:
> From: Daniel Golle <daniel@makrotopia.org>
> 
> Add pinctrl driver for the MediaTek MT7988 SoC.
> 
> Signed-off-by: Sam Shih <sam.shih@mediatek.com>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> [correctly initialise for the function_desc structure]
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>   drivers/pinctrl/mediatek/Kconfig          |    7 +
>   drivers/pinctrl/mediatek/Makefile         |    1 +
>   drivers/pinctrl/mediatek/pinctrl-mt7988.c | 1526 +++++++++++++++++++++
>   3 files changed, 1534 insertions(+)
>   create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7988.c
> 
> diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig
> index 7af287252834..952110c783d4 100644
> --- a/drivers/pinctrl/mediatek/Kconfig
> +++ b/drivers/pinctrl/mediatek/Kconfig
> @@ -187,6 +187,13 @@ config PINCTRL_MT7986
>   	default ARM64 && ARCH_MEDIATEK
>   	select PINCTRL_MTK_MOORE
>   
> +config PINCTRL_MT7988
> +	bool "Mediatek MT7988 pin control"
> +	depends on OF
> +	depends on ARM64 || COMPILE_TEST
> +	default ARM64 && ARCH_MEDIATEK
> +	select PINCTRL_MTK_MOORE
> +
>   config PINCTRL_MT8167
>   	bool "MediaTek MT8167 pin control"
>   	depends on OF
> diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile
> index 680f7e8526e0..2b47ce030b54 100644
> --- a/drivers/pinctrl/mediatek/Makefile
> +++ b/drivers/pinctrl/mediatek/Makefile
> @@ -27,6 +27,7 @@ obj-$(CONFIG_PINCTRL_MT7623)		+= pinctrl-mt7623.o
>   obj-$(CONFIG_PINCTRL_MT7629)		+= pinctrl-mt7629.o
>   obj-$(CONFIG_PINCTRL_MT7981)		+= pinctrl-mt7981.o
>   obj-$(CONFIG_PINCTRL_MT7986)		+= pinctrl-mt7986.o
> +obj-$(CONFIG_PINCTRL_MT7988)		+= pinctrl-mt7988.o
>   obj-$(CONFIG_PINCTRL_MT8167)		+= pinctrl-mt8167.o
>   obj-$(CONFIG_PINCTRL_MT8173)		+= pinctrl-mt8173.o
>   obj-$(CONFIG_PINCTRL_MT8183)		+= pinctrl-mt8183.o
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7988.c b/drivers/pinctrl/mediatek/pinctrl-mt7988.c
> new file mode 100644
> index 000000000000..5479f4fa47a7
> --- /dev/null
> +++ b/drivers/pinctrl/mediatek/pinctrl-mt7988.c
> @@ -0,0 +1,1526 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * The MT7988 driver based on Linux generic pinctrl binding.
> + *
> + * Copyright (C) 2020 MediaTek Inc.
> + * Author: Sam Shih <sam.shih@mediatek.com>
> + */
> +
> +#include "pinctrl-moore.h"
> +
> +enum MT7988_PINCTRL_REG_PAGE {

Lowercase name for the enumeration, please.

> +	GPIO_BASE,
> +	IOCFG_TR_BASE,
> +	IOCFG_BR_BASE,
> +	IOCFG_RB_BASE,
> +	IOCFG_LB_BASE,
> +	IOCFG_TL_BASE,
> +};
> +

..snip..

> +static const struct mtk_eint_hw mt7988_eint_hw = {
> +	.port_mask = 7,
> +	.ports = 7,
> +	.ap_num = ARRAY_SIZE(mt7988_pins),
> +	.db_cnt = 16,

Are you sure that the EINT controller in this SoC doesn't have the
DBNC_SET and DBNC_CLR registers?

Another way of asking the same thing: are you sure that this SoC does
not support interrupt debounce?

> +};
> +
> +static const char * const mt7988_pinctrl_register_base_names[] = {
> +	"gpio",	 "iocfg_tr", "iocfg_br",
> +	"iocfg_rb", "iocfg_lb", "iocfg_tl",
> +};
> +
> +static struct mtk_pin_soc mt7988_data = {
> +	.reg_cal = mt7988_reg_cals,
> +	.pins = mt7988_pins,
> +	.npins = ARRAY_SIZE(mt7988_pins),
> +	.grps = mt7988_groups,
> +	.ngrps = ARRAY_SIZE(mt7988_groups),
> +	.funcs = mt7988_functions,
> +	.nfuncs = ARRAY_SIZE(mt7988_functions),
> +	.eint_hw = &mt7988_eint_hw,
> +	.gpio_m = 0,
> +	.ies_present = false,
> +	.base_names = mt7988_pinctrl_register_base_names,
> +	.nbase_names = ARRAY_SIZE(mt7988_pinctrl_register_base_names),
> +	.bias_disable_set = mtk_pinconf_bias_disable_set,
> +	.bias_disable_get = mtk_pinconf_bias_disable_get,
> +	.bias_set = mtk_pinconf_bias_set,
> +	.bias_get = mtk_pinconf_bias_get,
> +	.pull_type = mt7988_pull_type,
> +	.bias_set_combo = mtk_pinconf_bias_set_combo,
> +	.bias_get_combo = mtk_pinconf_bias_get_combo,
> +	.drive_set = mtk_pinconf_drive_set_rev1,
> +	.drive_get = mtk_pinconf_drive_get_rev1,
> +	.adv_pull_get = mtk_pinconf_adv_pull_get,
> +	.adv_pull_set = mtk_pinconf_adv_pull_set,
> +};
> +
> +static const struct of_device_id mt7988_pinctrl_of_match[] = {

Please compress that to a single line.

{ .compatible = "mediatek,mt7988-pinctrl" },


Cheers,
Angelo



  reply	other threads:[~2024-10-10 12:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 16:52 [PATCH v4 0/4] Add pinctrl support for mt7988 Frank Wunderlich
2024-10-09 16:52 ` [PATCH v4 1/4] pinctrl: mediatek: add support for MTK_PULL_PD_TYPE Frank Wunderlich
2024-10-10  9:42   ` AngeloGioacchino Del Regno
2024-10-09 16:52 ` [PATCH v4 2/4] pinctrl: mediatek: add MT7988 pinctrl driver Frank Wunderlich
2024-10-10 12:28   ` AngeloGioacchino Del Regno [this message]
2024-10-18 15:22     ` Aw: " Frank Wunderlich
2024-10-09 16:52 ` [PATCH v4 3/4] dt-bindings: pinctrl: add binding for MT7988 SoC Frank Wunderlich
2024-10-09 21:19   ` Rob Herring (Arm)
2024-10-11 14:39     ` Aw: " Frank Wunderlich
2024-10-09 16:52 ` [PATCH v4 4/4] arm64: dts: mediatek: mt7988: add pinctrl support Frank Wunderlich
2024-10-10 12:36   ` AngeloGioacchino Del Regno
2024-10-11 12:53     ` Aw: " Frank Wunderlich
2024-10-14  8:15       ` AngeloGioacchino Del Regno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d1a9f533-3a9e-47c2-9476-c54653b56e68@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=ansuelsmth@gmail.com \
    --cc=arinc.unal@arinc9.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eladwf@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=john@phrozen.org \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@fw-web.de \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=sam.shih@mediatek.com \
    --cc=sean.wang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®