mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 05:39:42 -04:00
pinctrl: armada-37xx: 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/20250424-gpiochip-set-rv-pinctrl-part2-v1-10-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
b0dfc1bd6f
commit
8152769f9f
@@ -424,15 +424,12 @@ static int armada_37xx_gpio_direction_output(struct gpio_chip *chip,
|
||||
mask = BIT(offset);
|
||||
|
||||
ret = regmap_update_bits(info->regmap, reg, mask, mask);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
reg = OUTPUT_VAL;
|
||||
val = value ? mask : 0;
|
||||
regmap_update_bits(info->regmap, reg, mask, val);
|
||||
|
||||
return 0;
|
||||
return regmap_update_bits(info->regmap, reg, mask, val);
|
||||
}
|
||||
|
||||
static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
||||
@@ -449,8 +446,8 @@ static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
||||
return (val & mask) != 0;
|
||||
}
|
||||
|
||||
static void armada_37xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
static int armada_37xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
|
||||
unsigned int reg = OUTPUT_VAL;
|
||||
@@ -460,7 +457,7 @@ static void armada_37xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
mask = BIT(offset);
|
||||
val = value ? mask : 0;
|
||||
|
||||
regmap_update_bits(info->regmap, reg, mask, val);
|
||||
return regmap_update_bits(info->regmap, reg, mask, val);
|
||||
}
|
||||
|
||||
static int armada_37xx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
|
||||
@@ -513,7 +510,7 @@ static const struct pinmux_ops armada_37xx_pmx_ops = {
|
||||
static const struct gpio_chip armada_37xx_gpiolib_chip = {
|
||||
.request = gpiochip_generic_request,
|
||||
.free = gpiochip_generic_free,
|
||||
.set = armada_37xx_gpio_set,
|
||||
.set_rv = armada_37xx_gpio_set,
|
||||
.get = armada_37xx_gpio_get,
|
||||
.get_direction = armada_37xx_gpio_get_direction,
|
||||
.direction_input = armada_37xx_gpio_direction_input,
|
||||
|
||||
Reference in New Issue
Block a user