mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
pinctrl: pic32: 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-11-556b0a530cd4@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
72c236f78e
commit
dfdbce9649
|
|
@ -1828,8 +1828,8 @@ static int pic32_gpio_get(struct gpio_chip *chip, unsigned offset)
|
|||
return !!(readl(bank->reg_base + PORT_REG) & BIT(offset));
|
||||
}
|
||||
|
||||
static void pic32_gpio_set(struct gpio_chip *chip, unsigned offset,
|
||||
int value)
|
||||
static int pic32_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
|
||||
u32 mask = BIT(offset);
|
||||
|
|
@ -1838,6 +1838,8 @@ static void pic32_gpio_set(struct gpio_chip *chip, unsigned offset,
|
|||
writel(mask, bank->reg_base + PIC32_SET(PORT_REG));
|
||||
else
|
||||
writel(mask, bank->reg_base + PIC32_CLR(PORT_REG));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pic32_gpio_direction_output(struct gpio_chip *chip,
|
||||
|
|
@ -2118,7 +2120,7 @@ static void pic32_gpio_irq_handler(struct irq_desc *desc)
|
|||
.direction_input = pic32_gpio_direction_input, \
|
||||
.direction_output = pic32_gpio_direction_output, \
|
||||
.get = pic32_gpio_get, \
|
||||
.set = pic32_gpio_set, \
|
||||
.set_rv = pic32_gpio_set, \
|
||||
.ngpio = _npins, \
|
||||
.base = GPIO_BANK_START(_bank), \
|
||||
.owner = THIS_MODULE, \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user