Commit 7cf4846a authored by Linus Walleij's avatar Linus Walleij
Browse files

Merge tag 'renesas-pinctrl-fixes-for-v7.1-tag1' of...

Merge tag 'renesas-pinctrl-fixes-for-v7.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers

 into fixes

pinctrl: renesas: Fixes for v7.1

  - Fix pin bias suspend/resume handling on the RZ/G2L family,
  - Fix Schmitt-trigger suspend/resume handling on RZ/V2H(P), RZ/V2N,
    and RZ/G3E.

Signed-off-by: default avatarLinus Walleij <linusw@kernel.org>
parents 52ac35b8 c88ab940
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ struct rzg2l_pinctrl_reg_cache {
	u32	*iolh[2];
	u32	*ien[2];
	u32	*pupd[2];
	u32	*smt;
	u32	*smt[2];
	u8	sd_ch[2];
	u8	eth_poc[2];
	u8	oen;
@@ -2737,10 +2737,6 @@ static int rzg2l_pinctrl_reg_cache_alloc(struct rzg2l_pinctrl *pctrl)
	if (!cache->pfc)
		return -ENOMEM;

	cache->smt = devm_kcalloc(pctrl->dev, nports, sizeof(*cache->smt), GFP_KERNEL);
	if (!cache->smt)
		return -ENOMEM;

	for (u8 i = 0; i < 2; i++) {
		u32 n_dedicated_pins = pctrl->data->n_dedicated_pins;

@@ -2759,6 +2755,11 @@ static int rzg2l_pinctrl_reg_cache_alloc(struct rzg2l_pinctrl *pctrl)
		if (!cache->pupd[i])
			return -ENOMEM;

		cache->smt[i] = devm_kcalloc(pctrl->dev, nports, sizeof(*cache->smt[i]),
					     GFP_KERNEL);
		if (!cache->smt[i])
			return -ENOMEM;

		/* Allocate dedicated cache. */
		dedicated_cache->iolh[i] = devm_kcalloc(pctrl->dev, n_dedicated_pins,
							sizeof(*dedicated_cache->iolh[i]),
@@ -3049,7 +3050,7 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
			RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + PUPD(off),
						 cache->pupd[0][port]);
			if (pincnt >= 4) {
				RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + PUPD(off),
				RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + PUPD(off) + 4,
							 cache->pupd[1][port]);
			}
		}
@@ -3066,8 +3067,14 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
			}
		}

		if (has_smt)
			RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + SMT(off), cache->smt[port]);
		if (has_smt) {
			RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + SMT(off),
						 cache->smt[0][port]);
			if (pincnt >= 4) {
				RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + SMT(off) + 4,
							 cache->smt[1][port]);
			}
		}
	}
}