From: Rob Herring <robh@kernel.org>
To: Xianwei Zhao <xianwei.zhao@amlogic.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 4/5] pinctrl: meson: Add driver support for Amlogic A4 SoCs
Date: Wed, 13 Nov 2024 12:04:05 -0600 [thread overview]
Message-ID: <20241113180405.GA653353-robh@kernel.org> (raw)
In-Reply-To: <20241113-a4_pinctrl-v6-4-35ba2401ee35@amlogic.com>
On Wed, Nov 13, 2024 at 03:29:42PM +0800, Xianwei Zhao wrote:
> Add a new pinctrl driver for Amlogic A4 SoCs which share
> the same register layout as the previous Amlogic S4.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> drivers/pinctrl/meson/Kconfig | 6 +
> drivers/pinctrl/meson/Makefile | 1 +
> drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 1324 ++++++++++++++++++++++++++++
> 3 files changed, 1331 insertions(+)
>
> diff --git a/drivers/pinctrl/meson/Kconfig b/drivers/pinctrl/meson/Kconfig
> index cc397896762c..3e90bb5ec442 100644
> --- a/drivers/pinctrl/meson/Kconfig
> +++ b/drivers/pinctrl/meson/Kconfig
> @@ -67,6 +67,12 @@ config PINCTRL_MESON_S4
> select PINCTRL_MESON_AXG_PMX
> default y
>
> +config PINCTRL_AMLOGIC_A4
> + tristate "Amlogic A4 SoC pinctrl driver"
> + depends on ARM64
> + select PINCTRL_MESON_AXG_PMX
> + default y
> +
> config PINCTRL_AMLOGIC_C3
> tristate "Amlogic C3 SoC pinctrl driver"
> depends on ARM64
> diff --git a/drivers/pinctrl/meson/Makefile b/drivers/pinctrl/meson/Makefile
> index 9e538b9ffb9b..c92a65a83344 100644
> --- a/drivers/pinctrl/meson/Makefile
> +++ b/drivers/pinctrl/meson/Makefile
> @@ -10,5 +10,6 @@ obj-$(CONFIG_PINCTRL_MESON_AXG) += pinctrl-meson-axg.o
> obj-$(CONFIG_PINCTRL_MESON_G12A) += pinctrl-meson-g12a.o
> obj-$(CONFIG_PINCTRL_MESON_A1) += pinctrl-meson-a1.o
> obj-$(CONFIG_PINCTRL_MESON_S4) += pinctrl-meson-s4.o
> +obj-$(CONFIG_PINCTRL_AMLOGIC_A4) += pinctrl-amlogic-a4.o
> obj-$(CONFIG_PINCTRL_AMLOGIC_C3) += pinctrl-amlogic-c3.o
> obj-$(CONFIG_PINCTRL_AMLOGIC_T7) += pinctrl-amlogic-t7.o
> diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> new file mode 100644
> index 000000000000..edc5f2ba2c8a
> --- /dev/null
> +++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> @@ -0,0 +1,1324 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Pin controller and GPIO driver for Amlogic A4 SoC.
> + *
> + * Copyright (c) 2024 Amlogic, Inc. All rights reserved.
> + * Author: Xianwei Zhao <xianwei.zhao@amlogic.com>
> + * Huqiang Qin <huqiang.qin@amlogic.com>
> + */
> +
> +#include "pinctrl-meson.h"
> +#include "pinctrl-meson-axg-pmx.h"
> +#include <dt-bindings/gpio/amlogic-gpio.h>
> +
> +/* Standard port */
> +
> +#define GPIOE_0 0
> +#define GPIOE_1 1
> +
> +#define GPIOD_0 2
> +#define GPIOD_1 3
> +#define GPIOD_2 4
> +#define GPIOD_3 5
> +#define GPIOD_4 6
> +#define GPIOD_5 7
> +#define GPIOD_6 8
> +#define GPIOD_7 9
> +#define GPIOD_8 10
> +#define GPIOD_9 11
> +#define GPIOD_10 12
> +#define GPIOD_11 13
> +#define GPIOD_12 14
> +#define GPIOD_13 15
> +#define GPIOD_14 16
> +#define GPIOD_15 17
The conversion from bank+index to a single index space seems less than
ideal, and looks like a work-around to fit into the existing driver from
a brief look at it.
If there's not really banks of GPIOs here, then DT shouldn't have them
either. The question is does anything need to know the bank number
and/or index? If it's only for human readability (and matching to
datasheet), then just something like this can be done:
#define GPIOD(n) (2 + (n))
Rob
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Xianwei Zhao <xianwei.zhao@amlogic.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 4/5] pinctrl: meson: Add driver support for Amlogic A4 SoCs
Date: Wed, 13 Nov 2024 12:04:05 -0600 [thread overview]
Message-ID: <20241113180405.GA653353-robh@kernel.org> (raw)
In-Reply-To: <20241113-a4_pinctrl-v6-4-35ba2401ee35@amlogic.com>
On Wed, Nov 13, 2024 at 03:29:42PM +0800, Xianwei Zhao wrote:
> Add a new pinctrl driver for Amlogic A4 SoCs which share
> the same register layout as the previous Amlogic S4.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> drivers/pinctrl/meson/Kconfig | 6 +
> drivers/pinctrl/meson/Makefile | 1 +
> drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 1324 ++++++++++++++++++++++++++++
> 3 files changed, 1331 insertions(+)
>
> diff --git a/drivers/pinctrl/meson/Kconfig b/drivers/pinctrl/meson/Kconfig
> index cc397896762c..3e90bb5ec442 100644
> --- a/drivers/pinctrl/meson/Kconfig
> +++ b/drivers/pinctrl/meson/Kconfig
> @@ -67,6 +67,12 @@ config PINCTRL_MESON_S4
> select PINCTRL_MESON_AXG_PMX
> default y
>
> +config PINCTRL_AMLOGIC_A4
> + tristate "Amlogic A4 SoC pinctrl driver"
> + depends on ARM64
> + select PINCTRL_MESON_AXG_PMX
> + default y
> +
> config PINCTRL_AMLOGIC_C3
> tristate "Amlogic C3 SoC pinctrl driver"
> depends on ARM64
> diff --git a/drivers/pinctrl/meson/Makefile b/drivers/pinctrl/meson/Makefile
> index 9e538b9ffb9b..c92a65a83344 100644
> --- a/drivers/pinctrl/meson/Makefile
> +++ b/drivers/pinctrl/meson/Makefile
> @@ -10,5 +10,6 @@ obj-$(CONFIG_PINCTRL_MESON_AXG) += pinctrl-meson-axg.o
> obj-$(CONFIG_PINCTRL_MESON_G12A) += pinctrl-meson-g12a.o
> obj-$(CONFIG_PINCTRL_MESON_A1) += pinctrl-meson-a1.o
> obj-$(CONFIG_PINCTRL_MESON_S4) += pinctrl-meson-s4.o
> +obj-$(CONFIG_PINCTRL_AMLOGIC_A4) += pinctrl-amlogic-a4.o
> obj-$(CONFIG_PINCTRL_AMLOGIC_C3) += pinctrl-amlogic-c3.o
> obj-$(CONFIG_PINCTRL_AMLOGIC_T7) += pinctrl-amlogic-t7.o
> diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> new file mode 100644
> index 000000000000..edc5f2ba2c8a
> --- /dev/null
> +++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> @@ -0,0 +1,1324 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Pin controller and GPIO driver for Amlogic A4 SoC.
> + *
> + * Copyright (c) 2024 Amlogic, Inc. All rights reserved.
> + * Author: Xianwei Zhao <xianwei.zhao@amlogic.com>
> + * Huqiang Qin <huqiang.qin@amlogic.com>
> + */
> +
> +#include "pinctrl-meson.h"
> +#include "pinctrl-meson-axg-pmx.h"
> +#include <dt-bindings/gpio/amlogic-gpio.h>
> +
> +/* Standard port */
> +
> +#define GPIOE_0 0
> +#define GPIOE_1 1
> +
> +#define GPIOD_0 2
> +#define GPIOD_1 3
> +#define GPIOD_2 4
> +#define GPIOD_3 5
> +#define GPIOD_4 6
> +#define GPIOD_5 7
> +#define GPIOD_6 8
> +#define GPIOD_7 9
> +#define GPIOD_8 10
> +#define GPIOD_9 11
> +#define GPIOD_10 12
> +#define GPIOD_11 13
> +#define GPIOD_12 14
> +#define GPIOD_13 15
> +#define GPIOD_14 16
> +#define GPIOD_15 17
The conversion from bank+index to a single index space seems less than
ideal, and looks like a work-around to fit into the existing driver from
a brief look at it.
If there's not really banks of GPIOs here, then DT shouldn't have them
either. The question is does anything need to know the bank number
and/or index? If it's only for human readability (and matching to
datasheet), then just something like this can be done:
#define GPIOD(n) (2 + (n))
Rob
next prev parent reply other threads:[~2024-11-13 18:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 7:29 [PATCH v6 0/5] Pinctrl: A4: Add pinctrl driver Xianwei Zhao
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` [PATCH v6 1/5] dt-bindings: pinctrl: move gpio-cells property Xianwei Zhao
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 8:31 ` Rob Herring (Arm)
2024-11-13 8:31 ` Rob Herring (Arm)
2024-11-13 7:29 ` [PATCH v6 2/5] dt-bindings: pinctrl: Add support for Amlogic A4 SoCs Xianwei Zhao
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 8:31 ` Rob Herring (Arm)
2024-11-13 8:31 ` Rob Herring (Arm)
2024-11-13 7:29 ` [PATCH v6 3/5] pinctrl: meson: add interface of of_xlate Xianwei Zhao
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` [PATCH v6 4/5] pinctrl: meson: Add driver support for Amlogic A4 SoCs Xianwei Zhao
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 18:04 ` Rob Herring [this message]
2024-11-13 18:04 ` Rob Herring
2024-11-14 9:21 ` Neil Armstrong
2024-11-14 9:21 ` Neil Armstrong
2024-11-15 17:14 ` Rob Herring
2024-11-15 17:14 ` Rob Herring
2024-11-18 8:41 ` neil.armstrong
2024-11-18 8:41 ` neil.armstrong
2024-11-13 7:29 ` [PATCH v6 5/5] arm64: dts: amlogic: a4: add pinctrl node Xianwei Zhao
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
2024-11-13 7:29 ` Xianwei Zhao via B4 Relay
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=20241113180405.GA653353-robh@kernel.org \
--to=robh@kernel.org \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=xianwei.zhao@amlogic.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.