mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
pinctrl: digicolor: 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-9-556b0a530cd4@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
0f7ccc85d8
commit
66a0708111
|
|
@ -182,7 +182,7 @@ static int dc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value);
|
||||
static int dc_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value);
|
||||
|
||||
static int dc_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
|
||||
int value)
|
||||
|
|
@ -216,7 +216,7 @@ static int dc_gpio_get(struct gpio_chip *chip, unsigned gpio)
|
|||
return !!(input & BIT(bit_off));
|
||||
}
|
||||
|
||||
static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value)
|
||||
static int dc_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
|
||||
{
|
||||
struct dc_pinmap *pmap = gpiochip_get_data(chip);
|
||||
int reg_off = GP_OUTPUT0(gpio/PINS_PER_COLLECTION);
|
||||
|
|
@ -232,6 +232,8 @@ static void dc_gpio_set(struct gpio_chip *chip, unsigned gpio, int value)
|
|||
output &= ~BIT(bit_off);
|
||||
writeb_relaxed(output, pmap->regs + reg_off);
|
||||
spin_unlock_irqrestore(&pmap->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dc_gpiochip_add(struct dc_pinmap *pmap)
|
||||
|
|
@ -246,7 +248,7 @@ static int dc_gpiochip_add(struct dc_pinmap *pmap)
|
|||
chip->direction_input = dc_gpio_direction_input;
|
||||
chip->direction_output = dc_gpio_direction_output;
|
||||
chip->get = dc_gpio_get;
|
||||
chip->set = dc_gpio_set;
|
||||
chip->set_rv = dc_gpio_set;
|
||||
chip->base = -1;
|
||||
chip->ngpio = PINS_COUNT;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user