From: Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>
To: megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org
Cc: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Giuseppe Cavallaro <peppe.cavallaro-qxv4g6HH51o@public.gmane.org>,
Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
Jose Abreu <joabreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Maxime Coquelin
<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Arend van Spriel
<arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Franky Lin <franky.lin-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Hante Meuleman
<hante.meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Chi-Hsien Lin
<chi-hsien.lin-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
Wright Feng <wright.feng-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Naveen Gupta
<naveen.gupta-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev@v
Subject: Re: [PATCH v3 04/11] pinctrl: sunxi: Support I/O bias voltage setting on H6
Date: Thu, 11 Apr 2019 14:22:17 +0200 [thread overview]
Message-ID: <20190411122217.w2fdxymxehc2tm5c@flea> (raw)
In-Reply-To: <20190411101951.30223-5-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3539 bytes --]
Hi,
On Thu, Apr 11, 2019 at 12:19:44PM +0200, megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org wrote:
> From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
>
> H6 SoC has a "pio group withstand voltage mode" register (datasheet
> description), that needs to be used to select either 1.8V or 3.3V I/O mode,
> based on what voltage is powering the respective pin banks and is thus used
> for I/O signals.
>
> Add support for configuring this register according to the voltage of the
> pin bank regulator (if enabled).
>
> This is similar to the support for I/O bias voltage setting patch for A80
> and the same concerns apply. See:
>
> commit 402bfb3c1352 ("Support I/O bias voltage setting on A80")
>
> Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
> ---
> drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c | 1 +
> drivers/pinctrl/sunxi/pinctrl-sunxi.c | 11 +++++++++++
> drivers/pinctrl/sunxi/pinctrl-sunxi.h | 5 +++++
> 3 files changed, 17 insertions(+)
>
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c
> index ef4268cc6227..3cc1121589c9 100644
> --- a/drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c
> +++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c
> @@ -591,6 +591,7 @@ static const struct sunxi_pinctrl_desc h6_pinctrl_data = {
> .irq_banks = 4,
> .irq_bank_map = h6_irq_bank_map,
> .irq_read_needs_mux = true,
> + .io_bias_cfg_variant = BIAS_VOLTAGE_PIO_POW_MODE_SEL,
> };
>
> static int h6_pinctrl_probe(struct platform_device *pdev)
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> index 98c4de5f4019..0cbca30b75dc 100644
> --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> @@ -614,6 +614,8 @@ static int sunxi_pinctrl_set_io_bias_cfg(struct sunxi_pinctrl *pctl,
> unsigned pin,
> struct regulator *supply)
> {
> + unsigned short bank = pin / PINS_PER_BANK;
> + unsigned long flags;
> u32 val, reg;
> int uV;
>
> @@ -651,6 +653,15 @@ static int sunxi_pinctrl_set_io_bias_cfg(struct sunxi_pinctrl *pctl,
> reg &= ~IO_BIAS_MASK;
> writel(reg | val, pctl->membase + sunxi_grp_config_reg(pin));
> return 0;
> + case BIAS_VOLTAGE_PIO_POW_MODE_SEL:
> + val = uV <= 1800000 ? 1 : 0;
> +
> + raw_spin_lock_irqsave(&pctl->lock, flags);
> + reg = readl(pctl->membase + PIO_POW_MOD_SEL_REG);
> + reg &= ~(1 << bank);
> + writel(reg | val << bank, pctl->membase + PIO_POW_MOD_SEL_REG);
> + raw_spin_unlock_irqrestore(&pctl->lock, flags);
> + return 0;
> default:
> return -EINVAL;
> }
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.h b/drivers/pinctrl/sunxi/pinctrl-sunxi.h
> index 4bfc8a6d9dce..36186906f0a7 100644
> --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.h
> +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.h
> @@ -95,11 +95,16 @@
> #define PINCTRL_SUN7I_A20 BIT(7)
> #define PINCTRL_SUN8I_R40 BIT(8)
>
> +#define PIO_POW_MOD_SEL_REG 0x340
> +
> enum sunxi_desc_bias_voltage {
> BIAS_VOLTAGE_NONE,
> /* Bias voltage configuration is done through
> * Pn_GRP_CONFIG registers, as seen on A80 SoC. */
> BIAS_VOLTAGE_GRP_CONFIG,
> + /* Bias voltage is set through PIO_POW_MOD_SEL_REG
> + * register, as seen on H6 SoC, for example. */
That's not the proper comment style.
Once fixed, this patch and the previous is
Acked-by: Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-04-11 12:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-11 10:19 [PATCH v3 00/11] Add support for Orange Pi 3 megous via linux-sunxi
[not found] ` <20190411101951.30223-1-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-04-11 10:19 ` [PATCH v3 01/11] net: stmmac: sun8i: add support for Allwinner H6 EMAC megous via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 02/11] net: stmmac: sun8i: force select external PHY when no internal one megous via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 03/11] pinctrl: sunxi: Prepare for alternative bias voltage setting methods megous via linux-sunxi
[not found] ` <20190411101951.30223-4-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-04-11 10:34 ` Julian Calaby
[not found] ` <CAGRGNgUhPC+G+H_zYSi7KFx-K10uPOXRsPqPFcirGaWScw59dQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-11 10:44 ` 'Ondřej Jirman' via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 04/11] pinctrl: sunxi: Support I/O bias voltage setting on H6 megous via linux-sunxi
[not found] ` <20190411101951.30223-5-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-04-11 12:22 ` Maxime Ripard [this message]
2019-04-11 10:19 ` [PATCH v3 05/11] arm64: dts: allwinner: orange-pi-3: Enable ethernet megous via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 06/11] dt-bindings: display: hdmi-connector: Add DDC power supply megous via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 07/11] drm: sun4i: Add support for enabling DDC I2C bus power to dw_hdmi glue megous via linux-sunxi
[not found] ` <20190411101951.30223-8-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-04-11 12:25 ` Maxime Ripard
2019-04-11 10:19 ` [PATCH v3 08/11] arm64: dts: allwinner: orange-pi-3: Enable HDMI output megous via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 09/11] brcmfmac: Loading the correct firmware for brcm43456 megous via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 10/11] arm64: dts: allwinner: h6: Add MMC1 pins megous via linux-sunxi
2019-04-11 10:19 ` [PATCH v3 11/11] [DO NOT MERGE] arm64: dts: allwinner: orange-pi-3: Enable WiFi megous via linux-sunxi
2019-04-12 11:05 ` [linux-sunxi] [PATCH v3 00/11] Add support for Orange Pi 3 Chen-Yu Tsai
[not found] ` <CAGb2v64HgPePM=rk_kSdS7yFx4S4TR=tpGC2yQ6ruDCvBnosiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-12 12:10 ` 'Ondřej Jirman' via linux-sunxi
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=20190411122217.w2fdxymxehc2tm5c@flea \
--to=maxime.ripard-ldxbnhwyfcjbdgjk7y7tuq@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
--cc=arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=chi-hsien.lin-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=daniel-/w4YWyX8dFk@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=franky.lin-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=hante.meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=joabreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org \
--cc=naveen.gupta-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=netdev@v \
--cc=peppe.cavallaro-qxv4g6HH51o@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=wens-jdAy2FN1RRM@public.gmane.org \
--cc=wright.feng-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.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).