diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2021-12-23 15:56:25 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2022-02-22 09:57:19 +0100 |
commit | 6bfbaec7de9ec83c3a2f82f5dc9a2c7eb6c74041 (patch) | |
tree | 01d87bfdbf0e196432ed8e7dae05e2d1c381f373 | |
parent | 8d1c50b80139fd742a6a3ec851efbc849e731994 (diff) | |
download | linux-6bfbaec7de9ec83c3a2f82f5dc9a2c7eb6c74041.tar.bz2 |
pinctrl: renesas: checker: Check bias pin conflicts
Check that there is only a single entry for each pin with pull-up and/or
pull-down capabilities.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/dbda76f342258f8029f0420fbe3f341a9abd6f01.1640270559.git.geert+renesas@glider.be
-rw-r--r-- | drivers/pinctrl/renesas/core.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c index ef88359ddf5c..1e0b21428e83 100644 --- a/drivers/pinctrl/renesas/core.c +++ b/drivers/pinctrl/renesas/core.c @@ -1161,6 +1161,28 @@ static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info) for (i = 0; bias_regs && (bias_regs[i].puen || bias_regs[i].pud); i++) sh_pfc_check_bias_reg(info, &bias_regs[i]); + for (i = 0; bias_regs && + (bias_regs[i / 32].puen || bias_regs[i / 32].pud); i++) { + if (bias_regs[i / 32].pins[i % 32] == SH_PFC_PIN_NONE) + continue; + + for (j = 0; j < i; j++) { + if (bias_regs[i / 32].pins[i % 32] != + bias_regs[j / 32].pins[j % 32]) + continue; + + if (bias_regs[i / 32].puen && bias_regs[j / 32].puen) + sh_pfc_err("bias_reg 0x%x:%u/0x%x:%u: pin conflict\n", + bias_regs[i / 32].puen, i % 32, + bias_regs[j / 32].puen, j % 32); + if (bias_regs[i / 32].pud && bias_regs[j / 32].pud) + sh_pfc_err("bias_reg 0x%x:%u/0x%x:%u: pin conflict\n", + bias_regs[i / 32].pud, i % 32, + bias_regs[j / 32].pud, j % 32); + } + + } + /* Check ioctrl registers */ for (i = 0; info->ioctrl_regs && info->ioctrl_regs[i].reg; i++) sh_pfc_check_reg(drvname, info->ioctrl_regs[i].reg, U32_MAX); |