| From 37f4d24cd799739ea0b859214a0a96d3c1b7e69d Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Fri, 29 Sep 2017 14:15:17 +0200 |
| Subject: [PATCH 0222/1795] pinctrl: sh-pfc: r8a7796: Use generic IOCTRL |
| register description |
| |
| Move R-Car M3-W I/O voltage support over to the generic way to describe |
| IOCTRL registers, which will be needed for suspend/resume support. |
| |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| (cherry picked from commit 3870a6f6ac255340767de64e71fbbfc54eb39403) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/pinctrl/sh-pfc/pfc-r8a7796.c | 12 +++++++++++- |
| 1 file changed, 11 insertions(+), 1 deletion(-) |
| |
| diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c |
| index ebf38ea8abbe..d8dc984cde6d 100644 |
| --- a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c |
| +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c |
| @@ -5477,11 +5477,20 @@ static const struct pinmux_drive_reg pinmux_drive_regs[] = { |
| { }, |
| }; |
| |
| +enum ioctrl_regs { |
| + POCCTRL, |
| +}; |
| + |
| +static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = { |
| + [POCCTRL] = { 0xe6060380, }, |
| + { /* sentinel */ }, |
| +}; |
| + |
| static int r8a7796_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl) |
| { |
| int bit = -EINVAL; |
| |
| - *pocctrl = 0xe6060380; |
| + *pocctrl = pinmux_ioctrl_regs[POCCTRL].reg; |
| |
| if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 11)) |
| bit = pin & 0x1f; |
| @@ -5798,6 +5807,7 @@ const struct sh_pfc_soc_info r8a7796_pinmux_info = { |
| .cfg_regs = pinmux_config_regs, |
| .drive_regs = pinmux_drive_regs, |
| .bias_regs = pinmux_bias_regs, |
| + .ioctrl_regs = pinmux_ioctrl_regs, |
| |
| .pinmux_data = pinmux_data, |
| .pinmux_data_size = ARRAY_SIZE(pinmux_data), |
| -- |
| 2.19.0 |
| |