From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Samuel Holland <samuel@sholland.org>,
Andre Przywara <andre.przywara@arm.com>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/8] pinctrl: sunxi: allow reading mux values from DT
Date: Tue, 18 Feb 2025 18:09:09 +0100 [thread overview]
Message-ID: <12609538.O9o76ZdvQC@jernej-laptop> (raw)
In-Reply-To: <20250214003734.14944-6-andre.przywara@arm.com>
Dne petek, 14. februar 2025 ob 01:37:31 Srednjeevropski standardni čas je Andre Przywara napisal(a):
> So far every Allwinner SoC needs a large table in the kernel code, to
> describe the mapping between the pinctrl function names ("uart") and
> the actual pincontroller mux value to be written into the registers.
> This adds a lot of data into a single image kernel, and also looks
> somewhat weird, as the DT can easily store the mux value.
>
> Add some code that allows to avoid that table: the struct that describes
> the existing pins will be build at *runtime*, based on very basic
> information provided by the respective SoC's pinctrl driver. This
> consists of the number of pins per bank, plus information which bank
> provides IRQ support, along with the mux value to use for that.
> The code will then iterate over all children of the pincontroller DT
> node (which describe each pin group), and populate that struct with the
> mapping between function names and mux values. The only thing that needs
> adding in the DT is a property with that value, per pin group.
>
> When this table is built, it will be handed over to the existing sunxi
> pinctrl driver, which cannot tell a difference between a hardcoded
> struct and this new one built at runtime. It will take care of
> registering the pinctrl device with the pinctrl subsystem.
>
> All a new SoC driver would need to do is to provide two arrays, and then
> call the sunxi_pinctrl_dt_table_init() function.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
I went through the code and it makes sense. I wonder if we really need to
build whole table instead of having on demand lookups into DT. However,
for now, this will do. So:
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Thanks!
Best regards,
Jernej
next prev parent reply other threads:[~2025-02-18 17:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 0:37 [PATCH v2 0/8] pinctrl: sunxi: Add Allwinner A523 support Andre Przywara
2025-02-14 0:37 ` [PATCH v2 1/8] pinctrl: sunxi: refactor pinctrl variants into flags Andre Przywara
2025-02-14 0:37 ` [PATCH v2 2/8] pinctrl: sunxi: increase number of GPIO bank regulators Andre Przywara
2025-02-17 15:11 ` Chen-Yu Tsai
2025-02-14 0:37 ` [PATCH v2 3/8] pinctrl: sunxi: move bank K register offset Andre Przywara
2025-02-17 15:12 ` Chen-Yu Tsai
2025-02-14 0:37 ` [PATCH v2 4/8] pinctrl: sunxi: support moved power configuration registers Andre Przywara
2025-02-17 15:48 ` Chen-Yu Tsai
2025-02-27 12:18 ` Andre Przywara
2025-02-14 0:37 ` [PATCH v2 5/8] pinctrl: sunxi: allow reading mux values from DT Andre Przywara
2025-02-18 17:09 ` Jernej Škrabec [this message]
2025-02-27 11:46 ` Andre Przywara
2025-02-14 0:37 ` [PATCH v2 6/8] dt-bindings: pinctrl: add compatible for Allwinner A523/T527 Andre Przywara
2025-02-14 1:19 ` Rob Herring (Arm)
2025-02-27 11:46 ` Andre Przywara
2025-02-27 12:46 ` Chen-Yu Tsai
2025-02-14 0:37 ` [PATCH v2 7/8] pinctrl: sunxi: Add support for the Allwinner A523 Andre Przywara
2025-02-14 0:37 ` [PATCH v2 8/8] pinctrl: sunxi: Add support for the secondary A523 GPIO ports Andre Przywara
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=12609538.O9o76ZdvQC@jernej-laptop \
--to=jernej.skrabec@gmail.com \
--cc=andre.przywara@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.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-sunxi@lists.linux.dev \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@csie.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