mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ARM: sa1100/gpio: use new 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. Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-arm-v1-2-9e4a914c7fd4@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
6982e6b0bd
commit
9c3782118a
1 changed files with 4 additions and 2 deletions
|
@ -563,7 +563,7 @@ static int sa1111_gpio_get(struct gpio_chip *gc, unsigned offset)
|
|||
return !!(readl_relaxed(reg + SA1111_GPIO_PXDRR) & mask);
|
||||
}
|
||||
|
||||
static void sa1111_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||
static int sa1111_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
|
||||
{
|
||||
struct sa1111 *sachip = gc_to_sa1111(gc);
|
||||
unsigned long flags;
|
||||
|
@ -574,6 +574,8 @@ static void sa1111_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
|||
sa1111_gpio_modify(reg + SA1111_GPIO_PXDWR, mask, value ? mask : 0);
|
||||
sa1111_gpio_modify(reg + SA1111_GPIO_PXSSR, mask, value ? mask : 0);
|
||||
spin_unlock_irqrestore(&sachip->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sa1111_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
|
||||
|
@ -613,7 +615,7 @@ static int sa1111_setup_gpios(struct sa1111 *sachip)
|
|||
sachip->gc.direction_input = sa1111_gpio_direction_input;
|
||||
sachip->gc.direction_output = sa1111_gpio_direction_output;
|
||||
sachip->gc.get = sa1111_gpio_get;
|
||||
sachip->gc.set = sa1111_gpio_set;
|
||||
sachip->gc.set_rv = sa1111_gpio_set;
|
||||
sachip->gc.set_multiple = sa1111_gpio_set_multiple;
|
||||
sachip->gc.to_irq = sa1111_gpio_to_irq;
|
||||
sachip->gc.base = -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue