Skip to content

Commit 6cd853a

Browse files
committed
pinctrl: renesas: r8a77980: Add support for AVB/GE power-sources
Add support for configuring the I/O voltage levels of the Ethernet AVB and Gigabit Ethernet pins on the R-Car V3H SoC. "PIN_VDDQ_AVB" and "PIN_VDDQ_GE" can be configured for 2.5V or 3.3V operation. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/3c26c4f3735a6d071685c507c065172e63af5d70.1678271030.git.geert+renesas@glider.be
1 parent a7bebdc commit 6cd853a

1 file changed

Lines changed: 28 additions & 11 deletions

File tree

drivers/pinctrl/renesas/pfc-r8a77980.c

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
3636
PIN_NOGP_CFG(FSCLKST, "FSCLKST", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
3737
PIN_NOGP_CFG(FSCLKST_N, "FSCLKST#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
38-
PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN)
38+
PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \
39+
PIN_NOGP_CFG(VDDQ_AVB, "VDDQ_AVB", fn, SH_PFC_PIN_CFG_IO_VOLTAGE_25_33), \
40+
PIN_NOGP_CFG(VDDQ_GE, "VDDQ_GE", fn, SH_PFC_PIN_CFG_IO_VOLTAGE_25_33)
3941

4042
/*
4143
* F_() : just information
@@ -2837,24 +2839,39 @@ static int r8a77980_pin_to_pocctrl(unsigned int pin, u32 *pocctrl)
28372839
{
28382840
int bit = pin & 0x1f;
28392841

2840-
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
2841-
if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21))
2842+
switch (pin) {
2843+
case RCAR_GP_PIN(0, 0) ... RCAR_GP_PIN(0, 21):
2844+
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
28422845
return bit;
2843-
else if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9))
2846+
2847+
case RCAR_GP_PIN(2, 0) ... RCAR_GP_PIN(2, 9):
2848+
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
28442849
return bit + 22;
28452850

2846-
*pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
2847-
if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16))
2851+
case RCAR_GP_PIN(2, 10) ... RCAR_GP_PIN(2, 16):
2852+
*pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
28482853
return bit - 10;
2849-
if ((pin >= RCAR_GP_PIN(2, 17) && pin <= RCAR_GP_PIN(2, 24)) ||
2850-
(pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16)))
2854+
2855+
case RCAR_GP_PIN(2, 17) ... RCAR_GP_PIN(2, 24):
2856+
case RCAR_GP_PIN(3, 0) ... RCAR_GP_PIN(3, 16):
2857+
*pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
28512858
return bit + 7;
28522859

2853-
*pocctrl = pinmux_ioctrl_regs[POCCTRL2].reg;
2854-
if (pin >= RCAR_GP_PIN(2, 25) && pin <= RCAR_GP_PIN(2, 29))
2860+
case RCAR_GP_PIN(2, 25) ... RCAR_GP_PIN(2, 29):
2861+
*pocctrl = pinmux_ioctrl_regs[POCCTRL2].reg;
28552862
return pin - 25;
28562863

2857-
return -EINVAL;
2864+
case PIN_VDDQ_AVB:
2865+
*pocctrl = pinmux_ioctrl_regs[POCCTRL3].reg;
2866+
return 0;
2867+
2868+
case PIN_VDDQ_GE:
2869+
*pocctrl = pinmux_ioctrl_regs[POCCTRL3].reg;
2870+
return 1;
2871+
2872+
default:
2873+
return -EINVAL;
2874+
}
28582875
}
28592876

28602877
static const struct pinmux_bias_reg pinmux_bias_regs[] = {

0 commit comments

Comments
 (0)