Skip to content

Commit d3aaa72

Browse files
claudiubezneageertu
authored andcommitted
pinctrl: renesas: rzg2l: Add pin configuration support for pinmux groups
On RZ/G3S different Ethernet pins need to be configured with different settings (e.g. power-source needs to be set, RGMII TXC and TX_CTL pins need output-enable). Adjust the driver to allow specifying pin configuration for pinmux groups. With this, DT settings like the following are taken into account by the driver: eth0_pins: eth0 { tx_ctl { pinmux = <RZG2L_PORT_PINMUX(1, 1, 1)>; /* ET0_TX_CTL */ power-source = <1800>; output-enable; drive-strength-microamp = <5200>; }; }; Signed-off-by: Claudiu Beznea <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 906b545 commit d3aaa72

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,11 @@ static int rzg2l_dt_subnode_to_map(struct pinctrl_dev *pctldev,
376376
goto done;
377377
}
378378

379-
if (num_pinmux)
379+
if (num_pinmux) {
380380
nmaps += 1;
381+
if (num_configs)
382+
nmaps += 1;
383+
}
381384

382385
if (num_pins)
383386
nmaps += num_pins;
@@ -462,6 +465,16 @@ static int rzg2l_dt_subnode_to_map(struct pinctrl_dev *pctldev,
462465
maps[idx].data.mux.function = name;
463466
idx++;
464467

468+
if (num_configs) {
469+
ret = rzg2l_map_add_config(&maps[idx], name,
470+
PIN_MAP_TYPE_CONFIGS_GROUP,
471+
configs, num_configs);
472+
if (ret < 0)
473+
goto remove_group;
474+
475+
idx++;
476+
}
477+
465478
dev_dbg(pctrl->dev, "Parsed %pOF with %d pins\n", np, num_pinmux);
466479
ret = 0;
467480
goto done;

0 commit comments

Comments
 (0)