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: ad7879 - 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-1-5875240b48d8@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Bartosz Golaszewski and committed by
Dmitry Torokhov
4aaadf94 36b624b9

+7 -4
+7 -4
drivers/input/touchscreen/ad7879.c
··· 444 444 return !!(val & AD7879_GPIO_DATA); 445 445 } 446 446 447 - static void ad7879_gpio_set_value(struct gpio_chip *chip, 448 - unsigned gpio, int value) 447 + static int ad7879_gpio_set_value(struct gpio_chip *chip, unsigned int gpio, 448 + int value) 449 449 { 450 450 struct ad7879 *ts = gpiochip_get_data(chip); 451 + int ret; 451 452 452 453 mutex_lock(&ts->mutex); 453 454 if (value) ··· 456 455 else 457 456 ts->cmd_crtl2 &= ~AD7879_GPIO_DATA; 458 457 459 - ad7879_write(ts, AD7879_REG_CTRL2, ts->cmd_crtl2); 458 + ret = ad7879_write(ts, AD7879_REG_CTRL2, ts->cmd_crtl2); 460 459 mutex_unlock(&ts->mutex); 460 + 461 + return ret; 461 462 } 462 463 463 464 static int ad7879_gpio_add(struct ad7879 *ts) ··· 475 472 ts->gc.direction_input = ad7879_gpio_direction_input; 476 473 ts->gc.direction_output = ad7879_gpio_direction_output; 477 474 ts->gc.get = ad7879_gpio_get_value; 478 - ts->gc.set = ad7879_gpio_set_value; 475 + ts->gc.set_rv = ad7879_gpio_set_value; 479 476 ts->gc.can_sleep = 1; 480 477 ts->gc.base = -1; 481 478 ts->gc.ngpio = 1;