Skip to content

Commit d04b961

Browse files
committed
pinctrl: renesas: r8a77995: Add support for AVB power-source
Add support for configuring the I/O voltage level of the Ethernet AVB pins on the R-Car D3 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/8f9164487715d8a4898ca651038c0b4d5013764c.1678271030.git.geert+renesas@glider.be
1 parent 7f25d5b commit d04b961

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

drivers/pinctrl/renesas/pfc-r8a77995.c

Lines changed: 14 additions & 7 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
@@ -2857,26 +2858,32 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
28572858

28582859
enum ioctrl_regs {
28592860
POCCTRL0,
2861+
POCCTRL2,
28602862
TDSELCTRL,
28612863
};
28622864

28632865
static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
28642866
[POCCTRL0] = { 0xe6060380, },
2867+
[POCCTRL2] = { 0xe6060388, },
28652868
[TDSELCTRL] = { 0xe60603c0, },
28662869
{ /* sentinel */ },
28672870
};
28682871

28692872

28702873
static int r8a77995_pin_to_pocctrl(unsigned int pin, u32 *pocctrl)
28712874
{
2872-
int bit = -EINVAL;
2873-
2874-
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
2875+
switch (pin) {
2876+
case RCAR_GP_PIN(3, 0) ... RCAR_GP_PIN(3, 9):
2877+
*pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
2878+
return 29 - (pin - RCAR_GP_PIN(3, 0));
28752879

2876-
if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 9))
2877-
bit = 29 - (pin - RCAR_GP_PIN(3, 0));
2880+
case PIN_VDDQ_AVB0:
2881+
*pocctrl = pinmux_ioctrl_regs[POCCTRL2].reg;
2882+
return 0;
28782883

2879-
return bit;
2884+
default:
2885+
return -EINVAL;
2886+
}
28802887
}
28812888

28822889
static const struct pinmux_bias_reg pinmux_bias_regs[] = {

0 commit comments

Comments
 (0)