devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linus.walleij@linaro.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>
Subject: [PATCH 2/4] pinctrl: sh-pfc: r8a77470: Add SDHI2 voltage switch
Date: Fri, 21 Sep 2018 12:55:09 +0100	[thread overview]
Message-ID: <1537530911-443-3-git-send-email-fabrizio.castro@bp.renesas.com> (raw)
In-Reply-To: <1537530911-443-1-git-send-email-fabrizio.castro@bp.renesas.com>

Add SH_PFC_PIN_CFG_IO_VOLTAGE definition for the SDHI2 pins
capable of switching voltage. Please note that with the
RZ/G1C only 1 bit of the POC Control Register is used to
control each interface.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
---
 drivers/pinctrl/sh-pfc/pfc-r8a77470.c | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77470.c b/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
index 9d3ed43..a1248e2 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
@@ -17,7 +17,19 @@
 	PORT_GP_1(3, 27, fn, sfx),					\
 	PORT_GP_1(3, 28, fn, sfx),					\
 	PORT_GP_1(3, 29, fn, sfx),					\
-	PORT_GP_26(4, fn, sfx),						\
+	PORT_GP_14(4, fn, sfx),						\
+	PORT_GP_CFG_1(4, 14, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),	\
+	PORT_GP_CFG_1(4, 15, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),	\
+	PORT_GP_CFG_1(4, 16, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),	\
+	PORT_GP_CFG_1(4, 17, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),	\
+	PORT_GP_CFG_1(4, 18, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),	\
+	PORT_GP_CFG_1(4, 19, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),	\
+	PORT_GP_1(4, 20, fn, sfx),					\
+	PORT_GP_1(4, 21, fn, sfx),					\
+	PORT_GP_1(4, 22, fn, sfx),					\
+	PORT_GP_1(4, 23, fn, sfx),					\
+	PORT_GP_1(4, 24, fn, sfx),					\
+	PORT_GP_1(4, 25, fn, sfx),					\
 	PORT_GP_32(5, fn, sfx)
 
 enum {
@@ -2321,9 +2333,27 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 	{ },
 };
 
+static int r8a77470_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin,
+				   u32 *pocctrl)
+{
+	unsigned int _bank = pin >> 5;
+	unsigned int _pin = pin & 0x1f;
+	*pocctrl = 0xe60600b0;
+
+	if (_bank == 4 && _pin >= 14 && _pin <= 19)
+		return 1;
+
+	return -EINVAL;
+}
+
+static const struct sh_pfc_soc_operations r8a77470_pinmux_ops = {
+	.pin_to_pocctrl = r8a77470_pin_to_pocctrl,
+};
+
 #ifdef CONFIG_PINCTRL_PFC_R8A77470
 const struct sh_pfc_soc_info r8a77470_pinmux_info = {
 	.name = "r8a77470_pfc",
+	.ops = &r8a77470_pinmux_ops,
 	.unlock_reg = 0xe6060000, /* PMMR */
 
 	.function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
-- 
2.7.4

  parent reply	other threads:[~2018-09-21 11:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 11:55 [PATCH 0/4] Add SDHI2 support to iwg23s Fabrizio Castro
2018-09-21 11:55 ` [PATCH 1/4] dt-bindings: mmc: renesas_sdhi: Add r8a77470 support Fabrizio Castro
2018-09-22 18:43   ` Wolfram Sang
2018-09-24  9:11   ` Simon Horman
2018-09-24  9:37   ` Geert Uytterhoeven
2018-09-24 12:26     ` Wolfram Sang
2018-09-24 12:44       ` Geert Uytterhoeven
2018-09-24 18:33     ` Fabrizio Castro
2018-09-25  6:47       ` Geert Uytterhoeven
2018-09-25  7:47         ` Simon Horman
2018-09-25  7:55           ` Geert Uytterhoeven
2018-09-25  8:22             ` Wolfram Sang
2018-09-25  8:28               ` Geert Uytterhoeven
2018-09-25 12:45                 ` Fabrizio Castro
2018-09-25 13:03                   ` Geert Uytterhoeven
2018-09-25 13:12                     ` Fabrizio Castro
2018-09-26 18:08         ` Fabrizio Castro
2018-09-21 11:55 ` Fabrizio Castro [this message]
2018-09-22 18:44   ` [PATCH 2/4] pinctrl: sh-pfc: r8a77470: Add SDHI2 voltage switch Wolfram Sang
2018-09-24  9:51     ` Geert Uytterhoeven
2018-09-24 18:36       ` Fabrizio Castro
2018-09-21 11:55 ` [PATCH 3/4] ARM: dts: r8a77470: Add SDHI2 support Fabrizio Castro
2018-09-22 18:44   ` Wolfram Sang
2018-09-24  9:12     ` Simon Horman
2018-09-28  9:31       ` Fabrizio Castro
2018-10-01 13:13         ` Simon Horman
2018-10-01 13:41           ` Fabrizio Castro
2018-09-24  9:16     ` Simon Horman
2018-09-21 11:55 ` [PATCH 4/4] ARM: dts: iwg23s-sbc: Add uSD card support Fabrizio Castro
2018-09-22 18:44   ` Wolfram Sang
2018-09-24  9:13   ` Simon Horman
2018-09-24  9:30     ` Fabrizio Castro
2018-09-24 10:03       ` Geert Uytterhoeven
2018-09-24 15:09         ` Fabrizio Castro
2018-09-24 15:34           ` Simon Horman

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=1537530911-443-3-git-send-email-fabrizio.castro@bp.renesas.com \
    --to=fabrizio.castro@bp.renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --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;
as well as URLs for NNTP newsgroup(s).