mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
pinctrl: apple: 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> Reviewed-by: Janne Grunau <j@jannau.net> Link: https://lore.kernel.org/20250612-gpiochip-set-rv-pinctrl-remaining-v1-10-556b0a530cd4@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
66a0708111
commit
72c236f78e
|
|
@ -217,11 +217,13 @@ static int apple_gpio_get(struct gpio_chip *chip, unsigned offset)
|
|||
return !!(reg & REG_GPIOx_DATA);
|
||||
}
|
||||
|
||||
static void apple_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
static int apple_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
|
||||
apple_gpio_set_reg(pctl, offset, REG_GPIOx_DATA, value ? REG_GPIOx_DATA : 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int apple_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
|
||||
|
|
@ -376,7 +378,7 @@ static int apple_gpio_register(struct apple_gpio_pinctrl *pctl)
|
|||
pctl->gpio_chip.direction_input = apple_gpio_direction_input;
|
||||
pctl->gpio_chip.direction_output = apple_gpio_direction_output;
|
||||
pctl->gpio_chip.get = apple_gpio_get;
|
||||
pctl->gpio_chip.set = apple_gpio_set;
|
||||
pctl->gpio_chip.set_rv = apple_gpio_set;
|
||||
pctl->gpio_chip.base = -1;
|
||||
pctl->gpio_chip.ngpio = pctl->pinctrl_desc.npins;
|
||||
pctl->gpio_chip.parent = pctl->dev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user