Commit 26b64438 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpio: wcove: 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.

Reviewed-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250715-gpiochip-set-rv-gpio-remaining-v2-2-072b4cf06330@linaro.org


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 03d4bd57
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -200,15 +200,15 @@ static int wcove_gpio_get(struct gpio_chip *chip, unsigned int gpio)
	return val & 0x1;
}

static void wcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
static int wcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
{
	struct wcove_gpio *wg = gpiochip_get_data(chip);
	int reg = to_reg(gpio, CTRL_OUT);

	if (reg < 0)
		return;
		return 0;

	regmap_assign_bits(wg->regmap, reg, 1, value);
	return regmap_assign_bits(wg->regmap, reg, 1, value);
}

static int wcove_gpio_set_config(struct gpio_chip *chip, unsigned int gpio,
@@ -439,7 +439,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
	wg->chip.direction_output = wcove_gpio_dir_out;
	wg->chip.get_direction = wcove_gpio_get_direction;
	wg->chip.get = wcove_gpio_get;
	wg->chip.set = wcove_gpio_set;
	wg->chip.set_rv = wcove_gpio_set;
	wg->chip.set_config = wcove_gpio_set_config;
	wg->chip.base = -1;
	wg->chip.ngpio = WCOVE_VGPIO_NUM;