Devicetree
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea+renesas@tuxon.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linusw@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, magnus.damm@gmail.com,
	prabhakar.mahadev-lad.rj@bp.renesas.com,
	claudiu.beznea@tuxon.dev, linux-renesas-soc@vger.kernel.org,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v6 3/5] pinctrl: renesas: rzg2l: Unify the power source handling
Date: Thu, 3 Sep 2026 19:32:45 +0300	[thread overview]
Message-ID: <40c96e12-f2f1-4d95-a95f-d4a9cbde7ab4@tuxon.dev> (raw)
In-Reply-To: <CAMuHMdV9C6LVBqYWo=Njgf3v4a5R1LhBwKuB5H3TFctOCr338g@mail.gmail.com>

Hi, Geert,

On 9/3/26 18:32, Geert Uytterhoeven wrote:
> Hi Claudiu,
> 
> On Thu, 3 Sept 2026 at 13:34, Claudiu Beznea
> <claudiu.beznea+renesas@tuxon.dev> wrote:
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> The previous code handled power sources using a mixture of power
>> source specific definitions and lookups in the available_ps[] array.
>> Unify the power source handling by introducing
>> struct rzg2l_pinctrl_ps_desc, whose purpose is to describe a power
>> source through its power source value, associated register value,
>> associated capabilities (e.g. Ethernet), and associated IOLH index.
>>
>> Introduce two new functions, rzg2l_ps_to_desc() and
>> rzg2l_pwr_reg_val_to_desc(), using the
>> RZG2L_PINCTRL_PS_DESC_MEMBER_TO_DESC_FUNC() macro, as their
>> implementations are similar.
>>
>> These functions retrieve a power source descriptor based on either a
>> power source value or a power source register value. Other functions
>> that need to perform power source specific operations can call them to
>> retrieve the corresponding power source descriptor.
>>
>> The register values for the soft power sources were kept to zero since
>> they are not used across the driver's code.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>> ---
>>
>> Changes in v6:
>> - described all the available power sources in the available_ps[]
>>    array and dropped to wildcard approach to avoid letting the user
>>    selecting unavailable power source for pins
>> - simplified RZG2L_PINCTRL_PS_DESC_MEMBER_TO_DESC_FUNC()
>> - for these two points ^ didn't collect the Wolfram's Tb tag
>> - dropped rzg2l_ps_is_supported()
>> - used conditional operator in rzg2l_ps_to_iolh_idx()
>> - adjusted the patch description
> 
> Thanks for the update!
> 
>> --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
>> +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> 
>> +static const struct rzg2l_pinctrl_ps_desc available_ps[] = {
>> +       /* Ethernet I/O voltage domains */
>> +       RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1,
>> +                             RZG2L_IOLH_IDX_1V8),
>> +       RZG2L_PINCTRL_PS_DESC(2500, 2, PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1,
>> +                             RZG2L_IOLH_IDX_2V5),
>> +       RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_IO_VMC_ETH0 | PIN_CFG_IO_VMC_ETH1,
>> +                             RZG2L_IOLH_IDX_3V3),
>> +
>> +       /* SD I/O voltage domains */
>> +       RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_IO_VMC_SD0 | PIN_CFG_IO_VMC_SD1 |
>> +                             PIN_CFG_IO_VMC_SD2, RZG2L_IOLH_IDX_1V8),
>> +       RZG2L_PINCTRL_PS_DESC(2500, 2, PIN_CFG_IO_VMC_SD0 | PIN_CFG_IO_VMC_SD1 |
>> +                             PIN_CFG_IO_VMC_SD2, RZG2L_IOLH_IDX_2V5),
> 
> Before (see below), only Ethernet could select the 2.5V domain, so
> shouldn't this entry be dropped?

That's a mistake. I'll drop it from here and from QSPI section.

> 
>> +       RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_IO_VMC_SD0 | PIN_CFG_IO_VMC_SD1 |
>> +                             PIN_CFG_IO_VMC_SD2, RZG2L_IOLH_IDX_3V3),
>> +
>> +       /* QSPI I/O voltage domains */
>> +       RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_IO_VMC_QSPI, RZG2L_IOLH_IDX_1V8),
>> +       RZG2L_PINCTRL_PS_DESC(2500, 2, PIN_CFG_IO_VMC_QSPI, RZG2L_IOLH_IDX_2V5),
> 
> Same here?
> 
>> +       RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_IO_VMC_QSPI, RZG2L_IOLH_IDX_3V3),
>> +
>> +       /* AWO I/O voltage domains */
>> +       RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_PVDD1833_OTH_AWO_POC,
>> +                             RZG2L_IOLH_IDX_1V8),
>> +       RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_PVDD1833_OTH_AWO_POC,
>> +                             RZG2L_IOLH_IDX_3V3),
>> +
>> +       /* ISO I/O voltage domains */
>> +       RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_PVDD1833_OTH_ISO_POC,
>> +                             RZG2L_IOLH_IDX_1V8),
>> +       RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_PVDD1833_OTH_ISO_POC,
>> +                             RZG2L_IOLH_IDX_3V3),
>> +
>> +       /* WDTOVF I/O voltage domains */
>> +       RZG2L_PINCTRL_PS_DESC(1800, 1, PIN_CFG_WDTOVF_N_POC, RZG2L_IOLH_IDX_1V8),
>> +       RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_WDTOVF_N_POC, RZG2L_IOLH_IDX_3V3),
>> +
>> +       /* Software voltage domains */
>> +       RZG2L_PINCTRL_PS_DESC(1800, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_1V8),
>> +       RZG2L_PINCTRL_PS_DESC(2500, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_2V5),
>> +       RZG2L_PINCTRL_PS_DESC(3300, 0, PIN_CFG_SOFT_PS, RZG2L_IOLH_IDX_3V3),
> 
> I never really understood PIN_CFG_SOFT_PS...

That was to match b/w a voltage and an IOLH value according to the table from 
45.3.7 Driving Ability Control Register (IOLH_m) in the RZ/G3S manual (rev.1.30)

Thank you,
Claudiu

  reply	other threads:[~2026-09-03 16:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 11:33 [PATCH v6 0/5] pinctrl: renesas: rzg2l: Add support for RZ/G3S I3C Claudiu Beznea
2026-09-03 11:33 ` [PATCH v6 1/5] pinctrl: renesas: rzg2l: Generalize the power source code Claudiu Beznea
2026-09-03 11:33 ` [PATCH v6 2/5] pinctrl: renesas: rzg2l: Drop defines present in struct rzg2l_hwcfg Claudiu Beznea
2026-09-03 11:33 ` [PATCH v6 3/5] pinctrl: renesas: rzg2l: Unify the power source handling Claudiu Beznea
2026-09-03 15:32   ` Geert Uytterhoeven
2026-09-03 16:32     ` Claudiu Beznea [this message]
2026-09-03 22:10   ` Wolfram Sang
2026-09-03 11:33 ` [PATCH v6 4/5] dt-bindings: pinctrl: renesas,rzg2l-pinctrl: Document the missing I3C power source option Claudiu Beznea
2026-09-03 11:33 ` [PATCH v6 5/5] pinctrl: renesas: rzg2l: Add RZ/G3S support for selecting the I3C power source Claudiu Beznea
2026-09-03 15:33   ` Geert Uytterhoeven
2026-09-03 22:11   ` Wolfram Sang

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=40c96e12-f2f1-4d95-a95f-d4a9cbde7ab4@tuxon.dev \
    --to=claudiu.beznea+renesas@tuxon.dev \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh@kernel.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