From: Xianwei Zhao via B4 Relay <devnull+xianwei.zhao.amlogic.com@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.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>
Cc: linux-amlogic@lists.infradead.org, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Xianwei Zhao <xianwei.zhao@amlogic.com>
Subject: [PATCH v2 4/8] pinctrl: meson: a4: remove special data processing
Date: Wed, 21 May 2025 11:19:58 +0800 [thread overview]
Message-ID: <20250521-s6-s7-pinctrl-v2-4-0ce5e3728404@amlogic.com> (raw)
In-Reply-To: <20250521-s6-s7-pinctrl-v2-0-0ce5e3728404@amlogic.com>
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
According to the data specifications of Amlogic's existing SoCs,
the function register offset and the bit offset are the same
value among various chips. Therefore, general processing can
be carried out without the need for private data modification.
Drop special data processing.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 33 +++---------------------------
1 file changed, 3 insertions(+), 30 deletions(-)
diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index a76f266b4b94..90d4d10ca10b 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -50,15 +50,8 @@ struct aml_pio_control {
u32 bit_offset[AML_NUM_REG];
};
-struct aml_reg_bit {
- u32 bank_id;
- u32 reg_offs[AML_NUM_REG];
- u32 bit_offs[AML_NUM_REG];
-};
-
struct aml_pctl_data {
unsigned int number;
- struct aml_reg_bit rb_offs[];
};
struct aml_pmx_func {
@@ -843,31 +836,11 @@ static const struct gpio_chip aml_gpio_template = {
static void init_bank_register_bit(struct aml_pinctrl *info,
struct aml_gpio_bank *bank)
{
- const struct aml_pctl_data *data = info->data;
- const struct aml_reg_bit *aml_rb;
- bool def_offs = true;
int i;
- if (data) {
- for (i = 0; i < data->number; i++) {
- aml_rb = &data->rb_offs[i];
- if (bank->bank_id == aml_rb->bank_id) {
- def_offs = false;
- break;
- }
- }
- }
-
- if (def_offs) {
- for (i = 0; i < AML_NUM_REG; i++) {
- bank->pc.reg_offset[i] = aml_def_regoffs[i];
- bank->pc.bit_offset[i] = 0;
- }
- } else {
- for (i = 0; i < AML_NUM_REG; i++) {
- bank->pc.reg_offset[i] = aml_rb->reg_offs[i];
- bank->pc.bit_offset[i] = aml_rb->bit_offs[i];
- }
+ for (i = 0; i < AML_NUM_REG; i++) {
+ bank->pc.reg_offset[i] = aml_def_regoffs[i];
+ bank->pc.bit_offset[i] = 0;
}
}
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2025-05-21 3:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 1/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7 Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 2/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D Xianwei Zhao via B4 Relay
2025-05-21 9:15 ` Krzysztof Kozlowski
2025-05-21 3:19 ` [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6 Xianwei Zhao via B4 Relay
2025-05-21 9:16 ` Krzysztof Kozlowski
2025-05-22 1:59 ` Xianwei Zhao
2025-05-21 3:19 ` Xianwei Zhao via B4 Relay [this message]
2025-05-21 3:19 ` [PATCH v2 5/8] pinctrl: meson: support amlogic S6/S7/S7D SoC Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 6/8] dts: arm64: amlogic: add S7 pinctrl node Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 7/8] dts: arm64: amlogic: add S7D " Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 8/8] dts: arm64: amlogic: add S6 " 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=20250521-s6-s7-pinctrl-v2-4-0ce5e3728404@amlogic.com \
--to=devnull+xianwei.zhao.amlogic.com@kernel.org \
--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=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
all inboxes | Powered by JetHome®