From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Vladimir Zapolskiy <vz@mleia.com>,
Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Andy Shevchenko <andy@kernel.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 09/12] gpio: max77620: use new GPIO line value setter callbacks
Date: Tue, 06 May 2025 11:01:52 +0200 [thread overview]
Message-ID: <20250506-gpiochip-set-rv-gpio-part3-v1-9-0fbdea5a9667@linaro.org> (raw)
In-Reply-To: <20250506-gpiochip-set-rv-gpio-part3-v1-0-0fbdea5a9667@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-max77620.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index 8c2a5609161fd..af7af8e40afe4 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -223,20 +223,17 @@ static int max77620_gpio_set_debounce(struct max77620_gpio *mgpio,
return ret;
}
-static void max77620_gpio_set(struct gpio_chip *gc, unsigned int offset,
- int value)
+static int max77620_gpio_set(struct gpio_chip *gc, unsigned int offset,
+ int value)
{
struct max77620_gpio *mgpio = gpiochip_get_data(gc);
u8 val;
- int ret;
val = (value) ? MAX77620_CNFG_GPIO_OUTPUT_VAL_HIGH :
MAX77620_CNFG_GPIO_OUTPUT_VAL_LOW;
- ret = regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset),
- MAX77620_CNFG_GPIO_OUTPUT_VAL_MASK, val);
- if (ret < 0)
- dev_err(mgpio->dev, "CNFG_GPIO_OUT update failed: %d\n", ret);
+ return regmap_update_bits(mgpio->rmap, GPIO_REG_ADDR(offset),
+ MAX77620_CNFG_GPIO_OUTPUT_VAL_MASK, val);
}
static int max77620_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
@@ -314,7 +311,7 @@ static int max77620_gpio_probe(struct platform_device *pdev)
mgpio->gpio_chip.direction_input = max77620_gpio_dir_input;
mgpio->gpio_chip.get = max77620_gpio_get;
mgpio->gpio_chip.direction_output = max77620_gpio_dir_output;
- mgpio->gpio_chip.set = max77620_gpio_set;
+ mgpio->gpio_chip.set_rv = max77620_gpio_set;
mgpio->gpio_chip.set_config = max77620_gpio_set_config;
mgpio->gpio_chip.ngpio = MAX77620_GPIO_NR;
mgpio->gpio_chip.can_sleep = 1;
--
2.45.2
next prev parent reply other threads:[~2025-05-06 9:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 9:01 [PATCH 00/12] gpio: convert more GPIO chips to using new value setters - part 3 for v6.16 Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 01/12] gpio: lp873x: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 02/12] gpio: lp87565: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 03/12] gpio: lpc18xx: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 04/12] gpio: lpc32xx: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 05/12] gpio: madera: " Bartosz Golaszewski
2025-05-06 9:20 ` Charles Keepax
2025-05-06 9:01 ` [PATCH 06/12] gpio: max3191x: remove unused callbacks Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 07/12] gpio: max730x: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 08/12] gpio: max732x: " Bartosz Golaszewski
2025-05-06 9:01 ` Bartosz Golaszewski [this message]
2025-05-06 9:01 ` [PATCH 10/12] gpio: mb86s7x: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 11/12] gpio: mc33880: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 12/12] gpio: ml-ioh: " Bartosz Golaszewski
2025-05-07 14:55 ` Andy Shevchenko
2025-05-13 13:15 ` [PATCH 00/12] gpio: convert more GPIO chips to using new value setters - part 3 for v6.16 Bartosz Golaszewski
2025-05-13 13:37 ` Andy Shevchenko
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=20250506-gpiochip-set-rv-gpio-part3-v1-9-0fbdea5a9667@linaro.org \
--to=brgl@bgdev.pl \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=ckeepax@opensource.cirrus.com \
--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-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=piotr.wojtaszczyk@timesys.com \
--cc=rf@opensource.cirrus.com \
--cc=vz@mleia.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).