]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
pinctrl: renesas: Pass sh_pfc_soc_info to rcar_pin_to_bias_reg()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 23 Dec 2021 14:56:19 +0000 (15:56 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 22 Feb 2022 08:57:19 +0000 (09:57 +0100)
Currently rcar_pin_to_bias_reg() takes a struct sh_pfc pointer, which is
only available after the pin control driver has been initialized,
thus preventing the checker from calling this function for validating
consistency of the pin control tables.

Fix this by replacing the parameter by a struct sh_pfc_soc_info pointer.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/3065a12dde606bacec9e5f14f10cabeaae75e265.1640270559.git.geert+renesas@glider.be
drivers/pinctrl/renesas/pfc-r8a77995.c
drivers/pinctrl/renesas/pinctrl.c
drivers/pinctrl/renesas/sh_pfc.h

index 3b0792536b2ec287af56e71842a17dd806c0d47d..445c903a121acedddeddd2fb044702b1e0b2cef9 100644 (file)
@@ -3072,7 +3072,7 @@ r8a77995_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
        const struct pinmux_bias_reg *reg;
        unsigned int bit;
 
-       reg = rcar_pin_to_bias_reg(pfc, pin, &bit);
+       reg = rcar_pin_to_bias_reg(pfc->info, pin, &bit);
        if (!reg)
                return reg;
 
index 3e4a67c67591b6c9f7e44ed4f79f51b1fd59cb3c..4c37aebc75b82e1f8c7271ba88c2168c1a0acae9 100644 (file)
@@ -835,16 +835,16 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
 }
 
 const struct pinmux_bias_reg *
-rcar_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
+rcar_pin_to_bias_reg(const struct sh_pfc_soc_info *info, unsigned int pin,
                     unsigned int *bit)
 {
        unsigned int i, j;
 
-       for (i = 0; pfc->info->bias_regs[i].puen || pfc->info->bias_regs[i].pud; i++) {
-               for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) {
-                       if (pfc->info->bias_regs[i].pins[j] == pin) {
+       for (i = 0; info->bias_regs[i].puen || info->bias_regs[i].pud; i++) {
+               for (j = 0; j < ARRAY_SIZE(info->bias_regs[i].pins); j++) {
+                       if (info->bias_regs[i].pins[j] == pin) {
                                *bit = j;
-                               return &pfc->info->bias_regs[i];
+                               return &info->bias_regs[i];
                        }
                }
        }
@@ -859,7 +859,7 @@ unsigned int rcar_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin)
        const struct pinmux_bias_reg *reg;
        unsigned int bit;
 
-       reg = rcar_pin_to_bias_reg(pfc, pin, &bit);
+       reg = rcar_pin_to_bias_reg(pfc->info, pin, &bit);
        if (!reg)
                return PIN_CONFIG_BIAS_DISABLE;
 
@@ -885,7 +885,7 @@ void rcar_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,
        u32 enable, updown;
        unsigned int bit;
 
-       reg = rcar_pin_to_bias_reg(pfc, pin, &bit);
+       reg = rcar_pin_to_bias_reg(pfc->info, pin, &bit);
        if (!reg)
                return;
 
index 7191c1c9ca9599547aaf823e3a5b8ee1c6e6acf2..2bd96b28bb8b49c9ea93803ddc0b2f47af2f94d2 100644 (file)
@@ -759,7 +759,7 @@ extern const struct sh_pfc_soc_info shx3_pinmux_info;
  * Bias helpers
  */
 const struct pinmux_bias_reg *
-rcar_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
+rcar_pin_to_bias_reg(const struct sh_pfc_soc_info *info, unsigned int pin,
                     unsigned int *bit);
 unsigned int rcar_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin);
 void rcar_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,