Message ID | 20250610-gpiochip-set-rv-input-v1-0-5875240b48d8@linaro.org |
---|---|
Headers | show |
Series | Input: convert GPIO chips to using new value setters | expand |
> -----Original Message----- > From: Bartosz Golaszewski <brgl@bgdev.pl> > Sent: Tuesday, June 10, 2025 11:40 AM > To: Hennerich, Michael <Michael.Hennerich@analog.com>; Dmitry Torokhov > <dmitry.torokhov@gmail.com>; Linus Walleij <linus.walleij@linaro.org>; > Bartosz Golaszewski <brgl@bgdev.pl> > Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; linux- > gpio@vger.kernel.org; Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > Subject: [PATCH RESEND 3/3] Input: adp5589 - use new GPIO line value setter > callbacks > > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > 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> > --- > drivers/input/keyboard/adp5589-keys.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/input/keyboard/adp5589-keys.c > b/drivers/input/keyboard/adp5589-keys.c > index > 81d0876ee358ef4b521f3f936dc2ab108bb4cda3..986a789f1ec3b3599dc94 > e1f6cd871e1df5e1537 100644 > --- a/drivers/input/keyboard/adp5589-keys.c > +++ b/drivers/input/keyboard/adp5589-keys.c > @@ -404,8 +404,8 @@ static int adp5589_gpio_get_value(struct gpio_chip > *chip, unsigned off) > return !!(val & bit); > } > > -static void adp5589_gpio_set_value(struct gpio_chip *chip, > - unsigned off, int val) > +static int adp5589_gpio_set_value(struct gpio_chip *chip, unsigned int off, > + int val) > { > struct adp5589_kpad *kpad = gpiochip_get_data(chip); > unsigned int bank = kpad->var->bank(kpad->gpiomap[off]); > @@ -418,8 +418,9 @@ static void adp5589_gpio_set_value(struct gpio_chip > *chip, > else > kpad->dat_out[bank] &= ~bit; > > - adp5589_write(kpad->client, kpad->var- > >reg(ADP5589_GPO_DATA_OUT_A) + > - bank, kpad->dat_out[bank]); > + return adp5589_write(kpad->client, > + kpad->var->reg(ADP5589_GPO_DATA_OUT_A) + > bank, > + kpad->dat_out[bank]); > } > > static int adp5589_gpio_direction_input(struct gpio_chip *chip, unsigned off) > @@ -520,7 +521,7 @@ static int adp5589_gpio_add(struct adp5589_kpad > *kpad) > kpad->gc.direction_input = adp5589_gpio_direction_input; > kpad->gc.direction_output = adp5589_gpio_direction_output; > kpad->gc.get = adp5589_gpio_get_value; > - kpad->gc.set = adp5589_gpio_set_value; > + kpad->gc.set_rv = adp5589_gpio_set_value; > kpad->gc.can_sleep = 1; > > kpad->gc.base = gpio_data->gpio_start; > > -- > 2.48.1
Never got any further feedback on this series last cycle. Resending for v6.17. struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. We're in the process of converting all GPIO drivers to using the new API. This series converts all the GPIO controllers under drivers/input/. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> --- Bartosz Golaszewski (3): Input: ad7879 - use new GPIO line value setter callbacks Input: adp5588 - use new GPIO line value setter callbacks Input: adp5589 - use new GPIO line value setter callbacks drivers/input/keyboard/adp5588-keys.c | 9 +++++---- drivers/input/keyboard/adp5589-keys.c | 11 ++++++----- drivers/input/touchscreen/ad7879.c | 11 +++++++---- 3 files changed, 18 insertions(+), 13 deletions(-) --- base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 change-id: 20250331-gpiochip-set-rv-input-bc12818c5732 Best regards,