Skip to content

Commit a7bebdc

Browse files
committed
pinctrl: renesas: r8a77970: Add support for AVB power-source
Add support for configuring the I/O voltage level of the Ethernet AVB pins on the R-Car V3M SoC. "PIN_VDDQ_AVB0" 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/eb4db82bdeb67507a1a77f63b9d90280d6f38ba4.1678271030.git.geert+renesas@glider.be
1 parent b88e733 commit a7bebdc

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

drivers/pinctrl/renesas/pfc-r8a77970.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
PIN_NOGP_CFG(TCK, "TCK", fn, SH_PFC_PIN_CFG_PULL_UP), \
3535
PIN_NOGP_CFG(TDI, "TDI", fn, SH_PFC_PIN_CFG_PULL_UP), \
3636
PIN_NOGP_CFG(TMS, "TMS", fn, SH_PFC_PIN_CFG_PULL_UP), \
37-
PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP)
37+
PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP), \
38+
PIN_NOGP_CFG(VDDQ_AVB0, "VDDQ_AVB0", fn, SH_PFC_PIN_CFG_IO_VOLTAGE_25_33)
3839

3940
/*
4041
* F_() : just information
@@ -2364,19 +2365,30 @@ static int r8a77970_pin_to_pocctrl(unsigned int pin, u32 *pocctrl)
23642365
{
23652366
int bit = pin & 0x1f;
23662367

2367-
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
2368-
if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21))
2368+
switch (pin) {
2369+
case RCAR_GP_PIN(0, 0) ... RCAR_GP_PIN(0, 21):
2370+
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
23692371
return bit;
2370-
if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9))
2372+
2373+
case RCAR_GP_PIN(2, 0) ... RCAR_GP_PIN(2, 9):
2374+
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
23712375
return bit + 22;
23722376

2373-
*pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
2374-
if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16))
2377+
case RCAR_GP_PIN(2, 10) ... RCAR_GP_PIN(2, 16):
2378+
*pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
23752379
return bit - 10;
2376-
if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16))
2380+
2381+
case RCAR_GP_PIN(3, 0) ... RCAR_GP_PIN(3, 16):
2382+
*pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
23772383
return bit + 7;
23782384

2379-
return -EINVAL;
2385+
case PIN_VDDQ_AVB0:
2386+
*pocctrl = pinmux_ioctrl_regs[POCCTRL2].reg;
2387+
return 0;
2388+
2389+
default:
2390+
return -EINVAL;
2391+
}
23802392
}
23812393

23822394
static const struct pinmux_bias_reg pinmux_bias_regs[] = {

0 commit comments

Comments
 (0)