aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2020-01-10 14:19:24 +0100
committerGeert Uytterhoeven <geert+renesas@glider.be>2020-02-21 13:57:44 +0100
commit8990cd297f1508904d3773f6a2c5af531e8649ca (patch)
tree53480396a51d321fe3f61c18a0b09636d2e6cb5d
parentpinctrl: sh-pfc: checker: Add drive strength register checks (diff)
downloadlinux-dev-8990cd297f1508904d3773f6a2c5af531e8649ca.tar.xz
linux-dev-8990cd297f1508904d3773f6a2c5af531e8649ca.zip
pinctrl: sh-pfc: checker: Add bias register checks
Add checks for bias register descriptors: 1. Pull-up and optional pull-down register addresses must be unique, 2. Referred pins must exist. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Link: https://lore.kernel.org/r/20200110131927.1029-11-geert+renesas@glider.be
-rw-r--r--drivers/pinctrl/sh-pfc/core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index 8304832e7c39..fcd11d83ee41 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -888,6 +888,18 @@ static void __init sh_pfc_check_drive_reg(const struct sh_pfc_soc_info *info,
}
}
+static void __init sh_pfc_check_bias_reg(const struct sh_pfc_soc_info *info,
+ const struct pinmux_bias_reg *bias)
+{
+ unsigned int i;
+
+ sh_pfc_check_reg(info->name, bias->puen);
+ if (bias->pud)
+ sh_pfc_check_reg(info->name, bias->pud);
+ for (i = 0; i < ARRAY_SIZE(bias->pins); i++)
+ sh_pfc_check_pin(info, bias->puen, bias->pins[i]);
+}
+
static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info)
{
const char *drvname = info->name;
@@ -984,6 +996,10 @@ static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info)
/* Check drive strength registers */
for (i = 0; info->drive_regs && info->drive_regs[i].reg; i++)
sh_pfc_check_drive_reg(info, &info->drive_regs[i]);
+
+ /* Check bias registers */
+ for (i = 0; info->bias_regs && info->bias_regs[i].puen; i++)
+ sh_pfc_check_bias_reg(info, &info->bias_regs[i]);
}
static void __init sh_pfc_check_driver(const struct platform_driver *pdrv)