mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
pinctrl: xway: 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/20250612-gpiochip-set-rv-pinctrl-remaining-v1-8-556b0a530cd4@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
e62acaef5d
commit
0f7ccc85d8
|
|
@ -1293,7 +1293,7 @@ static struct ltq_pinmux_info xway_info = {
|
|||
};
|
||||
|
||||
/* --------- gpio_chip related code --------- */
|
||||
static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
|
||||
static int xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
|
||||
{
|
||||
struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
|
||||
|
||||
|
|
@ -1301,6 +1301,8 @@ static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
|
|||
gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin));
|
||||
else
|
||||
gpio_clearbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xway_gpio_get(struct gpio_chip *chip, unsigned int pin)
|
||||
|
|
@ -1328,9 +1330,7 @@ static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val)
|
|||
else
|
||||
gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin));
|
||||
gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
|
||||
xway_gpio_set(chip, pin, val);
|
||||
|
||||
return 0;
|
||||
return xway_gpio_set(chip, pin, val);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1354,7 +1354,7 @@ static struct gpio_chip xway_chip = {
|
|||
.direction_input = xway_gpio_dir_in,
|
||||
.direction_output = xway_gpio_dir_out,
|
||||
.get = xway_gpio_get,
|
||||
.set = xway_gpio_set,
|
||||
.set_rv = xway_gpio_set,
|
||||
.request = gpiochip_generic_request,
|
||||
.free = gpiochip_generic_free,
|
||||
.to_irq = xway_gpio_to_irq,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user