From: Diogo Ivo <diogo.ivo.sx@renesas.com>
To: claudiu beznea <claudiu.beznea@tuxon.dev>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Frank Li <Frank.Li@nxp.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Linus Walleij <linusw@kernel.org>
Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2 5/7] pinctrl: renesas: rzg2l: Split SoC-specific masks in struct rzg2l_register_masks
Date: Fri, 27 Nov 2026 15:03:18 +0100 [thread overview]
Message-ID: <5689301f-f7b0-43ce-9555-22faa7af965d@renesas.com> (raw)
In-Reply-To: <121cc552-86b6-40de-ba9d-0ae40f8a1ed2@tuxon.dev>
Hi Claudiu,
On 11/27/2026 10:16 AM, claudiu beznea wrote:
> Hi, Diogo,
>
> On 10/26/26 13:35, Diogo Ivo wrote:
>> struct rzg2l_register_masks declares the masks of the OTHER_POC register
>> of RZ/G3L and of the I3C_SET_POC register of RZ/G3S in two branches of an
>> anonymous union. As both branches share the same storage, initializing
>> both
>> other_poc_pvdd1833_oth_awo_poc and i3c_set_poc on RZ/G3L would have the
>> designated initializers override each other, ending up with the
>> I3C_SET_POC
>> value in the PVDD1833_OTH_AWO_POC mask.
>>
>> Split the union into a common area, for masks shared by multiple SoCs,
>> and
>> per-SoC areas: the RZ/G3S and RZ/G3L I3C_SET_POC mask moves to the common
>> area, and the RZ/G3L OTHER_POC masks stay in a dedicated RZ/G3L area.
>> This
>> way every mask gets its own member,
>
> > and new SoCs can be described by> adding their own struct
>> (possibly inside a union).
>
> That may be missed by the next person adding it...
Ack, that is a good point. I will add it to v2 if Geert is ok with this
approach.
>>
>> The existing RZ/G3S data only initializes i3c_set_poc, so it is not
>> affected by this change.
>>
>> Signed-off-by: Diogo Ivo <diogo.ivo.sx@renesas.com>
>> ---
>> Changes in v2:
>> - No changes
>> ---
>> drivers/pinctrl/renesas/pinctrl-rzg2l.c | 20 ++++++++------------
>> 1 file changed, 8 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/
>> pinctrl/renesas/pinctrl-rzg2l.c
>> index 9bf3743dc1ce..f73d273df362 100644
>> --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
>> +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
>> @@ -278,18 +278,14 @@ struct rzg2l_register_offsets {
>> * @i3c_set_poc: I3C_SET_POC mask
>> */
>> struct rzg2l_register_masks {
>> - union {
>> - /* RZ/G3L masks */
>> - struct {
>> - u8 other_poc_pvdd1833_oth_awo_poc;
>> - u8 other_poc_pvdd1833_oth_iso_poc;
>> - u8 other_poc_wdtovf_n_poc;
>> - };
>> -
>> - /* RZ/G3S masks */
>> - struct {
>> - u8 i3c_set_poc;
>> - };
>> + /* Masks common to multiple SoCs */
>> + u8 i3c_set_poc; /* RZ/G3S, RZ/G3L */
>
> I would drop the names of the SoCs close to the i3c_set_poc. That have
> the opportunity to grow over time. As Geert considers better.
Ok, I will wait for feedback here then but I am ok with dropping the SoC
names.
>> +
>> + /* RZ/G3L masks */
>> + struct {
>> + u8 other_poc_pvdd1833_oth_awo_poc;
>> + u8 other_poc_pvdd1833_oth_iso_poc;
>> + u8 other_poc_wdtovf_n_poc;
>> };
>
> OK, we can drop the union but the next SoC addition may be:
>
> /* New SoC masks */
> struct {
> u8 x;
> u8 y;
> };
>
> If we want to keep the initial form we may need to pay attention.
>
> Patch is OK for me, just with the mention that we need to pay attention
> if we want to keep, for the future, the approach before this patch.
Ok, then if Geert is ok with removing the union for now and possibly
reviving it later I will state this clearly in the commit message.
>
> Thank you,
> Claudiu
next prev parent reply other threads:[~2026-11-27 14:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 11:35 [PATCH v2 0/7] i3c: renesas: Add RZ/G3L support Diogo Ivo
2026-10-26 11:35 ` [PATCH v2 1/7] i3c: renesas: Fix zero I2C SCL rate on pure I3C buses Diogo Ivo
2026-10-26 20:24 ` Frank Li
2026-11-27 9:12 ` claudiu beznea
2026-11-27 13:51 ` Diogo Ivo
2026-10-26 11:35 ` [PATCH v2 2/7] i3c: renesas: Drop comma after OF match table sentinel Diogo Ivo
2026-11-27 9:17 ` claudiu beznea
2026-10-26 11:35 ` [PATCH v2 3/7] dt-bindings: i3c: renesas,i3c: Add RZ/G3L support Diogo Ivo
2026-10-28 11:30 ` Krzysztof Kozlowski
2026-11-01 20:25 ` Wolfram Sang
2026-10-26 11:35 ` [PATCH v2 4/7] clk: renesas: r9a08g046: Add I3C clocks and resets Diogo Ivo
2026-11-02 15:34 ` Geert Uytterhoeven
2026-10-26 11:35 ` [PATCH v2 5/7] pinctrl: renesas: rzg2l: Split SoC-specific masks in struct rzg2l_register_masks Diogo Ivo
2026-11-27 9:16 ` claudiu beznea
2026-11-27 14:03 ` Diogo Ivo [this message]
2026-10-26 11:35 ` [PATCH v2 6/7] pinctrl: renesas: rzg2l: Add RZ/G3L support for selecting I3C power source Diogo Ivo
2026-11-27 9:17 ` claudiu beznea
2026-10-26 11:35 ` [PATCH v2 7/7] arm64: dts: renesas: r9a08g046: Add I3C support Diogo Ivo
2026-11-01 20:34 ` Wolfram Sang
2026-11-25 10:12 ` [PATCH v2 0/7] i3c: renesas: Add RZ/G3L support Diogo Ivo
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=5689301f-f7b0-43ce-9555-22faa7af965d@renesas.com \
--to=diogo.ivo.sx@renesas.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=bmasney+clk@redhat.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=jbrunet+clk@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tommaso.merciai.xr@bp.renesas.com \
--cc=wsa+renesas@sang-engineering.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®