Skip to content

Commit 3c24650

Browse files
committed
pinctrl: renesas: r8a779g0: Add support for AVB/TSN power-sources
Add support for configuring the I/O voltage levels of the Ethernet AVB and Ethernet TSN pins on the R-Car V4H SoC. "PIN_VDDQ_AVB[012]" and "PIN_VDDQ_TSN0" can be configured for 1.8V or 2.5V operation. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/c046e0be7d26302061d7aa629180a451734ddf8f.1678271030.git.geert+renesas@glider.be
1 parent d04b961 commit 3c24650

1 file changed

Lines changed: 36 additions & 9 deletions

File tree

drivers/pinctrl/renesas/pfc-r8a779g0.c

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
PORT_GP_CFG_21(7, fn, sfx, CFG_FLAGS), \
5050
PORT_GP_CFG_14(8, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE_18_33)
5151

52+
#define CPU_ALL_NOGP(fn) \
53+
PIN_NOGP_CFG(VDDQ_AVB0, "VDDQ_AVB0", fn, SH_PFC_PIN_CFG_IO_VOLTAGE_18_25), \
54+
PIN_NOGP_CFG(VDDQ_AVB1, "VDDQ_AVB1", fn, SH_PFC_PIN_CFG_IO_VOLTAGE_18_25), \
55+
PIN_NOGP_CFG(VDDQ_AVB2, "VDDQ_AVB2", fn, SH_PFC_PIN_CFG_IO_VOLTAGE_18_25), \
56+
PIN_NOGP_CFG(VDDQ_TSN0, "VDDQ_TSN0", fn, SH_PFC_PIN_CFG_IO_VOLTAGE_18_25)
57+
5258
/* GPSR0 */
5359
#define GPSR0_18 F_(MSIOF2_RXD, IP2SR0_11_8)
5460
#define GPSR0_17 F_(MSIOF2_SCK, IP2SR0_7_4)
@@ -1221,10 +1227,12 @@ static const u16 pinmux_data[] = {
12211227
*/
12221228
enum {
12231229
GP_ASSIGN_LAST(),
1230+
NOGP_ALL(),
12241231
};
12251232

12261233
static const struct sh_pfc_pin pinmux_pins[] = {
12271234
PINMUX_GPIO_GP_ALL(),
1235+
PINMUX_NOGP_ALL(),
12281236
};
12291237

12301238
/* - AUDIO CLOCK ----------------------------------------- */
@@ -3973,23 +3981,42 @@ static int r8a779g0_pin_to_pocctrl(unsigned int pin, u32 *pocctrl)
39733981
{
39743982
int bit = pin & 0x1f;
39753983

3976-
*pocctrl = pinmux_ioctrl_regs[POC0].reg;
3977-
if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 18))
3984+
switch (pin) {
3985+
case RCAR_GP_PIN(0, 0) ... RCAR_GP_PIN(0, 18):
3986+
*pocctrl = pinmux_ioctrl_regs[POC0].reg;
39783987
return bit;
39793988

3980-
*pocctrl = pinmux_ioctrl_regs[POC1].reg;
3981-
if (pin >= RCAR_GP_PIN(1, 0) && pin <= RCAR_GP_PIN(1, 22))
3989+
case RCAR_GP_PIN(1, 0) ... RCAR_GP_PIN(1, 22):
3990+
*pocctrl = pinmux_ioctrl_regs[POC1].reg;
39823991
return bit;
39833992

3984-
*pocctrl = pinmux_ioctrl_regs[POC3].reg;
3985-
if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 12))
3993+
case RCAR_GP_PIN(3, 0) ... RCAR_GP_PIN(3, 12):
3994+
*pocctrl = pinmux_ioctrl_regs[POC3].reg;
39863995
return bit;
39873996

3988-
*pocctrl = pinmux_ioctrl_regs[POC8].reg;
3989-
if (pin >= RCAR_GP_PIN(8, 0) && pin <= RCAR_GP_PIN(8, 13))
3997+
case PIN_VDDQ_TSN0:
3998+
*pocctrl = pinmux_ioctrl_regs[POC4].reg;
3999+
return 0;
4000+
4001+
case PIN_VDDQ_AVB2:
4002+
*pocctrl = pinmux_ioctrl_regs[POC5].reg;
4003+
return 0;
4004+
4005+
case PIN_VDDQ_AVB1:
4006+
*pocctrl = pinmux_ioctrl_regs[POC6].reg;
4007+
return 0;
4008+
4009+
case PIN_VDDQ_AVB0:
4010+
*pocctrl = pinmux_ioctrl_regs[POC7].reg;
4011+
return 0;
4012+
4013+
case RCAR_GP_PIN(8, 0) ... RCAR_GP_PIN(8, 13):
4014+
*pocctrl = pinmux_ioctrl_regs[POC8].reg;
39904015
return bit;
39914016

3992-
return -EINVAL;
4017+
default:
4018+
return -EINVAL;
4019+
}
39934020
}
39944021

39954022
static const struct pinmux_bias_reg pinmux_bias_regs[] = {

0 commit comments

Comments
 (0)