Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: adp5589 - 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: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-input-v1-3-5875240b48d8@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Bartosz Golaszewski and committed by
Dmitry Torokhov
43a8440f 687f0d0e

+6 -5
+6 -5
drivers/input/keyboard/adp5589-keys.c
··· 404 404 return !!(val & bit); 405 405 } 406 406 407 - static void adp5589_gpio_set_value(struct gpio_chip *chip, 408 - unsigned off, int val) 407 + static int adp5589_gpio_set_value(struct gpio_chip *chip, unsigned int off, 408 + int val) 409 409 { 410 410 struct adp5589_kpad *kpad = gpiochip_get_data(chip); 411 411 unsigned int bank = kpad->var->bank(kpad->gpiomap[off]); ··· 418 418 else 419 419 kpad->dat_out[bank] &= ~bit; 420 420 421 - adp5589_write(kpad->client, kpad->var->reg(ADP5589_GPO_DATA_OUT_A) + 422 - bank, kpad->dat_out[bank]); 421 + return adp5589_write(kpad->client, 422 + kpad->var->reg(ADP5589_GPO_DATA_OUT_A) + bank, 423 + kpad->dat_out[bank]); 423 424 } 424 425 425 426 static int adp5589_gpio_direction_input(struct gpio_chip *chip, unsigned off) ··· 521 520 kpad->gc.direction_input = adp5589_gpio_direction_input; 522 521 kpad->gc.direction_output = adp5589_gpio_direction_output; 523 522 kpad->gc.get = adp5589_gpio_get_value; 524 - kpad->gc.set = adp5589_gpio_set_value; 523 + kpad->gc.set_rv = adp5589_gpio_set_value; 525 524 kpad->gc.can_sleep = 1; 526 525 527 526 kpad->gc.base = gpio_data->gpio_start;