mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
pinctrl: owl: 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> Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-4-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
8657c6ee9b
commit
059f547079
|
|
@ -598,7 +598,7 @@ static int owl_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
|||
return !!(val & BIT(offset));
|
||||
}
|
||||
|
||||
static void owl_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
static int owl_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
{
|
||||
struct owl_pinctrl *pctrl = gpiochip_get_data(chip);
|
||||
const struct owl_gpio_port *port;
|
||||
|
|
@ -607,13 +607,15 @@ static void owl_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
|||
|
||||
port = owl_gpio_get_port(pctrl, &offset);
|
||||
if (WARN_ON(port == NULL))
|
||||
return;
|
||||
return -ENODEV;
|
||||
|
||||
gpio_base = pctrl->base + port->offset;
|
||||
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
owl_gpio_update_reg(gpio_base + port->dat, offset, value);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int owl_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
|
||||
|
|
@ -960,7 +962,7 @@ int owl_pinctrl_probe(struct platform_device *pdev,
|
|||
pctrl->chip.direction_input = owl_gpio_direction_input;
|
||||
pctrl->chip.direction_output = owl_gpio_direction_output;
|
||||
pctrl->chip.get = owl_gpio_get;
|
||||
pctrl->chip.set = owl_gpio_set;
|
||||
pctrl->chip.set_rv = owl_gpio_set;
|
||||
pctrl->chip.request = owl_gpio_request;
|
||||
pctrl->chip.free = owl_gpio_free;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user