linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Andrew Lunn <andrew@lunn.ch>,
	 Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	 Gregory Clement <gregory.clement@bootlin.com>,
	 Russell King <linux@armlinux.org.uk>,
	 Linus Walleij <linus.walleij@linaro.org>,
	 Bartosz Golaszewski <brgl@bgdev.pl>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	 Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,  linux-gpio@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org,
	 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 3/4] ARM: scoop/gpio: use new line value setter callbacks
Date: Mon, 07 Apr 2025 09:09:20 +0200	[thread overview]
Message-ID: <20250407-gpiochip-set-rv-arm-v1-3-9e4a914c7fd4@linaro.org> (raw)
In-Reply-To: <20250407-gpiochip-set-rv-arm-v1-0-9e4a914c7fd4@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>
---
 arch/arm/common/scoop.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 0b08b6621878..2d3ee76c8e17 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -63,7 +63,8 @@ static void __scoop_gpio_set(struct scoop_dev *sdev,
 	iowrite16(gpwr, sdev->base + SCOOP_GPWR);
 }
 
-static void scoop_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static int scoop_gpio_set(struct gpio_chip *chip, unsigned int offset,
+			  int value)
 {
 	struct scoop_dev *sdev = gpiochip_get_data(chip);
 	unsigned long flags;
@@ -73,6 +74,8 @@ static void scoop_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 	__scoop_gpio_set(sdev, offset, value);
 
 	spin_unlock_irqrestore(&sdev->scoop_lock, flags);
+
+	return 0;
 }
 
 static int scoop_gpio_get(struct gpio_chip *chip, unsigned offset)
@@ -215,7 +218,7 @@ static int scoop_probe(struct platform_device *pdev)
 		devptr->gpio.label = dev_name(&pdev->dev);
 		devptr->gpio.base = inf->gpio_base;
 		devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */
-		devptr->gpio.set = scoop_gpio_set;
+		devptr->gpio.set_rv = scoop_gpio_set;
 		devptr->gpio.get = scoop_gpio_get;
 		devptr->gpio.direction_input = scoop_gpio_direction_input;
 		devptr->gpio.direction_output = scoop_gpio_direction_output;

-- 
2.45.2


  parent reply	other threads:[~2025-04-07  7:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  7:09 [PATCH 0/4] ARM: convert board-file GPIO chips to using new value setters Bartosz Golaszewski
2025-04-07  7:09 ` [PATCH 1/4] ARM: orion/gpio: use new line value setter callbacks Bartosz Golaszewski
2025-04-08 12:03   ` Andrew Lunn
2025-04-08 12:12     ` Bartosz Golaszewski
2025-04-08 12:38       ` Arnd Bergmann
2025-04-07  7:09 ` [PATCH 2/4] ARM: sa1100/gpio: " Bartosz Golaszewski
2025-04-15  8:28   ` Linus Walleij
2025-04-07  7:09 ` Bartosz Golaszewski [this message]
2025-04-15  8:28   ` [PATCH 3/4] ARM: scoop/gpio: " Linus Walleij
2025-04-07  7:09 ` [PATCH 4/4] ARM: s3c/gpio: " Bartosz Golaszewski
2025-04-15  6:23   ` Krzysztof Kozlowski
2025-04-16 15:51     ` Bartosz Golaszewski
2025-04-09  8:35 ` [PATCH 0/4] ARM: convert board-file GPIO chips to using new value setters Bartosz Golaszewski
2025-04-15 21:51 ` Linus Walleij

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=20250407-gpiochip-set-rv-arm-v1-3-9e4a914c7fd4@linaro.org \
    --to=brgl@bgdev.pl \
    --cc=alim.akhtar@samsung.com \
    --cc=andrew@lunn.ch \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=gregory.clement@bootlin.com \
    --cc=krzk@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=sebastian.hesselbarth@gmail.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).