* [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers
@ 2025-07-09 6:41 Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 01/19] gpio: vx855: use new GPIO line value setter callbacks Bartosz Golaszewski
` (19 more replies)
0 siblings, 20 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
Alright, there are a few left so let's get this done.
Commit 98ce1eb1fd87e ("gpiolib: introduce gpio_chip setters that return
values") added new line setter callbacks to struct gpio_chip. They allow
to indicate failures to callers. We're in the process of converting all
GPIO controllers to using them before removing the old ones. This series
converts the remaining GPIO drivers.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Bartosz Golaszewski (19):
gpio: vx855: use new GPIO line value setter callbacks
gpio: wcd934x: check the return value of regmap_update_bits()
gpio: wcd934x: use new GPIO line value setter callbacks
gpio: wcove: use new GPIO line value setter callbacks
gpio: winbond: use new GPIO line value setter callbacks
gpio: wm831x: use new GPIO line value setter callbacks
gpio: wm8350: use new GPIO line value setter callbacks
gpio: wm8994: use new GPIO line value setter callbacks
gpio: xgene: use new GPIO line value setter callbacks
gpio: xilinx: use new GPIO line value setter callbacks
gpio: xlp: drop unneeded ngpio checks
gpio: xlp: use new GPIO line value setter callbacks
gpio: xra1403: use new GPIO line value setter callbacks
gpio: xtensa: remove unneeded .set() callback
gpio: xtensa: use new GPIO line value setter callbacks
gpio: zevio: use new GPIO line value setter callbacks
gpio: zynq: use new GPIO line value setter callbacks
gpio: zynqmp-modepin: use new GPIO line value setter callbacks
gpio: zynqmp-modepin: set line value in .direction_output()
drivers/gpio/gpio-vx855.c | 9 +++++----
drivers/gpio/gpio-wcd934x.c | 16 ++++++++++------
drivers/gpio/gpio-wcove.c | 12 ++++++------
drivers/gpio/gpio-winbond.c | 16 ++++++++++------
drivers/gpio/gpio-wm831x.c | 13 ++++++-------
drivers/gpio/gpio-wm8350.c | 15 +++++++--------
drivers/gpio/gpio-wm8994.c | 8 +++++---
drivers/gpio/gpio-xgene.c | 6 ++++--
drivers/gpio/gpio-xilinx.c | 6 ++++--
drivers/gpio/gpio-xlp.c | 10 ++++------
drivers/gpio/gpio-xra1403.c | 13 +++++--------
drivers/gpio/gpio-xtensa.c | 13 ++++---------
drivers/gpio/gpio-zevio.c | 6 ++++--
drivers/gpio/gpio-zynq.c | 8 +++++---
drivers/gpio/gpio-zynqmp-modepin.c | 10 ++++++----
15 files changed, 85 insertions(+), 76 deletions(-)
---
base-commit: 58ba80c4740212c29a1cf9b48f588e60a7612209
change-id: 20250703-gpiochip-set-rv-gpio-remaining-6c554dd3e662
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 01/19] gpio: vx855: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 02/19] gpio: wcd934x: check the return value of regmap_update_bits() Bartosz Golaszewski
` (18 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-vx855.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-vx855.c b/drivers/gpio/gpio-vx855.c
index 8fd6c3913d6935da37454647cf7500d91c82e0c8..a3bceac7854c0632c2f7891783be41521fd1f53c 100644
--- a/drivers/gpio/gpio-vx855.c
+++ b/drivers/gpio/gpio-vx855.c
@@ -127,8 +127,7 @@ static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr)
return ret;
}
-static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr,
- int val)
+static int vx855gpio_set(struct gpio_chip *gpio, unsigned int nr, int val)
{
struct vx855_gpio *vg = gpiochip_get_data(gpio);
unsigned long flags;
@@ -136,7 +135,7 @@ static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr,
/* True GPI cannot be switched to output mode */
if (nr < NR_VX855_GPI)
- return;
+ return -EPERM;
spin_lock_irqsave(&vg->lock, flags);
reg_out = inl(vg->io_gpo);
@@ -153,6 +152,8 @@ static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr,
}
outl(reg_out, vg->io_gpo);
spin_unlock_irqrestore(&vg->lock, flags);
+
+ return 0;
}
static int vx855gpio_direction_output(struct gpio_chip *gpio,
@@ -215,7 +216,7 @@ static void vx855gpio_gpio_setup(struct vx855_gpio *vg)
c->direction_input = vx855gpio_direction_input;
c->direction_output = vx855gpio_direction_output;
c->get = vx855gpio_get;
- c->set = vx855gpio_set;
+ c->set_rv = vx855gpio_set;
c->set_config = vx855gpio_set_config;
c->dbg_show = NULL;
c->base = 0;
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 02/19] gpio: wcd934x: check the return value of regmap_update_bits()
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 01/19] gpio: vx855: use new GPIO line value setter callbacks Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 03/19] gpio: wcd934x: use new GPIO line value setter callbacks Bartosz Golaszewski
` (17 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
regmap_update_bits() can fail so check its return value in
wcd_gpio_direction_output() for consistency with the rest of the code
and propagate any errors.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-wcd934x.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-wcd934x.c b/drivers/gpio/gpio-wcd934x.c
index 2bba27b13947f14459c32db4812f6451eddbbfe4..cfa7b0a50c8e339603bc5fc70a8d7354f3bc6486 100644
--- a/drivers/gpio/gpio-wcd934x.c
+++ b/drivers/gpio/gpio-wcd934x.c
@@ -46,9 +46,12 @@ static int wcd_gpio_direction_output(struct gpio_chip *chip, unsigned int pin,
int val)
{
struct wcd_gpio_data *data = gpiochip_get_data(chip);
+ int ret;
- regmap_update_bits(data->map, WCD_REG_DIR_CTL_OFFSET,
- WCD_PIN_MASK(pin), WCD_PIN_MASK(pin));
+ ret = regmap_update_bits(data->map, WCD_REG_DIR_CTL_OFFSET,
+ WCD_PIN_MASK(pin), WCD_PIN_MASK(pin));
+ if (ret)
+ return ret;
return regmap_update_bits(data->map, WCD_REG_VAL_CTL_OFFSET,
WCD_PIN_MASK(pin),
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 03/19] gpio: wcd934x: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 01/19] gpio: vx855: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 02/19] gpio: wcd934x: check the return value of regmap_update_bits() Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 04/19] gpio: wcove: " Bartosz Golaszewski
` (16 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-wcd934x.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-wcd934x.c b/drivers/gpio/gpio-wcd934x.c
index cfa7b0a50c8e339603bc5fc70a8d7354f3bc6486..c89da9a220168e1317131d2428fa4105ebae2aab 100644
--- a/drivers/gpio/gpio-wcd934x.c
+++ b/drivers/gpio/gpio-wcd934x.c
@@ -68,12 +68,13 @@ static int wcd_gpio_get(struct gpio_chip *chip, unsigned int pin)
return !!(value & WCD_PIN_MASK(pin));
}
-static void wcd_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
+static int wcd_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
{
struct wcd_gpio_data *data = gpiochip_get_data(chip);
- regmap_update_bits(data->map, WCD_REG_VAL_CTL_OFFSET,
- WCD_PIN_MASK(pin), val ? WCD_PIN_MASK(pin) : 0);
+ return regmap_update_bits(data->map, WCD_REG_VAL_CTL_OFFSET,
+ WCD_PIN_MASK(pin),
+ val ? WCD_PIN_MASK(pin) : 0);
}
static int wcd_gpio_probe(struct platform_device *pdev)
@@ -97,7 +98,7 @@ static int wcd_gpio_probe(struct platform_device *pdev)
chip->direction_output = wcd_gpio_direction_output;
chip->get_direction = wcd_gpio_get_direction;
chip->get = wcd_gpio_get;
- chip->set = wcd_gpio_set;
+ chip->set_rv = wcd_gpio_set;
chip->parent = dev;
chip->base = -1;
chip->ngpio = WCD934X_NPINS;
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 04/19] gpio: wcove: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (2 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 03/19] gpio: wcd934x: use new GPIO line value setter callbacks Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 8:32 ` Andy Shevchenko
2025-07-09 14:21 ` Sathyanarayanan Kuppuswamy
2025-07-09 6:41 ` [PATCH 05/19] gpio: winbond: " Bartosz Golaszewski
` (15 subsequent siblings)
19 siblings, 2 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-wcove.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 1ec24f6f9300f33f5b3f0f8deb539e08392b8188..c50b74ced6364e3c3cfbe9ed385d21c80a2bb2e7 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -200,18 +200,18 @@ static int wcove_gpio_get(struct gpio_chip *chip, unsigned int gpio)
return val & 0x1;
}
-static void wcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
+static int wcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
{
struct wcove_gpio *wg = gpiochip_get_data(chip);
int reg = to_reg(gpio, CTRL_OUT);
if (reg < 0)
- return;
+ return 0;
if (value)
- regmap_set_bits(wg->regmap, reg, 1);
- else
- regmap_clear_bits(wg->regmap, reg, 1);
+ return regmap_set_bits(wg->regmap, reg, 1);
+
+ return regmap_clear_bits(wg->regmap, reg, 1);
}
static int wcove_gpio_set_config(struct gpio_chip *chip, unsigned int gpio,
@@ -442,7 +442,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
wg->chip.direction_output = wcove_gpio_dir_out;
wg->chip.get_direction = wcove_gpio_get_direction;
wg->chip.get = wcove_gpio_get;
- wg->chip.set = wcove_gpio_set;
+ wg->chip.set_rv = wcove_gpio_set;
wg->chip.set_config = wcove_gpio_set_config;
wg->chip.base = -1;
wg->chip.ngpio = WCOVE_VGPIO_NUM;
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 05/19] gpio: winbond: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (3 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 04/19] gpio: wcove: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 06/19] gpio: wm831x: " Bartosz Golaszewski
` (14 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-winbond.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-winbond.c b/drivers/gpio/gpio-winbond.c
index 4b61d975cc0ec27a3b0fc342a976b09bb14e0d28..421655b5d4c24d9ceda6d258f0a17f49c5215bc8 100644
--- a/drivers/gpio/gpio-winbond.c
+++ b/drivers/gpio/gpio-winbond.c
@@ -458,17 +458,19 @@ static int winbond_gpio_direction_out(struct gpio_chip *gc,
return 0;
}
-static void winbond_gpio_set(struct gpio_chip *gc, unsigned int offset,
- int val)
+static int winbond_gpio_set(struct gpio_chip *gc, unsigned int offset,
+ int val)
{
unsigned long *base = gpiochip_get_data(gc);
const struct winbond_gpio_info *info;
+ int ret;
if (!winbond_gpio_get_info(&offset, &info))
- return;
+ return -EACCES;
- if (winbond_sio_enter(*base) != 0)
- return;
+ ret = winbond_sio_enter(*base);
+ if (ret)
+ return ret;
winbond_sio_select_logical(*base, info->dev);
@@ -481,6 +483,8 @@ static void winbond_gpio_set(struct gpio_chip *gc, unsigned int offset,
winbond_sio_reg_bclear(*base, info->datareg, offset);
winbond_sio_leave(*base);
+
+ return 0;
}
static struct gpio_chip winbond_gpio_chip = {
@@ -490,7 +494,7 @@ static struct gpio_chip winbond_gpio_chip = {
.can_sleep = true,
.get = winbond_gpio_get,
.direction_input = winbond_gpio_direction_in,
- .set = winbond_gpio_set,
+ .set_rv = winbond_gpio_set,
.direction_output = winbond_gpio_direction_out,
};
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 06/19] gpio: wm831x: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (4 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 05/19] gpio: winbond: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 9:41 ` Charles Keepax
2025-07-09 6:41 ` [PATCH 07/19] gpio: wm8350: " Bartosz Golaszewski
` (13 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-wm831x.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index 61bb83a1e8ae4de29c57066944ce25beacdb454c..ab58aa7c0b9965ff13ea82efa22dbf6fa5d06c92 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -58,13 +58,14 @@ static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset)
return 0;
}
-static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static int wm831x_gpio_set(struct gpio_chip *chip, unsigned int offset,
+ int value)
{
struct wm831x_gpio *wm831x_gpio = gpiochip_get_data(chip);
struct wm831x *wm831x = wm831x_gpio->wm831x;
- wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset,
- value << offset);
+ return wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset,
+ value << offset);
}
static int wm831x_gpio_direction_out(struct gpio_chip *chip,
@@ -85,9 +86,7 @@ static int wm831x_gpio_direction_out(struct gpio_chip *chip,
return ret;
/* Can only set GPIO state once it's in output mode */
- wm831x_gpio_set(chip, offset, value);
-
- return 0;
+ return wm831x_gpio_set(chip, offset, value);
}
static int wm831x_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
@@ -254,7 +253,7 @@ static const struct gpio_chip template_chip = {
.direction_input = wm831x_gpio_direction_in,
.get = wm831x_gpio_get,
.direction_output = wm831x_gpio_direction_out,
- .set = wm831x_gpio_set,
+ .set_rv = wm831x_gpio_set,
.to_irq = wm831x_gpio_to_irq,
.set_config = wm831x_set_config,
.dbg_show = wm831x_gpio_dbg_show,
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 07/19] gpio: wm8350: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (5 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 06/19] gpio: wm831x: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 9:42 ` Charles Keepax
2025-07-09 6:41 ` [PATCH 08/19] gpio: wm8994: " Bartosz Golaszewski
` (12 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-wm8350.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c
index 2421cf606ed6fded2231b76a2cda2839ed824d64..9a7677f841fc62383267e5e4d95843e2115c83d6 100644
--- a/drivers/gpio/gpio-wm8350.c
+++ b/drivers/gpio/gpio-wm8350.c
@@ -48,15 +48,16 @@ static int wm8350_gpio_get(struct gpio_chip *chip, unsigned offset)
return 0;
}
-static void wm8350_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static int wm8350_gpio_set(struct gpio_chip *chip, unsigned int offset,
+ int value)
{
struct wm8350_gpio_data *wm8350_gpio = gpiochip_get_data(chip);
struct wm8350 *wm8350 = wm8350_gpio->wm8350;
if (value)
- wm8350_set_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset);
- else
- wm8350_clear_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset);
+ return wm8350_set_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset);
+
+ return wm8350_clear_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset);
}
static int wm8350_gpio_direction_out(struct gpio_chip *chip,
@@ -72,9 +73,7 @@ static int wm8350_gpio_direction_out(struct gpio_chip *chip,
return ret;
/* Don't have an atomic direction/value setup */
- wm8350_gpio_set(chip, offset, value);
-
- return 0;
+ return wm8350_gpio_set(chip, offset, value);
}
static int wm8350_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
@@ -94,7 +93,7 @@ static const struct gpio_chip template_chip = {
.direction_input = wm8350_gpio_direction_in,
.get = wm8350_gpio_get,
.direction_output = wm8350_gpio_direction_out,
- .set = wm8350_gpio_set,
+ .set_rv = wm8350_gpio_set,
.to_irq = wm8350_gpio_to_irq,
.can_sleep = true,
};
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 08/19] gpio: wm8994: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (6 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 07/19] gpio: wm8350: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 9:43 ` Charles Keepax
2025-07-09 6:41 ` [PATCH 09/19] gpio: xgene: " Bartosz Golaszewski
` (11 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-wm8994.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index bf05c9b5882b89c1abbe7a0617f6a45e2968dd50..ccc005628dd278f2db5e5d8bbefe89dfb1fb2f67 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -89,7 +89,8 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip,
WM8994_GPN_DIR | WM8994_GPN_LVL, value);
}
-static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static int wm8994_gpio_set(struct gpio_chip *chip, unsigned int offset,
+ int value)
{
struct wm8994_gpio *wm8994_gpio = gpiochip_get_data(chip);
struct wm8994 *wm8994 = wm8994_gpio->wm8994;
@@ -97,7 +98,8 @@ static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
if (value)
value = WM8994_GPN_LVL;
- wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, WM8994_GPN_LVL, value);
+ return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, WM8994_GPN_LVL,
+ value);
}
static int wm8994_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
@@ -254,7 +256,7 @@ static const struct gpio_chip template_chip = {
.direction_input = wm8994_gpio_direction_in,
.get = wm8994_gpio_get,
.direction_output = wm8994_gpio_direction_out,
- .set = wm8994_gpio_set,
+ .set_rv = wm8994_gpio_set,
.set_config = wm8994_gpio_set_config,
.to_irq = wm8994_gpio_to_irq,
.dbg_show = wm8994_gpio_dbg_show,
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 09/19] gpio: xgene: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (7 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 08/19] gpio: wm8994: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 10/19] gpio: xilinx: " Bartosz Golaszewski
` (10 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-xgene.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index fb4b0c67aeef46a3810178a3a1b6870d04c8ecdf..28f794e5eb26c06088a205ac7294a226fe63843b 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -62,7 +62,7 @@ static void __xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
iowrite32(setval, chip->base + bank_offset);
}
-static void xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
+static int xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
{
struct xgene_gpio *chip = gpiochip_get_data(gc);
unsigned long flags;
@@ -70,6 +70,8 @@ static void xgene_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
spin_lock_irqsave(&chip->lock, flags);
__xgene_gpio_set(gc, offset, val);
spin_unlock_irqrestore(&chip->lock, flags);
+
+ return 0;
}
static int xgene_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
@@ -176,7 +178,7 @@ static int xgene_gpio_probe(struct platform_device *pdev)
gpio->chip.direction_input = xgene_gpio_dir_in;
gpio->chip.direction_output = xgene_gpio_dir_out;
gpio->chip.get = xgene_gpio_get;
- gpio->chip.set = xgene_gpio_set;
+ gpio->chip.set_rv = xgene_gpio_set;
gpio->chip.label = dev_name(&pdev->dev);
gpio->chip.base = -1;
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 10/19] gpio: xilinx: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (8 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 09/19] gpio: xgene: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 11/19] gpio: xlp: drop unneeded ngpio checks Bartosz Golaszewski
` (9 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-xilinx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index c58a7e1349b4b226057c6d045f901c7fea5da449..aaaa741179805d54e1cd1425579eb52a3579d6e5 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -148,7 +148,7 @@ static int xgpio_get(struct gpio_chip *gc, unsigned int gpio)
* This function writes the specified value in to the specified signal of the
* GPIO device.
*/
-static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
+static int xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
{
unsigned long flags;
struct xgpio_instance *chip = gpiochip_get_data(gc);
@@ -162,6 +162,8 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
xgpio_write_ch(chip, XGPIO_DATA_OFFSET, bit, chip->state);
raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
+
+ return 0;
}
/**
@@ -600,7 +602,7 @@ static int xgpio_probe(struct platform_device *pdev)
chip->gc.direction_input = xgpio_dir_in;
chip->gc.direction_output = xgpio_dir_out;
chip->gc.get = xgpio_get;
- chip->gc.set = xgpio_set;
+ chip->gc.set_rv = xgpio_set;
chip->gc.request = xgpio_request;
chip->gc.free = xgpio_free;
chip->gc.set_multiple = xgpio_set_multiple;
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 11/19] gpio: xlp: drop unneeded ngpio checks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (9 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 10/19] gpio: xilinx: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 12/19] gpio: xlp: use new GPIO line value setter callbacks Bartosz Golaszewski
` (8 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
GPIO core already makes sure that offsets higher than the number of GPIOs
are never passed to controller callbacks. We can remove the unnecessary
check.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-xlp.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index b4b52213bcd955c3644b4410c2684d77951f03f2..35b376c73ce312df1312ab09b53246fb5905152a 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -206,7 +206,6 @@ static int xlp_gpio_dir_output(struct gpio_chip *gc, unsigned gpio, int state)
{
struct xlp_gpio_priv *priv = gpiochip_get_data(gc);
- BUG_ON(gpio >= gc->ngpio);
xlp_gpio_set_reg(priv->gpio_out_en, gpio, 0x1);
return 0;
@@ -216,7 +215,6 @@ static int xlp_gpio_dir_input(struct gpio_chip *gc, unsigned gpio)
{
struct xlp_gpio_priv *priv = gpiochip_get_data(gc);
- BUG_ON(gpio >= gc->ngpio);
xlp_gpio_set_reg(priv->gpio_out_en, gpio, 0x0);
return 0;
@@ -226,7 +224,6 @@ static int xlp_gpio_get(struct gpio_chip *gc, unsigned gpio)
{
struct xlp_gpio_priv *priv = gpiochip_get_data(gc);
- BUG_ON(gpio >= gc->ngpio);
return xlp_gpio_get_reg(priv->gpio_paddrv, gpio);
}
@@ -234,7 +231,6 @@ static void xlp_gpio_set(struct gpio_chip *gc, unsigned gpio, int state)
{
struct xlp_gpio_priv *priv = gpiochip_get_data(gc);
- BUG_ON(gpio >= gc->ngpio);
xlp_gpio_set_reg(priv->gpio_paddrv, gpio, state);
}
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 12/19] gpio: xlp: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (10 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 11/19] gpio: xlp: drop unneeded ngpio checks Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 13/19] gpio: xra1403: " Bartosz Golaszewski
` (7 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-xlp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index 35b376c73ce312df1312ab09b53246fb5905152a..bcd2dfec462d0d25b3f97d682866ab035f207c3a 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -227,11 +227,13 @@ static int xlp_gpio_get(struct gpio_chip *gc, unsigned gpio)
return xlp_gpio_get_reg(priv->gpio_paddrv, gpio);
}
-static void xlp_gpio_set(struct gpio_chip *gc, unsigned gpio, int state)
+static int xlp_gpio_set(struct gpio_chip *gc, unsigned int gpio, int state)
{
struct xlp_gpio_priv *priv = gpiochip_get_data(gc);
xlp_gpio_set_reg(priv->gpio_paddrv, gpio, state);
+
+ return 0;
}
static int xlp_gpio_probe(struct platform_device *pdev)
@@ -272,7 +274,7 @@ static int xlp_gpio_probe(struct platform_device *pdev)
gc->ngpio = 70;
gc->direction_output = xlp_gpio_dir_output;
gc->direction_input = xlp_gpio_dir_input;
- gc->set = xlp_gpio_set;
+ gc->set_rv = xlp_gpio_set;
gc->get = xlp_gpio_get;
spin_lock_init(&priv->lock);
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 13/19] gpio: xra1403: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (11 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 12/19] gpio: xlp: use new GPIO line value setter callbacks Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 14/19] gpio: xtensa: remove unneeded .set() callback Bartosz Golaszewski
` (6 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-xra1403.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-xra1403.c b/drivers/gpio/gpio-xra1403.c
index 842cf875bb92036616adc63748dda85c47af544c..70402c6b540739b73170988d03ad592b5d55c153 100644
--- a/drivers/gpio/gpio-xra1403.c
+++ b/drivers/gpio/gpio-xra1403.c
@@ -102,16 +102,13 @@ static int xra1403_get(struct gpio_chip *chip, unsigned int offset)
return !!(val & BIT(offset % 8));
}
-static void xra1403_set(struct gpio_chip *chip, unsigned int offset, int value)
+static int xra1403_set(struct gpio_chip *chip, unsigned int offset, int value)
{
- int ret;
struct xra1403 *xra = gpiochip_get_data(chip);
- ret = regmap_update_bits(xra->regmap, to_reg(XRA_OCR, offset),
- BIT(offset % 8), value ? BIT(offset % 8) : 0);
- if (ret)
- dev_err(chip->parent, "Failed to set pin: %d, ret: %d\n",
- offset, ret);
+ return regmap_update_bits(xra->regmap, to_reg(XRA_OCR, offset),
+ BIT(offset % 8),
+ value ? BIT(offset % 8) : 0);
}
#ifdef CONFIG_DEBUG_FS
@@ -167,7 +164,7 @@ static int xra1403_probe(struct spi_device *spi)
xra->chip.direction_output = xra1403_direction_output;
xra->chip.get_direction = xra1403_get_direction;
xra->chip.get = xra1403_get;
- xra->chip.set = xra1403_set;
+ xra->chip.set_rv = xra1403_set;
xra->chip.dbg_show = xra1403_dbg_show;
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 14/19] gpio: xtensa: remove unneeded .set() callback
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (12 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 13/19] gpio: xra1403: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 15/19] gpio: xtensa: use new GPIO line value setter callbacks Bartosz Golaszewski
` (5 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
GPIO core deals just fine with input-only controllers not implementing
the .set() callback. Remove the unneeded dummy implementation.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-xtensa.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/gpio/gpio-xtensa.c b/drivers/gpio/gpio-xtensa.c
index c8af34a6368f4f69f9960fff7f8c27a2c8ddea8b..341b691ac2345b93320a6e8b933444d26dcf50e6 100644
--- a/drivers/gpio/gpio-xtensa.c
+++ b/drivers/gpio/gpio-xtensa.c
@@ -86,12 +86,6 @@ static int xtensa_impwire_get_value(struct gpio_chip *gc, unsigned offset)
return !!(impwire & BIT(offset));
}
-static void xtensa_impwire_set_value(struct gpio_chip *gc, unsigned offset,
- int value)
-{
- BUG(); /* output only; should never be called */
-}
-
static int xtensa_expstate_get_direction(struct gpio_chip *gc, unsigned offset)
{
return GPIO_LINE_DIRECTION_OUT; /* output only */
@@ -128,7 +122,6 @@ static struct gpio_chip impwire_chip = {
.ngpio = 32,
.get_direction = xtensa_impwire_get_direction,
.get = xtensa_impwire_get_value,
- .set = xtensa_impwire_set_value,
};
static struct gpio_chip expstate_chip = {
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 15/19] gpio: xtensa: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (13 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 14/19] gpio: xtensa: remove unneeded .set() callback Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 16/19] gpio: zevio: " Bartosz Golaszewski
` (4 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-xtensa.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-xtensa.c b/drivers/gpio/gpio-xtensa.c
index 341b691ac2345b93320a6e8b933444d26dcf50e6..e7ff3c60324dcd11aa03348684bb4743a771729d 100644
--- a/drivers/gpio/gpio-xtensa.c
+++ b/drivers/gpio/gpio-xtensa.c
@@ -103,7 +103,7 @@ static int xtensa_expstate_get_value(struct gpio_chip *gc, unsigned offset)
return !!(expstate & BIT(offset));
}
-static void xtensa_expstate_set_value(struct gpio_chip *gc, unsigned offset,
+static int xtensa_expstate_set_value(struct gpio_chip *gc, unsigned int offset,
int value)
{
unsigned long flags, saved_cpenable;
@@ -114,6 +114,8 @@ static void xtensa_expstate_set_value(struct gpio_chip *gc, unsigned offset,
__asm__ __volatile__("wrmsk_expstate %0, %1"
:: "a" (val), "a" (mask));
disable_cp(flags, saved_cpenable);
+
+ return 0;
}
static struct gpio_chip impwire_chip = {
@@ -130,7 +132,7 @@ static struct gpio_chip expstate_chip = {
.ngpio = 32,
.get_direction = xtensa_expstate_get_direction,
.get = xtensa_expstate_get_value,
- .set = xtensa_expstate_set_value,
+ .set_rv = xtensa_expstate_set_value,
};
static int xtensa_gpio_probe(struct platform_device *pdev)
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 16/19] gpio: zevio: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (14 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 15/19] gpio: xtensa: use new GPIO line value setter callbacks Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 17/19] gpio: zynq: " Bartosz Golaszewski
` (3 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-zevio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-zevio.c b/drivers/gpio/gpio-zevio.c
index d7230fd83f5d68a9d80352b7a57e12cd21c389ce..0799f79767107d1775b7692e582e9548a6bb38d6 100644
--- a/drivers/gpio/gpio-zevio.c
+++ b/drivers/gpio/gpio-zevio.c
@@ -91,7 +91,7 @@ static int zevio_gpio_get(struct gpio_chip *chip, unsigned pin)
return (val >> ZEVIO_GPIO_BIT(pin)) & 0x1;
}
-static void zevio_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
+static int zevio_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)
{
struct zevio_gpio *controller = gpiochip_get_data(chip);
u32 val;
@@ -105,6 +105,8 @@ static void zevio_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
zevio_gpio_port_set(controller, pin, ZEVIO_GPIO_OUTPUT, val);
spin_unlock(&controller->lock);
+
+ return 0;
}
static int zevio_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
@@ -159,7 +161,7 @@ static int zevio_gpio_to_irq(struct gpio_chip *chip, unsigned pin)
static const struct gpio_chip zevio_gpio_chip = {
.direction_input = zevio_gpio_direction_input,
.direction_output = zevio_gpio_direction_output,
- .set = zevio_gpio_set,
+ .set_rv = zevio_gpio_set,
.get = zevio_gpio_get,
.to_irq = zevio_gpio_to_irq,
.base = 0,
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 17/19] gpio: zynq: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (15 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 16/19] gpio: zevio: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 18/19] gpio: zynqmp-modepin: " Bartosz Golaszewski
` (2 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-zynq.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 3dae63f3ea217780818ccb991ccba13ab18775db..b22b4e25c68dc19388dc2eb63504279e548c73b7 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -265,8 +265,8 @@ static int zynq_gpio_get_value(struct gpio_chip *chip, unsigned int pin)
* upper 16 bits) based on the given pin number and sets the state of a
* gpio pin to the specified value. The state is either 0 or non-zero.
*/
-static void zynq_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
- int state)
+static int zynq_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
+ int state)
{
unsigned int reg_offset, bank_num, bank_pin_num;
struct zynq_gpio *gpio = gpiochip_get_data(chip);
@@ -290,6 +290,8 @@ static void zynq_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
((state << bank_pin_num) | ZYNQ_GPIO_UPPER_MASK);
writel_relaxed(state, gpio->base_addr + reg_offset);
+
+ return 0;
}
/**
@@ -930,7 +932,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
chip->owner = THIS_MODULE;
chip->parent = &pdev->dev;
chip->get = zynq_gpio_get_value;
- chip->set = zynq_gpio_set_value;
+ chip->set_rv = zynq_gpio_set_value;
chip->request = zynq_gpio_request;
chip->free = zynq_gpio_free;
chip->direction_input = zynq_gpio_dir_in;
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 18/19] gpio: zynqmp-modepin: use new GPIO line value setter callbacks
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (16 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 17/19] gpio: zynq: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 19/19] gpio: zynqmp-modepin: set line value in .direction_output() Bartosz Golaszewski
2025-07-15 7:56 ` (subset) [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
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-zynqmp-modepin.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-zynqmp-modepin.c b/drivers/gpio/gpio-zynqmp-modepin.c
index 2f3c9ebfa78d1d6bc4624a614c316e4fbeae2aff..36a547d6fc5a5c100f81c72600e14d620a462cc5 100644
--- a/drivers/gpio/gpio-zynqmp-modepin.c
+++ b/drivers/gpio/gpio-zynqmp-modepin.c
@@ -57,8 +57,8 @@ static int modepin_gpio_get_value(struct gpio_chip *chip, unsigned int pin)
*
* Return: None.
*/
-static void modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
- int state)
+static int modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
+ int state)
{
u32 bootpin_val = 0;
int ret;
@@ -77,6 +77,8 @@ static void modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
ret = zynqmp_pm_bootmode_write(bootpin_val);
if (ret)
pr_err("modepin: set value error %d for pin %d\n", ret, pin);
+
+ return ret;
}
/**
@@ -128,7 +130,7 @@ static int modepin_gpio_probe(struct platform_device *pdev)
chip->owner = THIS_MODULE;
chip->parent = &pdev->dev;
chip->get = modepin_gpio_get_value;
- chip->set = modepin_gpio_set_value;
+ chip->set_rv = modepin_gpio_set_value;
chip->direction_input = modepin_gpio_dir_in;
chip->direction_output = modepin_gpio_dir_out;
chip->label = dev_name(&pdev->dev);
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 19/19] gpio: zynqmp-modepin: set line value in .direction_output()
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (17 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 18/19] gpio: zynqmp-modepin: " Bartosz Golaszewski
@ 2025-07-09 6:41 ` Bartosz Golaszewski
2025-07-15 7:56 ` (subset) [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-09 6:41 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
It's ok to not do anything specific when setting direction but the
callback should still respect the line value the user requests.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-zynqmp-modepin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-zynqmp-modepin.c b/drivers/gpio/gpio-zynqmp-modepin.c
index 36a547d6fc5a5c100f81c72600e14d620a462cc5..6dc5d7acb89c544d8dd9e217c96e41cc5599d116 100644
--- a/drivers/gpio/gpio-zynqmp-modepin.c
+++ b/drivers/gpio/gpio-zynqmp-modepin.c
@@ -104,7 +104,7 @@ static int modepin_gpio_dir_in(struct gpio_chip *chip, unsigned int pin)
static int modepin_gpio_dir_out(struct gpio_chip *chip, unsigned int pin,
int state)
{
- return 0;
+ return modepin_gpio_set_value(chip, pin, state);
}
/**
--
2.48.1
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 04/19] gpio: wcove: use new GPIO line value setter callbacks
2025-07-09 6:41 ` [PATCH 04/19] gpio: wcove: " Bartosz Golaszewski
@ 2025-07-09 8:32 ` Andy Shevchenko
2025-07-09 8:41 ` Andy Shevchenko
2025-07-09 14:21 ` Sathyanarayanan Kuppuswamy
1 sibling, 1 reply; 27+ messages in thread
From: Andy Shevchenko @ 2025-07-09 8:32 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Linus Walleij, Kuppuswamy Sathyanarayanan, Andy Shevchenko,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Nandor Han,
linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
On Wed, Jul 9, 2025 at 9:42 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> 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.
...
> if (value)
> - regmap_set_bits(wg->regmap, reg, 1);
> - else
> - regmap_clear_bits(wg->regmap, reg, 1);
> + return regmap_set_bits(wg->regmap, reg, 1);
> +
> + return regmap_clear_bits(wg->regmap, reg, 1);
return regmap_assign_bits(...);
Otherwise LGTM,
Reviewed-by: Andy Shevchenko <andy@kernel.org>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 04/19] gpio: wcove: use new GPIO line value setter callbacks
2025-07-09 8:32 ` Andy Shevchenko
@ 2025-07-09 8:41 ` Andy Shevchenko
0 siblings, 0 replies; 27+ messages in thread
From: Andy Shevchenko @ 2025-07-09 8:41 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Bartosz Golaszewski, Linus Walleij, Kuppuswamy Sathyanarayanan,
Andy Shevchenko, Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Nandor Han, linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
On Wed, Jul 09, 2025 at 11:32:40AM +0300, Andy Shevchenko wrote:
> On Wed, Jul 9, 2025 at 9:42 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
...
> > if (value)
> > - regmap_set_bits(wg->regmap, reg, 1);
> > - else
> > - regmap_clear_bits(wg->regmap, reg, 1);
> > + return regmap_set_bits(wg->regmap, reg, 1);
> > +
> > + return regmap_clear_bits(wg->regmap, reg, 1);
>
> return regmap_assign_bits(...);
Btw, since you are doing sometimes two patches, it might worth to have
a prerequisite that changes set/clear to assign and then your patch will
be cleaner.
> Otherwise LGTM,
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 06/19] gpio: wm831x: use new GPIO line value setter callbacks
2025-07-09 6:41 ` [PATCH 06/19] gpio: wm831x: " Bartosz Golaszewski
@ 2025-07-09 9:41 ` Charles Keepax
0 siblings, 0 replies; 27+ messages in thread
From: Charles Keepax @ 2025-07-09 9:41 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Linus Walleij, Kuppuswamy Sathyanarayanan, Andy Shevchenko,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Nandor Han,
linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
On Wed, Jul 09, 2025 at 08:41:43AM +0200, Bartosz Golaszewski wrote:
> 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>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 07/19] gpio: wm8350: use new GPIO line value setter callbacks
2025-07-09 6:41 ` [PATCH 07/19] gpio: wm8350: " Bartosz Golaszewski
@ 2025-07-09 9:42 ` Charles Keepax
0 siblings, 0 replies; 27+ messages in thread
From: Charles Keepax @ 2025-07-09 9:42 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Linus Walleij, Kuppuswamy Sathyanarayanan, Andy Shevchenko,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Nandor Han,
linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
On Wed, Jul 09, 2025 at 08:41:44AM +0200, Bartosz Golaszewski wrote:
> 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>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 08/19] gpio: wm8994: use new GPIO line value setter callbacks
2025-07-09 6:41 ` [PATCH 08/19] gpio: wm8994: " Bartosz Golaszewski
@ 2025-07-09 9:43 ` Charles Keepax
0 siblings, 0 replies; 27+ messages in thread
From: Charles Keepax @ 2025-07-09 9:43 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Linus Walleij, Kuppuswamy Sathyanarayanan, Andy Shevchenko,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Nandor Han,
linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
On Wed, Jul 09, 2025 at 08:41:45AM +0200, Bartosz Golaszewski wrote:
> 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>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 04/19] gpio: wcove: use new GPIO line value setter callbacks
2025-07-09 6:41 ` [PATCH 04/19] gpio: wcove: " Bartosz Golaszewski
2025-07-09 8:32 ` Andy Shevchenko
@ 2025-07-09 14:21 ` Sathyanarayanan Kuppuswamy
1 sibling, 0 replies; 27+ messages in thread
From: Sathyanarayanan Kuppuswamy @ 2025-07-09 14:21 UTC (permalink / raw)
To: Bartosz Golaszewski, Linus Walleij, Andy Shevchenko,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Nandor Han
Cc: linux-gpio, linux-kernel, patches, linux-arm-kernel,
Bartosz Golaszewski
On 7/8/25 11:41 PM, Bartosz Golaszewski wrote:
> 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>
> ---
Looks good.
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> drivers/gpio/gpio-wcove.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
> index 1ec24f6f9300f33f5b3f0f8deb539e08392b8188..c50b74ced6364e3c3cfbe9ed385d21c80a2bb2e7 100644
> --- a/drivers/gpio/gpio-wcove.c
> +++ b/drivers/gpio/gpio-wcove.c
> @@ -200,18 +200,18 @@ static int wcove_gpio_get(struct gpio_chip *chip, unsigned int gpio)
> return val & 0x1;
> }
>
> -static void wcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
> +static int wcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
> {
> struct wcove_gpio *wg = gpiochip_get_data(chip);
> int reg = to_reg(gpio, CTRL_OUT);
>
> if (reg < 0)
> - return;
> + return 0;
>
> if (value)
> - regmap_set_bits(wg->regmap, reg, 1);
> - else
> - regmap_clear_bits(wg->regmap, reg, 1);
> + return regmap_set_bits(wg->regmap, reg, 1);
> +
> + return regmap_clear_bits(wg->regmap, reg, 1);
> }
>
> static int wcove_gpio_set_config(struct gpio_chip *chip, unsigned int gpio,
> @@ -442,7 +442,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
> wg->chip.direction_output = wcove_gpio_dir_out;
> wg->chip.get_direction = wcove_gpio_get_direction;
> wg->chip.get = wcove_gpio_get;
> - wg->chip.set = wcove_gpio_set;
> + wg->chip.set_rv = wcove_gpio_set;
> wg->chip.set_config = wcove_gpio_set_config;
> wg->chip.base = -1;
> wg->chip.ngpio = WCOVE_VGPIO_NUM;
>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: (subset) [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
` (18 preceding siblings ...)
2025-07-09 6:41 ` [PATCH 19/19] gpio: zynqmp-modepin: set line value in .direction_output() Bartosz Golaszewski
@ 2025-07-15 7:56 ` Bartosz Golaszewski
19 siblings, 0 replies; 27+ messages in thread
From: Bartosz Golaszewski @ 2025-07-15 7:56 UTC (permalink / raw)
To: Linus Walleij, Kuppuswamy Sathyanarayanan, Andy Shevchenko,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Nandor Han,
Bartosz Golaszewski
Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, patches,
linux-arm-kernel
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Wed, 09 Jul 2025 08:41:37 +0200, Bartosz Golaszewski wrote:
> Alright, there are a few left so let's get this done.
>
> Commit 98ce1eb1fd87e ("gpiolib: introduce gpio_chip setters that return
> values") added new line setter callbacks to struct gpio_chip. They allow
> to indicate failures to callers. We're in the process of converting all
> GPIO controllers to using them before removing the old ones. This series
> converts the remaining GPIO drivers.
>
> [...]
I queued the ones where there were no comments and will send an updated
conversion for gpio-wcove with comments from Andy addressed.
[01/19] gpio: vx855: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/db12cdc8224845bbe31c1d7e5e7d2c2dde4847dc
[02/19] gpio: wcd934x: check the return value of regmap_update_bits()
https://git.kernel.org/brgl/linux/c/ff0f0d7c6587e38c308be9905e36f86e98fb9c1f
[03/19] gpio: wcd934x: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/637c3054e9a5337d303577584d575c247138dae9
[05/19] gpio: winbond: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/dd94adf7da36281b5d1bc40ee8ac265082576f4c
[06/19] gpio: wm831x: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/023a24f83edf9abe0fbb66929d286cec5a09afbb
[07/19] gpio: wm8350: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/f7a680e9c2e512f903c385ed1a71732389788aa0
[08/19] gpio: wm8994: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/47b427311d959fd3235485c08f367cd14df282ab
[09/19] gpio: xgene: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/0933fc87f31da17871d6cf255dd9a3de86658685
[10/19] gpio: xilinx: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/1919ea19a4ff8d534fb2789453a69f86f70a493b
[11/19] gpio: xlp: drop unneeded ngpio checks
https://git.kernel.org/brgl/linux/c/c719fd3e3991b16460babf70036bf39cdbbb7a90
[12/19] gpio: xlp: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/6d0f71cd58aaf107dab3ea5a50e9f725d4691043
[13/19] gpio: xra1403: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/ae8bcae8487293cb1de201734ab4779a2438618a
[14/19] gpio: xtensa: remove unneeded .set() callback
https://git.kernel.org/brgl/linux/c/735ddc67ab88d35378cb79cfa5ac5f87db0775fb
[15/19] gpio: xtensa: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/383a02f6d421bf7703703aeb3e7270426b2fc30c
[16/19] gpio: zevio: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/ee6e05eb5fe27a45678848fb92a2a5db6b3fea84
[17/19] gpio: zynq: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/815c9769ba0e2e184eac570e596391a1ca58b8c8
[18/19] gpio: zynqmp-modepin: use new GPIO line value setter callbacks
https://git.kernel.org/brgl/linux/c/680450b358b73823c82d150330aacc52e286be08
[19/19] gpio: zynqmp-modepin: set line value in .direction_output()
https://git.kernel.org/brgl/linux/c/e70513bd98e3912b431b196e3cf53ac821598e6a
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2025-07-15 8:04 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 6:41 [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 01/19] gpio: vx855: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 02/19] gpio: wcd934x: check the return value of regmap_update_bits() Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 03/19] gpio: wcd934x: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 04/19] gpio: wcove: " Bartosz Golaszewski
2025-07-09 8:32 ` Andy Shevchenko
2025-07-09 8:41 ` Andy Shevchenko
2025-07-09 14:21 ` Sathyanarayanan Kuppuswamy
2025-07-09 6:41 ` [PATCH 05/19] gpio: winbond: " Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 06/19] gpio: wm831x: " Bartosz Golaszewski
2025-07-09 9:41 ` Charles Keepax
2025-07-09 6:41 ` [PATCH 07/19] gpio: wm8350: " Bartosz Golaszewski
2025-07-09 9:42 ` Charles Keepax
2025-07-09 6:41 ` [PATCH 08/19] gpio: wm8994: " Bartosz Golaszewski
2025-07-09 9:43 ` Charles Keepax
2025-07-09 6:41 ` [PATCH 09/19] gpio: xgene: " Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 10/19] gpio: xilinx: " Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 11/19] gpio: xlp: drop unneeded ngpio checks Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 12/19] gpio: xlp: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 13/19] gpio: xra1403: " Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 14/19] gpio: xtensa: remove unneeded .set() callback Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 15/19] gpio: xtensa: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 16/19] gpio: zevio: " Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 17/19] gpio: zynq: " Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 18/19] gpio: zynqmp-modepin: " Bartosz Golaszewski
2025-07-09 6:41 ` [PATCH 19/19] gpio: zynqmp-modepin: set line value in .direction_output() Bartosz Golaszewski
2025-07-15 7:56 ` (subset) [PATCH 00/19] gpio: use new GPIO line value setter callbacks in remaining drivers Bartosz Golaszewski
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).