mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 05:39:42 -04:00
pinctrl: samsung: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-12-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
e52254e5ce
commit
9e4c444755
@@ -570,15 +570,18 @@ static void samsung_gpio_set_value(struct gpio_chip *gc,
|
||||
}
|
||||
|
||||
/* gpiolib gpio_set callback function */
|
||||
static void samsung_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||
static int samsung_gpio_set(struct gpio_chip *gc, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct samsung_pin_bank *bank = gpiochip_get_data(gc);
|
||||
struct samsung_pinctrl_drv_data *drvdata = bank->drvdata;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
if (clk_enable(drvdata->pclk)) {
|
||||
ret = clk_enable(drvdata->pclk);
|
||||
if (ret) {
|
||||
dev_err(drvdata->dev, "failed to enable clock\n");
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
|
||||
raw_spin_lock_irqsave(&bank->slock, flags);
|
||||
@@ -586,6 +589,8 @@ static void samsung_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||
raw_spin_unlock_irqrestore(&bank->slock, flags);
|
||||
|
||||
clk_disable(drvdata->pclk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* gpiolib gpio_get callback function */
|
||||
@@ -1062,7 +1067,7 @@ static int samsung_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
|
||||
static const struct gpio_chip samsung_gpiolib_chip = {
|
||||
.request = gpiochip_generic_request,
|
||||
.free = gpiochip_generic_free,
|
||||
.set = samsung_gpio_set,
|
||||
.set_rv = samsung_gpio_set,
|
||||
.get = samsung_gpio_get,
|
||||
.direction_input = samsung_gpio_direction_input,
|
||||
.direction_output = samsung_gpio_direction_output,
|
||||
|
||||
Reference in New Issue
Block a user