From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Michael Hennerich <michael.hennerich@analog.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mun Yew Tham <mun.yew.tham@intel.com>,
Joel Stanley <joel@jms.id.au>,
Andrew Jeffery <andrew@codeconstruct.com.au>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pwm@vger.kernel.org, patches@opensource.cirrus.com,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 01/15] gpio: 74x164: use new line value setter callbacks
Date: Mon, 03 Mar 2025 14:18:26 +0100 [thread overview]
Message-ID: <20250303-gpiochip-set-conversion-v1-1-1d5cceeebf8b@linaro.org> (raw)
In-Reply-To: <20250303-gpiochip-set-conversion-v1-0-1d5cceeebf8b@linaro.org>
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>
---
drivers/gpio/gpio-74x164.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index 640ac24b72a2..4dd5c2c330bb 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -50,8 +50,8 @@ static int gen_74x164_get_value(struct gpio_chip *gc, unsigned offset)
return !!(chip->buffer[bank] & BIT(pin));
}
-static void gen_74x164_set_value(struct gpio_chip *gc,
- unsigned offset, int val)
+static int gen_74x164_set_value(struct gpio_chip *gc,
+ unsigned int offset, int val)
{
struct gen_74x164_chip *chip = gpiochip_get_data(gc);
u8 bank = chip->registers - 1 - offset / 8;
@@ -64,11 +64,11 @@ static void gen_74x164_set_value(struct gpio_chip *gc,
else
chip->buffer[bank] &= ~BIT(pin);
- __gen_74x164_write_config(chip);
+ return __gen_74x164_write_config(chip);
}
-static void gen_74x164_set_multiple(struct gpio_chip *gc, unsigned long *mask,
- unsigned long *bits)
+static int gen_74x164_set_multiple(struct gpio_chip *gc, unsigned long *mask,
+ unsigned long *bits)
{
struct gen_74x164_chip *chip = gpiochip_get_data(gc);
unsigned long offset;
@@ -85,7 +85,7 @@ static void gen_74x164_set_multiple(struct gpio_chip *gc, unsigned long *mask,
chip->buffer[bank] &= ~bankmask;
chip->buffer[bank] |= bitmask;
}
- __gen_74x164_write_config(chip);
+ return __gen_74x164_write_config(chip);
}
static int gen_74x164_direction_output(struct gpio_chip *gc,
@@ -141,8 +141,8 @@ static int gen_74x164_probe(struct spi_device *spi)
chip->gpio_chip.label = spi->modalias;
chip->gpio_chip.direction_output = gen_74x164_direction_output;
chip->gpio_chip.get = gen_74x164_get_value;
- chip->gpio_chip.set = gen_74x164_set_value;
- chip->gpio_chip.set_multiple = gen_74x164_set_multiple;
+ chip->gpio_chip.set_rv = gen_74x164_set_value;
+ chip->gpio_chip.set_multiple_rv = gen_74x164_set_multiple;
chip->gpio_chip.base = -1;
chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers;
chip->gpio_chip.can_sleep = true;
--
2.45.2
next prev parent reply other threads:[~2025-03-03 13:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 13:18 [PATCH 00/15] gpio: convert more drivers to using the new value setters Bartosz Golaszewski
2025-03-03 13:18 ` Bartosz Golaszewski [this message]
2025-03-03 13:18 ` [PATCH 02/15] gpio: adnp: use lock guards for the I2C lock Bartosz Golaszewski
2025-03-04 9:07 ` kernel test robot
2025-03-03 13:18 ` [PATCH 03/15] gpio: adnp: use devm_mutex_init() Bartosz Golaszewski
2025-03-03 13:18 ` [PATCH 04/15] gpio: adnp: use new line value setter callbacks Bartosz Golaszewski
2025-03-03 13:18 ` [PATCH 05/15] gpio: adp5520: " Bartosz Golaszewski
2025-03-03 13:47 ` Hennerich, Michael
2025-03-03 13:18 ` [PATCH 06/15] gpio: adp5585: " Bartosz Golaszewski
2025-03-03 13:46 ` Hennerich, Michael
2025-03-03 13:18 ` [PATCH 07/15] gpio: altera-a10sr: " Bartosz Golaszewski
2025-03-03 13:18 ` [PATCH 08/15] gpio: altera: " Bartosz Golaszewski
2025-03-03 13:18 ` [PATCH 09/15] gpio: amd8111: " Bartosz Golaszewski
2025-03-03 13:18 ` [PATCH 10/15] gpio: amd-fch: " Bartosz Golaszewski
2025-03-03 13:18 ` [PATCH 11/15] gpio: arizona: " Bartosz Golaszewski
2025-03-03 13:33 ` Richard Fitzgerald
2025-03-03 13:18 ` [PATCH 12/15] gpio: aspeed: use lock guards Bartosz Golaszewski
2025-03-18 1:24 ` Andrew Jeffery
2025-03-03 13:18 ` [PATCH 13/15] gpio: aspeed: use new line value setter callbacks Bartosz Golaszewski
2025-03-18 1:25 ` Andrew Jeffery
2025-03-03 13:18 ` [PATCH 14/15] gpio: aspeed-sgpio: use lock guards Bartosz Golaszewski
2025-03-18 1:26 ` Andrew Jeffery
2025-03-03 13:18 ` [PATCH 15/15] gpio: aspeed-sgpio: use new line value setter callbacks Bartosz Golaszewski
2025-03-18 1:27 ` Andrew Jeffery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250303-gpiochip-set-conversion-v1-1-1d5cceeebf8b@linaro.org \
--to=brgl@bgdev.pl \
--cc=andrew@codeconstruct.com.au \
--cc=bartosz.golaszewski@linaro.org \
--cc=joel@jms.id.au \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=mun.yew.tham@intel.com \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).