mirror of https://github.com/torvalds/linux.git
pinctrl: renesas: Updates for v6.18 (take two)
- Improve suspend/resume support on RZ/G2L family SoCs, - Miscellaneous fixes and improvements. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCaMPotwAKCRCKwlD9ZEnx cHqVAQDFc9EVVDqWdsoFa2d7nY4Ycf0k0WiOznPDfYCtXNbpXwEAr7l/eiuclUau gV+vxkJ8SQLt0FdlVJlDO7o/FcFCAAg= =QBoE -----END PGP SIGNATURE----- Merge tag 'renesas-pinctrl-for-v6.18-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v6.18 (take two) - Improve suspend/resume support on RZ/G2L family SoCs, - Miscellaneous fixes and improvements. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
commit
334ef450cc
|
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/*
|
/*
|
||||||
* R8A779A0 processor support - PFC hardware block.
|
* R8A779G0 processor support - PFC hardware block.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2021 Renesas Electronics Corp.
|
* Copyright (C) 2021 Renesas Electronics Corp.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,7 @@ struct rzg2l_pinctrl_pin_settings {
|
||||||
* @iolh: IOLH registers cache
|
* @iolh: IOLH registers cache
|
||||||
* @pupd: PUPD registers cache
|
* @pupd: PUPD registers cache
|
||||||
* @ien: IEN registers cache
|
* @ien: IEN registers cache
|
||||||
|
* @smt: SMT registers cache
|
||||||
* @sd_ch: SD_CH registers cache
|
* @sd_ch: SD_CH registers cache
|
||||||
* @eth_poc: ET_POC registers cache
|
* @eth_poc: ET_POC registers cache
|
||||||
* @oen: Output Enable register cache
|
* @oen: Output Enable register cache
|
||||||
|
|
@ -334,6 +335,7 @@ struct rzg2l_pinctrl_reg_cache {
|
||||||
u32 *iolh[2];
|
u32 *iolh[2];
|
||||||
u32 *ien[2];
|
u32 *ien[2];
|
||||||
u32 *pupd[2];
|
u32 *pupd[2];
|
||||||
|
u32 *smt;
|
||||||
u8 sd_ch[2];
|
u8 sd_ch[2];
|
||||||
u8 eth_poc[2];
|
u8 eth_poc[2];
|
||||||
u8 oen;
|
u8 oen;
|
||||||
|
|
@ -2704,6 +2706,10 @@ static int rzg2l_pinctrl_reg_cache_alloc(struct rzg2l_pinctrl *pctrl)
|
||||||
if (!cache->pfc)
|
if (!cache->pfc)
|
||||||
return -ENOMEM;
|
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++) {
|
for (u8 i = 0; i < 2; i++) {
|
||||||
u32 n_dedicated_pins = pctrl->data->n_dedicated_pins;
|
u32 n_dedicated_pins = pctrl->data->n_dedicated_pins;
|
||||||
|
|
||||||
|
|
@ -2965,7 +2971,7 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
|
||||||
struct rzg2l_pinctrl_reg_cache *cache = pctrl->cache;
|
struct rzg2l_pinctrl_reg_cache *cache = pctrl->cache;
|
||||||
|
|
||||||
for (u32 port = 0; port < nports; port++) {
|
for (u32 port = 0; port < nports; port++) {
|
||||||
bool has_iolh, has_ien, has_pupd;
|
bool has_iolh, has_ien, has_pupd, has_smt;
|
||||||
u32 off, caps;
|
u32 off, caps;
|
||||||
u8 pincnt;
|
u8 pincnt;
|
||||||
u64 cfg;
|
u64 cfg;
|
||||||
|
|
@ -2978,6 +2984,7 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
|
||||||
has_iolh = !!(caps & (PIN_CFG_IOLH_A | PIN_CFG_IOLH_B | PIN_CFG_IOLH_C));
|
has_iolh = !!(caps & (PIN_CFG_IOLH_A | PIN_CFG_IOLH_B | PIN_CFG_IOLH_C));
|
||||||
has_ien = !!(caps & PIN_CFG_IEN);
|
has_ien = !!(caps & PIN_CFG_IEN);
|
||||||
has_pupd = !!(caps & PIN_CFG_PUPD);
|
has_pupd = !!(caps & PIN_CFG_PUPD);
|
||||||
|
has_smt = !!(caps & PIN_CFG_SMT);
|
||||||
|
|
||||||
if (suspend)
|
if (suspend)
|
||||||
RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + PFC(off), cache->pfc[port]);
|
RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + PFC(off), cache->pfc[port]);
|
||||||
|
|
@ -3016,6 +3023,9 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
|
||||||
cache->ien[1][port]);
|
cache->ien[1][port]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (has_smt)
|
||||||
|
RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + SMT(off), cache->smt[port]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3165,6 +3175,8 @@ static int rzg2l_pinctrl_resume_noirq(struct device *dev)
|
||||||
const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
|
const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
|
||||||
const struct rzg2l_register_offsets *regs = &hwcfg->regs;
|
const struct rzg2l_register_offsets *regs = &hwcfg->regs;
|
||||||
struct rzg2l_pinctrl_reg_cache *cache = pctrl->cache;
|
struct rzg2l_pinctrl_reg_cache *cache = pctrl->cache;
|
||||||
|
unsigned long flags;
|
||||||
|
u8 pwpr;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!atomic_read(&pctrl->wakeup_path)) {
|
if (!atomic_read(&pctrl->wakeup_path)) {
|
||||||
|
|
@ -3174,7 +3186,16 @@ static int rzg2l_pinctrl_resume_noirq(struct device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
writeb(cache->qspi, pctrl->base + QSPI);
|
writeb(cache->qspi, pctrl->base + QSPI);
|
||||||
|
if (pctrl->data->hwcfg->oen_pwpr_lock) {
|
||||||
|
spin_lock_irqsave(&pctrl->lock, flags);
|
||||||
|
pwpr = readb(pctrl->base + regs->pwpr);
|
||||||
|
writeb(pwpr | PWPR_REGWE_B, pctrl->base + regs->pwpr);
|
||||||
|
}
|
||||||
writeb(cache->oen, pctrl->base + pctrl->data->hwcfg->regs.oen);
|
writeb(cache->oen, pctrl->base + pctrl->data->hwcfg->regs.oen);
|
||||||
|
if (pctrl->data->hwcfg->oen_pwpr_lock) {
|
||||||
|
writeb(pwpr & ~PWPR_REGWE_B, pctrl->base + regs->pwpr);
|
||||||
|
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||||
|
}
|
||||||
for (u8 i = 0; i < 2; i++) {
|
for (u8 i = 0; i < 2; i++) {
|
||||||
if (regs->sd_ch)
|
if (regs->sd_ch)
|
||||||
writeb(cache->sd_ch[i], pctrl->base + SD_CH(regs->sd_ch, i));
|
writeb(cache->sd_ch[i], pctrl->base + SD_CH(regs->sd_ch, i));
|
||||||
|
|
|
||||||
|
|
@ -726,7 +726,8 @@ static int sh_pfc_pinconf_group_set(struct pinctrl_dev *pctldev, unsigned group,
|
||||||
struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
|
struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
|
||||||
const unsigned int *pins;
|
const unsigned int *pins;
|
||||||
unsigned int num_pins;
|
unsigned int num_pins;
|
||||||
unsigned int i, ret;
|
unsigned int i;
|
||||||
|
int ret;
|
||||||
|
|
||||||
pins = pmx->pfc->info->groups[group].pins;
|
pins = pmx->pfc->info->groups[group].pins;
|
||||||
num_pins = pmx->pfc->info->groups[group].nr_pins;
|
num_pins = pmx->pfc->info->groups[group].nr_pins;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue