pinctrl: amdisp: 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-16-556b0a530cd4@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
b8cd87c0e9
commit
9a40347181
@ -117,7 +117,7 @@ static int amdisp_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
||||
return !!(pin_reg & BIT(GPIO_CONTROL_PIN));
|
||||
}
|
||||
|
||||
static void amdisp_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
static int amdisp_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 pin_reg;
|
||||
@ -131,6 +131,8 @@ static void amdisp_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
|
||||
pin_reg &= ~BIT(GPIO_CONTROL_PIN);
|
||||
writel(pin_reg, pctrl->gpiobase + gpio_offset[gpio]);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int amdisp_gpiochip_add(struct platform_device *pdev,
|
||||
@ -149,7 +151,7 @@ static int amdisp_gpiochip_add(struct platform_device *pdev,
|
||||
gc->direction_input = amdisp_gpio_direction_input;
|
||||
gc->direction_output = amdisp_gpio_direction_output;
|
||||
gc->get = amdisp_gpio_get;
|
||||
gc->set = amdisp_gpio_set;
|
||||
gc->set_rv = amdisp_gpio_set;
|
||||
gc->base = -1;
|
||||
gc->ngpio = ARRAY_SIZE(amdisp_range_pins);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user