mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
gpio: pxa: 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-6-74abf689fbd8@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
fecdef830c
commit
f1ff31c8ef
|
|
@ -315,12 +315,14 @@ static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
|
|||
return !!(gplr & GPIO_bit(offset));
|
||||
}
|
||||
|
||||
static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
static int pxa_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
{
|
||||
void __iomem *base = gpio_bank_base(chip, offset);
|
||||
|
||||
writel_relaxed(GPIO_bit(offset),
|
||||
base + (value ? GPSR_OFFSET : GPCR_OFFSET));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_GPIO
|
||||
|
|
@ -353,7 +355,7 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, void __iom
|
|||
pchip->chip.direction_input = pxa_gpio_direction_input;
|
||||
pchip->chip.direction_output = pxa_gpio_direction_output;
|
||||
pchip->chip.get = pxa_gpio_get;
|
||||
pchip->chip.set = pxa_gpio_set;
|
||||
pchip->chip.set_rv = pxa_gpio_set;
|
||||
pchip->chip.to_irq = pxa_gpio_to_irq;
|
||||
pchip->chip.ngpio = ngpio;
|
||||
pchip->chip.request = gpiochip_generic_request;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user