Skip to content

Commit 509d342

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 71e13d4 commit 509d342

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
@@ -2997,6 +2997,13 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
29972997
off = RZG2L_PIN_CFG_TO_PORT_OFFSET(cfg);
29982998
pincnt = hweight8(FIELD_GET(PIN_CFG_PIN_MAP_MASK, cfg));
29992999

3000+
if (cfg & RZG2L_VARIABLE_CFG) {
3001+
unsigned int pin = port * RZG2L_PINS_PER_PORT;
3002+
3003+
for (unsigned int i = 0; i < RZG2L_PINS_PER_PORT; i++)
3004+
cfg |= *(u64 *)pctrl->desc.pins[pin + i].drv_data;
3005+
}
3006+
30003007
caps = FIELD_GET(PIN_CFG_MASK, cfg);
30013008
has_iolh = !!(caps & (PIN_CFG_IOLH_A | PIN_CFG_IOLH_B | PIN_CFG_IOLH_C));
30023009
has_ien = !!(caps & PIN_CFG_IEN);

0 commit comments

Comments
 (0)