[PATCH 06/15] gpio: adp5585: use new line value setter callbacks
Hennerich, Michael
Michael.Hennerich at analog.com
Tue Mar 4 00:46:51 AEDT 2025
> -----Original Message-----
> From: Bartosz Golaszewski <brgl at bgdev.pl>
> Sent: Monday, March 3, 2025 2:19 PM
> To: Linus Walleij <linus.walleij at linaro.org>; Bartosz Golaszewski
> <brgl at bgdev.pl>; Hennerich, Michael <Michael.Hennerich at analog.com>;
> Laurent Pinchart <laurent.pinchart at ideasonboard.com>; Mun Yew Tham
> <mun.yew.tham at intel.com>; Joel Stanley <joel at jms.id.au>; Andrew Jeffery
> <andrew at codeconstruct.com.au>
> Cc: linux-gpio at vger.kernel.org; linux-kernel at vger.kernel.org; linux-
> pwm at vger.kernel.org; patches at opensource.cirrus.com; linux-arm-
> kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; Bartosz Golaszewski
> <bartosz.golaszewski at linaro.org>
> Subject: [PATCH 06/15] gpio: adp5585: use new line value setter callbacks
>
> From: Bartosz Golaszewski <bartosz.golaszewski at 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 at linaro.org>
Acked-by: Michael Hennerich <michael.hennerich at analog.com>
> ---
> drivers/gpio/gpio-adp5585.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-adp5585.c b/drivers/gpio/gpio-adp5585.c index
> 000d31f09671..d5c0f1b267c8 100644
> --- a/drivers/gpio/gpio-adp5585.c
> +++ b/drivers/gpio/gpio-adp5585.c
> @@ -86,14 +86,16 @@ static int adp5585_gpio_get_value(struct gpio_chip
> *chip, unsigned int off)
> return !!(val & bit);
> }
>
> -static void adp5585_gpio_set_value(struct gpio_chip *chip, unsigned int off,
> int val)
> +static int adp5585_gpio_set_value(struct gpio_chip *chip, unsigned int off,
> + int val)
> {
> struct adp5585_gpio_dev *adp5585_gpio = gpiochip_get_data(chip);
> unsigned int bank = ADP5585_BANK(off);
> unsigned int bit = ADP5585_BIT(off);
>
> - regmap_update_bits(adp5585_gpio->regmap,
> ADP5585_GPO_DATA_OUT_A + bank,
> - bit, val ? bit : 0);
> + return regmap_update_bits(adp5585_gpio->regmap,
> + ADP5585_GPO_DATA_OUT_A + bank,
> + bit, val ? bit : 0);
> }
>
> static int adp5585_gpio_set_bias(struct adp5585_gpio_dev *adp5585_gpio,
> @@ -192,7 +194,7 @@ static int adp5585_gpio_probe(struct platform_device
> *pdev)
> gc->direction_input = adp5585_gpio_direction_input;
> gc->direction_output = adp5585_gpio_direction_output;
> gc->get = adp5585_gpio_get_value;
> - gc->set = adp5585_gpio_set_value;
> + gc->set_rv = adp5585_gpio_set_value;
> gc->set_config = adp5585_gpio_set_config;
> gc->can_sleep = true;
>
>
> --
> 2.45.2
More information about the Linux-aspeed
mailing list