Skip to content

Commit 40f14d7

Browse files
bijudasgregkh
authored andcommitted
pinctrl: renesas: rzg2l: Fix save/restore of {IOLH,IEN,PUPD,SMT} registers
[ Upstream commit d9a60e3 ] The rzg2l_pinctrl_pm_setup_regs() handles save/restore of {IOLH,IEN,PUPD,SMT} registers during s2ram, but only for ports where all pins share the same pincfg. Extend the code to also support ports with variable pincfg per pin, so that {IOLH,IEN,PUPD,SMT} registers are correctly saved and restored for all pins. Fixes: 254203f ("pinctrl: renesas: rzg2l: Add suspend/resume support") Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260326162459.101414-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4c8337f commit 40f14d7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,13 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
28122812
off = RZG2L_PIN_CFG_TO_PORT_OFFSET(cfg);
28132813
pincnt = hweight8(FIELD_GET(PIN_CFG_PIN_MAP_MASK, cfg));
28142814

2815+
if (cfg & RZG2L_VARIABLE_CFG) {
2816+
unsigned int pin = port * RZG2L_PINS_PER_PORT;
2817+
2818+
for (unsigned int i = 0; i < RZG2L_PINS_PER_PORT; i++)
2819+
cfg |= *(u64 *)pctrl->desc.pins[pin + i].drv_data;
2820+
}
2821+
28152822
caps = FIELD_GET(PIN_CFG_MASK, cfg);
28162823
has_iolh = !!(caps & (PIN_CFG_IOLH_A | PIN_CFG_IOLH_B | PIN_CFG_IOLH_C));
28172824
has_ien = !!(caps & PIN_CFG_IEN);

0 commit comments

Comments
 (0)