From: Neil Armstrong <neil.armstrong@linaro.org>
To: xianwei.zhao@amlogic.com,
Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: 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 v5 3/5] pinctrl: meson: add interface of of_xlate
Date: Tue, 12 Nov 2024 14:28:34 +0100 [thread overview]
Message-ID: <69918f77-c0d6-4151-b725-e5051f0f6680@linaro.org> (raw)
In-Reply-To: <20241112-a4_pinctrl-v5-3-3460ce10c480@amlogic.com>
On 12/11/2024 11:26, Xianwei Zhao via B4 Relay wrote:
> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
>
> Amlogic pinctrl software framework use system API of_gpio_simple_xlate
> which only support linear one-to-one correspondence to translate gpiospec
> to the GPIO number and flags before. It can not meet the non-linear needs.
> Add the interface satisfies the underlying driver to implement the
> transformation to meet the needs of various scenarios.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> drivers/pinctrl/meson/pinctrl-meson.c | 4 ++++
> drivers/pinctrl/meson/pinctrl-meson.h | 4 ++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index 253a0cc57e39..fc0c0bef38c0 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c
> @@ -620,6 +620,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
> pc->chip.base = -1;
> pc->chip.ngpio = pc->data->num_pins;
> pc->chip.can_sleep = false;
> + if (pc->data->of_xlate) {
> + pc->chip.of_gpio_n_cells = pc->data->of_gpio_n_cells;
> + pc->chip.of_xlate = pc->data->of_xlate;
> + }
>
> ret = gpiochip_add_data(&pc->chip, pc);
> if (ret) {
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h
> index 7883ea31a001..cbb3f22552b9 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.h
> +++ b/drivers/pinctrl/meson/pinctrl-meson.h
> @@ -120,6 +120,10 @@ struct meson_pinctrl_data {
> const struct pinmux_ops *pmx_ops;
> const void *pmx_data;
> int (*parse_dt)(struct meson_pinctrl *pc);
> + int (*of_xlate)(struct gpio_chip *gc,
> + const struct of_phandle_args *gpiospec,
> + u32 *flags);
> + int of_gpio_n_cells;
> };
>
> struct meson_pinctrl {
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2024-11-12 14:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 10:26 [PATCH v5 0/5] Pinctrl: A4: Add pinctrl driver Xianwei Zhao via B4 Relay
2024-11-12 10:26 ` [PATCH v5 1/5] dt-bindings: pinctrl: modify gpio-cells property Xianwei Zhao via B4 Relay
2024-11-12 13:26 ` Neil Armstrong
2024-11-13 2:23 ` Xianwei Zhao
2024-11-12 10:26 ` [PATCH v5 2/5] dt-bindings: pinctrl: Add support for Amlogic A4 SoCs Xianwei Zhao via B4 Relay
2024-11-12 10:26 ` [PATCH v5 3/5] pinctrl: meson: add interface of of_xlate Xianwei Zhao via B4 Relay
2024-11-12 13:28 ` Neil Armstrong [this message]
2024-11-12 10:26 ` [PATCH v5 4/5] pinctrl: meson: Add driver support for Amlogic A4 SoCs Xianwei Zhao via B4 Relay
2024-11-12 13:33 ` Neil Armstrong
2024-11-12 10:26 ` [PATCH v5 5/5] arm64: dts: amlogic: a4: add pinctrl node Xianwei Zhao via B4 Relay
2024-11-12 13:34 ` Neil Armstrong
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=69918f77-c0d6-4151-b725-e5051f0f6680@linaro.org \
--to=neil.armstrong@linaro.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=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox