From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Ulrich Hecht <uli+renesas@fpond.eu>
Cc: Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Wolfram Sang <wsa@the-dreams.de>,
hoai.luu.ub@renesas.com
Subject: Re: [PATCH 2/3] pinctrl: renesas: Initial R8A779A0 (V3U) PFC support
Date: Tue, 1 Dec 2020 09:54:31 +0100 [thread overview]
Message-ID: <CAMuHMdWLVkZ2ZkrCCykLVYhehpr6=f-jGT07cKoH45P-moo+VA@mail.gmail.com> (raw)
In-Reply-To: <20201126172058.25275-3-uli+renesas@fpond.eu>
Hi Uli,
One more comment...
On Thu, Nov 26, 2020 at 6:21 PM Ulrich Hecht <uli+renesas@fpond.eu> wrote:
> This patch adds initial pinctrl support for the R8A779A0 (V3U) SoC,
> including bias control.
... and drive strength, and I/O voltage control.
> + static int r8a779a0_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin,
> + u32 *pocctrl)
> + {
> + int bit = pin & 0x1f;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC0].reg;
> + if (pin >= RCAR_GP_PIN(0, 15) && pin <= RCAR_GP_PIN(0, 27))
> + return bit;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC1].reg;
> + if (pin >= RCAR_GP_PIN(1, 0) && pin <= RCAR_GP_PIN(1, 30))
> + return bit;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC2].reg;
> + if (pin >= RCAR_GP_PIN(2, 2) && pin <= RCAR_GP_PIN(2, 15))
> + return bit;
The above are pins switchable between 1.8V and 3.3V pins, which are
handled fine.
> +
> + *pocctrl = pinmux_ioctrl_regs[POC4].reg;
> + if (pin >= RCAR_GP_PIN(4, 0) && pin <= RCAR_GP_PIN(4, 17))
> + return bit;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC5].reg;
> + if (pin >= RCAR_GP_PIN(5, 0) && pin <= RCAR_GP_PIN(5, 17))
> + return bit;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC6].reg;
> + if (pin >= RCAR_GP_PIN(6, 0) && pin <= RCAR_GP_PIN(6, 17))
> + return bit;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC7].reg;
> + if (pin >= RCAR_GP_PIN(7, 0) && pin <= RCAR_GP_PIN(7, 17))
> + return bit;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC8].reg;
> + if (pin >= RCAR_GP_PIN(8, 0) && pin <= RCAR_GP_PIN(8, 17))
> + return bit;
> +
> + *pocctrl = pinmux_ioctrl_regs[POC9].reg;
> + if (pin >= RCAR_GP_PIN(9, 0) && pin <= RCAR_GP_PIN(9, 17))
> + return bit;
The above are 2.5/3.3V pins, and they are not handled correctly by
sh_pfc_pinconf_[gs]et(), which always assumes 1.8/3.3V.
I think the simplest solution would be to split the
SH_PFC_PIN_CFG_IO_VOLTAGE flag in two flags, and the pin_to_pocctrl()
callback in two callbacks, one for 1.8/3.3V and one for 2.5/3.3V pins,
but you may have a better idea?
Note that the R-Car V3M, V3H, E3, and D3 SoCs also have 2.5/3.3V pins,
but their pinctrl drivers just don't handle them, and limit voltage control
to the 1.8/3.3V pins.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2020-12-01 8:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-26 17:20 [PATCH 0/3] pinctrl: renesas: basic R8A779A0 (V3U) support Ulrich Hecht
2020-11-26 17:20 ` [PATCH 1/3] pinctrl: renesas: implement unlock register masks Ulrich Hecht
2020-11-27 9:51 ` Geert Uytterhoeven
2020-11-26 17:20 ` [PATCH 3/3] pinctrl: renesas: r8a779a0: Add SCIF pins, groups and functions Ulrich Hecht
2020-11-27 14:13 ` Geert Uytterhoeven
[not found] ` <20201126172058.25275-3-uli+renesas@fpond.eu>
2020-11-30 20:22 ` [PATCH 2/3] pinctrl: renesas: Initial R8A779A0 (V3U) PFC support Geert Uytterhoeven
2020-12-21 16:57 ` Ulrich Hecht
2020-12-01 8:54 ` Geert Uytterhoeven [this message]
2020-12-21 16:56 ` Ulrich Hecht
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='CAMuHMdWLVkZ2ZkrCCykLVYhehpr6=f-jGT07cKoH45P-moo+VA@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=hoai.luu.ub@renesas.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=uli+renesas@fpond.eu \
--cc=wsa@the-dreams.de \
/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).