summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-10-10 15:16:54 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-11-04 10:23:21 +0100
commitab56e2bfceecae12e3b656b1641ecb961de6f92c (patch)
tree4acc01b2bfe11f0939ce4dbe8ef99de911a7c3c1
parent45d2055b0067739253883dc541f37c86aad45c92 (diff)
pinctrl: remove pinctrl_gpio_set_config()
There are no more users of pinctrl_gpio_set_config() so remove it. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/core.c36
-rw-r--r--include/linux/pinctrl/consumer.h6
2 files changed, 15 insertions, 27 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index b000ecc1bab3..3c67528240da 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -904,42 +904,36 @@ int pinctrl_gpio_direction_output_new(struct gpio_chip *gc, unsigned int offset)
}
EXPORT_SYMBOL_GPL(pinctrl_gpio_direction_output_new);
-/* This function is deprecated and will be removed. Don't use. */
-int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
+/**
+ * pinctrl_gpio_set_config_new() - Apply config to given GPIO pin
+ * @gc: GPIO chip structure from the GPIO subsystem
+ * @offset: hardware offset of the GPIO relative to the controller
+ * @config: the configuration to apply to the GPIO
+ *
+ * This function should *ONLY* be used from gpiolib-based GPIO drivers, if
+ * they need to call the underlying pin controller to change GPIO config
+ * (for example set debounce time).
+ */
+int pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
+ unsigned long config)
{
unsigned long configs[] = { config };
struct pinctrl_gpio_range *range;
struct pinctrl_dev *pctldev;
int ret, pin;
- ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
+ ret = pinctrl_get_device_gpio_range(gc->base + offset, &pctldev,
+ &range);
if (ret)
return ret;
mutex_lock(&pctldev->mutex);
- pin = gpio_to_pin(range, gpio);
+ pin = gpio_to_pin(range, gc->base + offset);
ret = pinconf_set_config(pctldev, pin, configs, ARRAY_SIZE(configs));
mutex_unlock(&pctldev->mutex);
return ret;
}
-EXPORT_SYMBOL_GPL(pinctrl_gpio_set_config);
-
-/**
- * pinctrl_gpio_set_config_new() - Apply config to given GPIO pin
- * @gc: GPIO chip structure from the GPIO subsystem
- * @offset: hardware offset of the GPIO relative to the controller
- * @config: the configuration to apply to the GPIO
- *
- * This function should *ONLY* be used from gpiolib-based GPIO drivers, if
- * they need to call the underlying pin controller to change GPIO config
- * (for example set debounce time).
- */
-int pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
- unsigned long config)
-{
- return pinctrl_gpio_set_config(gc->base + offset, config);
-}
EXPORT_SYMBOL_GPL(pinctrl_gpio_set_config_new);
static struct pinctrl_state *find_state(struct pinctrl *p,
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h
index e25e9b0599ac..aa3a7a7ca52d 100644
--- a/include/linux/pinctrl/consumer.h
+++ b/include/linux/pinctrl/consumer.h
@@ -33,7 +33,6 @@ int pinctrl_gpio_direction_input_new(struct gpio_chip *gc,
unsigned int offset);
int pinctrl_gpio_direction_output_new(struct gpio_chip *gc,
unsigned int offset);
-int pinctrl_gpio_set_config(unsigned gpio, unsigned long config);
int pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
unsigned long config);
@@ -97,11 +96,6 @@ pinctrl_gpio_direction_output_new(struct gpio_chip *gc, unsigned int offset)
return 0;
}
-static inline int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
-{
- return 0;
-}
-
static inline int
pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
unsigned long config)