From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Prabhakar <prabhakar.csengg@gmail.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Magnus Damm <magnus.damm@gmail.com>
Cc: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Biju Das <biju.das.jz@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH v2 2/3] pinctrl: renesas: rzg2l: Add support for enabling/disabling open-drain outputs
Date: Wed, 9 Oct 2024 10:53:19 +0300 [thread overview]
Message-ID: <bb4bf1af-ea62-433d-ab5e-982055a4cec9@tuxon.dev> (raw)
In-Reply-To: <20241004123658.764557-3-prabhakar.mahadev-lad.rj@bp.renesas.com>
On 04.10.2024 15:36, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Add support for enabling and disabling open-drain outputs.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
I gave it a simple try on RZ/G3S. All good. You can add:
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
> v1->v2
> - Implemented PIN_CONFIG_DRIVE_OPEN_DRAIN to disable open drain
> ---
> drivers/pinctrl/renesas/pinctrl-rzg2l.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> index b2d309f742af..8d576cc74003 100644
> --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> @@ -139,6 +139,7 @@
> #define IEN(off) (0x1800 + (off) * 8)
> #define PUPD(off) (0x1C00 + (off) * 8)
> #define ISEL(off) (0x2C00 + (off) * 8)
> +#define NOD(off) (0x3000 + (off) * 8)
> #define SD_CH(off, ch) ((off) + (ch) * 4)
> #define ETH_POC(off, ch) ((off) + (ch) * 4)
> #define QSPI (0x3008)
> @@ -160,6 +161,7 @@
> #define IOLH_MASK 0x03
> #define SR_MASK 0x01
> #define PUPD_MASK 0x03
> +#define NOD_MASK 0x01
>
> #define PM_INPUT 0x1
> #define PM_OUTPUT 0x2
> @@ -1337,6 +1339,18 @@ static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev,
> break;
> }
>
> + case PIN_CONFIG_DRIVE_OPEN_DRAIN:
> + case PIN_CONFIG_DRIVE_PUSH_PULL:
> + if (!(cfg & PIN_CFG_NOD))
> + return -EINVAL;
> +
> + arg = rzg2l_read_pin_config(pctrl, NOD(off), bit, NOD_MASK);
> + if (!arg && param != PIN_CONFIG_DRIVE_PUSH_PULL)
> + return -EINVAL;
> + if (arg && param != PIN_CONFIG_DRIVE_OPEN_DRAIN)
> + return -EINVAL;
> + break;
> +
> case RENESAS_RZV2H_PIN_CONFIG_OUTPUT_IMPEDANCE:
> if (!(cfg & PIN_CFG_IOLH_RZV2H))
> return -EINVAL;
> @@ -1466,6 +1480,15 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev,
> rzg2l_rmw_pin_config(pctrl, IOLH(off), bit, IOLH_MASK, index);
> break;
>
> + case PIN_CONFIG_DRIVE_OPEN_DRAIN:
> + case PIN_CONFIG_DRIVE_PUSH_PULL:
> + if (!(cfg & PIN_CFG_NOD))
> + return -EINVAL;
> +
> + rzg2l_rmw_pin_config(pctrl, NOD(off), bit, NOD_MASK,
> + param == PIN_CONFIG_DRIVE_OPEN_DRAIN ? 1 : 0);
> + break;
> +
> case RENESAS_RZV2H_PIN_CONFIG_OUTPUT_IMPEDANCE:
> if (!(cfg & PIN_CFG_IOLH_RZV2H))
> return -EINVAL;
next prev parent reply other threads:[~2024-10-09 7:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 12:36 [PATCH v2 0/3] pinctrl: renesas: rzg2l: Add support to configure open-drain and schmitt-trigger properties Prabhakar
2024-10-04 12:36 ` [PATCH v2 1/3] dt-bindings: pinctrl: renesas,rzg2l-pinctrl: Allow schmitt and open drain properties Prabhakar
2024-10-04 13:04 ` Geert Uytterhoeven
2024-10-05 18:45 ` Rob Herring (Arm)
2024-10-04 12:36 ` [PATCH v2 2/3] pinctrl: renesas: rzg2l: Add support for enabling/disabling open-drain outputs Prabhakar
2024-10-04 13:05 ` Geert Uytterhoeven
2024-10-09 7:53 ` claudiu beznea [this message]
2024-10-04 12:36 ` [PATCH v2 3/3] pinctrl: renesas: rzg2l: Add support for configuring schmitt-trigger Prabhakar
2024-10-04 13:06 ` Geert Uytterhoeven
2024-10-09 7:53 ` claudiu beznea
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=bb4bf1af-ea62-433d-ab5e-982055a4cec9@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=biju.das.jz@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.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.csengg@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;
as well as URLs for NNTP newsgroup(s).