mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
pinctrl: pistachio: 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-11-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
8152769f9f
commit
e52254e5ce
1 changed files with 5 additions and 3 deletions
|
@ -1186,12 +1186,14 @@ static int pistachio_gpio_get(struct gpio_chip *chip, unsigned offset)
|
|||
return !!(gpio_readl(bank, reg) & BIT(offset));
|
||||
}
|
||||
|
||||
static void pistachio_gpio_set(struct gpio_chip *chip, unsigned offset,
|
||||
int value)
|
||||
static int pistachio_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct pistachio_gpio_bank *bank = gpiochip_get_data(chip);
|
||||
|
||||
gpio_mask_writel(bank, GPIO_OUTPUT, offset, !!value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pistachio_gpio_direction_input(struct gpio_chip *chip,
|
||||
|
@ -1326,7 +1328,7 @@ static void pistachio_gpio_irq_handler(struct irq_desc *desc)
|
|||
.direction_input = pistachio_gpio_direction_input, \
|
||||
.direction_output = pistachio_gpio_direction_output, \
|
||||
.get = pistachio_gpio_get, \
|
||||
.set = pistachio_gpio_set, \
|
||||
.set_rv = pistachio_gpio_set, \
|
||||
.base = _pin_base, \
|
||||
.ngpio = _npins, \
|
||||
}, \
|
||||
|
|
Loading…
Add table
Reference in a new issue