mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
gpio: sa1100: 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. Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-12-74abf689fbd8@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
d68ddf651d
commit
cb908f3699
|
|
@ -43,11 +43,14 @@ static int sa1100_gpio_get(struct gpio_chip *chip, unsigned offset)
|
|||
BIT(offset);
|
||||
}
|
||||
|
||||
static void sa1100_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
static int sa1100_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
int reg = value ? R_GPSR : R_GPCR;
|
||||
|
||||
writel_relaxed(BIT(offset), sa1100_gpio_chip(chip)->membase + reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sa1100_get_direction(struct gpio_chip *chip, unsigned offset)
|
||||
|
|
@ -96,7 +99,7 @@ static struct sa1100_gpio_chip sa1100_gpio_chip = {
|
|||
.get_direction = sa1100_get_direction,
|
||||
.direction_input = sa1100_direction_input,
|
||||
.direction_output = sa1100_direction_output,
|
||||
.set = sa1100_gpio_set,
|
||||
.set_rv = sa1100_gpio_set,
|
||||
.get = sa1100_gpio_get,
|
||||
.to_irq = sa1100_to_irq,
|
||||
.base = 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user