mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 11:40:19 -04:00
pinctrl: at91-pio4: 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: Claudiu Beznea <claudiu.beznea@tuxon.dev> Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-1-c9d521d7c8c7@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
b883eb49ec
commit
d843a42635
@@ -390,7 +390,7 @@ static int atmel_gpio_direction_output(struct gpio_chip *chip,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void atmel_gpio_set(struct gpio_chip *chip, unsigned int offset, int val)
|
||||
static int atmel_gpio_set(struct gpio_chip *chip, unsigned int offset, int val)
|
||||
{
|
||||
struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip);
|
||||
struct atmel_pin *pin = atmel_pioctrl->pins[offset];
|
||||
@@ -398,10 +398,12 @@ static void atmel_gpio_set(struct gpio_chip *chip, unsigned int offset, int val)
|
||||
atmel_gpio_write(atmel_pioctrl, pin->bank,
|
||||
val ? ATMEL_PIO_SODR : ATMEL_PIO_CODR,
|
||||
BIT(pin->line));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void atmel_gpio_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||||
unsigned long *bits)
|
||||
static int atmel_gpio_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||||
unsigned long *bits)
|
||||
{
|
||||
struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip);
|
||||
unsigned int bank;
|
||||
@@ -431,6 +433,8 @@ static void atmel_gpio_set_multiple(struct gpio_chip *chip, unsigned long *mask,
|
||||
bits[word] >>= ATMEL_PIO_NPINS_PER_BANK;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct gpio_chip atmel_gpio_chip = {
|
||||
@@ -438,8 +442,8 @@ static struct gpio_chip atmel_gpio_chip = {
|
||||
.get = atmel_gpio_get,
|
||||
.get_multiple = atmel_gpio_get_multiple,
|
||||
.direction_output = atmel_gpio_direction_output,
|
||||
.set = atmel_gpio_set,
|
||||
.set_multiple = atmel_gpio_set_multiple,
|
||||
.set_rv = atmel_gpio_set,
|
||||
.set_multiple_rv = atmel_gpio_set_multiple,
|
||||
.to_irq = atmel_gpio_to_irq,
|
||||
.base = 0,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user