]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: spacemit: delete spacemit_pctrl_check_power()
authorConor Dooley <conor.dooley@microchip.com>
Tue, 19 May 2026 09:37:24 +0000 (10:37 +0100)
committerLinus Walleij <linusw@kernel.org>
Tue, 26 May 2026 11:32:52 +0000 (13:32 +0200)
As far as I can tell spacemit_pctrl_check_power(), called during the
custom implementation of dt_node_to_map, is redundant because
the driver's implementation generate_config performs the check too.
Removing this would allow the driver to use the newly added common
function pinctrl_generic_pinmux_dt_node_to_map().

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/spacemit/pinctrl-k1.c

index 95024e2bb5a587b31ac9bcb3980792aef0e50d9c..ae8f9eb61a8c096ac98c7595a5237c949a617159 100644 (file)
@@ -409,38 +409,6 @@ static inline u32 spacemit_get_drive_strength_mA(enum spacemit_pin_io_type type,
        }
 }
 
-static int spacemit_pctrl_check_power(struct pinctrl_dev *pctldev,
-                                     struct device_node *dn,
-                                     struct spacemit_pin_mux_config *pinmuxs,
-                                     int num_pins, const char *grpname)
-{
-       struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
-       struct device *dev = pctrl->dev;
-       enum spacemit_pin_io_type type;
-       u32 power = 0, i;
-
-       of_property_read_u32(dn, "power-source", &power);
-
-       for (i = 0; i < num_pins; i++) {
-               type = spacemit_to_pin_io_type(pinmuxs[i].pin);
-
-               if (type != IO_TYPE_EXTERNAL)
-                       continue;
-
-               switch (power) {
-               case PIN_POWER_STATE_1V8:
-               case PIN_POWER_STATE_3V3:
-                       break;
-               default:
-                       dev_err(dev, "group %s has unsupported power\n",
-                               grpname);
-                       return -ENOTSUPP;
-               }
-       }
-
-       return 0;
-}
-
 static void spacemit_set_io_pwr_domain(struct spacemit_pinctrl *pctrl,
                                      const struct spacemit_pin *spin,
                                      const enum spacemit_pin_io_type type)
@@ -548,11 +516,6 @@ static int spacemit_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
                                return dev_err_probe(dev, -ENODEV, "failed to get pin %d\n", pins[i]);
                }
 
-               ret = spacemit_pctrl_check_power(pctldev, child, pinmuxs,
-                                                npins, grpname);
-               if (ret < 0)
-                       return ret;
-
                map[nmaps].type = PIN_MAP_TYPE_MUX_GROUP;
                map[nmaps].data.mux.function = np->name;
                map[nmaps].data.mux.group = grpname;