pinctrl: renesas: Make sh_pfc_pin_to_bias_reg() static
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 3 Mar 2021 13:26:14 +0000 (14:26 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 24 Mar 2021 09:38:29 +0000 (10:38 +0100)
Now all R-Car pin control drivers have been converted to the common
R-Car bias handling, sh_pfc_pin_to_bias_reg() is only called from a
single place.  Move it from core.c to pinctrl.c, make it static, and
rename it to rcar_pin_to_bias_reg(), as it is specific to R-Car SoCs.

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/20210303132619.3938128-2-geert+renesas@glider.be
drivers/pinctrl/renesas/core.c
drivers/pinctrl/renesas/core.h
drivers/pinctrl/renesas/pinctrl.c

index 2bfd300..5ccc49b 100644 (file)
@@ -394,26 +394,6 @@ int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type)
        return 0;
 }
 
-const struct pinmux_bias_reg *
-sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
-                      unsigned int *bit)
-{
-       unsigned int i, j;
-
-       for (i = 0; pfc->info->bias_regs[i].puen; i++) {
-               for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) {
-                       if (pfc->info->bias_regs[i].pins[j] == pin) {
-                               *bit = j;
-                               return &pfc->info->bias_regs[i];
-                       }
-               }
-       }
-
-       WARN_ONCE(1, "Pin %u is not in bias info list\n", pin);
-
-       return NULL;
-}
-
 static int sh_pfc_init_ranges(struct sh_pfc *pfc)
 {
        struct sh_pfc_pin_range *range;
index 5ca7e08..19f7b43 100644 (file)
@@ -29,10 +29,6 @@ void sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data);
 int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin);
 int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type);
 
-const struct pinmux_bias_reg *
-sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, 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,
                          unsigned int bias);
index a49f747..963d217 100644 (file)
@@ -840,12 +840,32 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
        return pinctrl_enable(pmx->pctl);
 }
 
+static const struct pinmux_bias_reg *
+rcar_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
+                    unsigned int *bit)
+{
+       unsigned int i, j;
+
+       for (i = 0; pfc->info->bias_regs[i].puen; i++) {
+               for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) {
+                       if (pfc->info->bias_regs[i].pins[j] == pin) {
+                               *bit = j;
+                               return &pfc->info->bias_regs[i];
+                       }
+               }
+       }
+
+       WARN_ONCE(1, "Pin %u is not in bias info list\n", pin);
+
+       return NULL;
+}
+
 unsigned int rcar_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin)
 {
        const struct pinmux_bias_reg *reg;
        unsigned int bit;
 
-       reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
+       reg = rcar_pin_to_bias_reg(pfc, pin, &bit);
        if (!reg)
                return PIN_CONFIG_BIAS_DISABLE;
 
@@ -864,7 +884,7 @@ void rcar_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,
        u32 enable, updown;
        unsigned int bit;
 
-       reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
+       reg = rcar_pin_to_bias_reg(pfc, pin, &bit);
        if (!reg)
                return;