From: Amelie Delaunay <amelie.delaunay@foss.st.com>
To: "Bartosz Golaszewski" <brgl@bgdev.pl>,
"Basavaraj Natikar" <Basavaraj.Natikar@amd.com>,
"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Chen-Yu Tsai" <wens@csie.org>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Andreas Färber" <afaerber@suse.de>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Paul Cercueil" <paul@crapouillou.net>,
"Steen Hegelund" <Steen.Hegelund@microchip.com>,
"Daniel Machon" <daniel.machon@microchip.com>,
UNGLinuxDriver@microchip.com,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Andrew Lunn" <andrew@lunn.ch>,
"Gregory Clement" <gregory.clement@bootlin.com>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
"Alim Akhtar" <alim.akhtar@samsung.com>
Cc: <linux-samsung-soc@vger.kernel.org>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
<linux-actions@lists.infradead.org>, <linux-mips@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Linux-stm32] [PATCH 03/12] pinctrl: stmfx: use new GPIO line value setter callbacks
Date: Thu, 24 Apr 2025 16:59:47 +0200 [thread overview]
Message-ID: <fe3323d0-161c-498d-92e8-7a723f8d9780@foss.st.com> (raw)
In-Reply-To: <20250424-gpiochip-set-rv-pinctrl-part2-v1-3-504f91120b99@linaro.org>
On 4/24/25 10:35, 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: Amelie Delaunay <amelie.delaunay@foss.st.com>
> ---
> drivers/pinctrl/pinctrl-stmfx.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
> index aae01120dc52..f4fdcaa043e6 100644
> --- a/drivers/pinctrl/pinctrl-stmfx.c
> +++ b/drivers/pinctrl/pinctrl-stmfx.c
> @@ -115,14 +115,14 @@ static int stmfx_gpio_get(struct gpio_chip *gc, unsigned int offset)
> return ret ? ret : !!(value & mask);
> }
>
> -static void stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
> +static int stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
> {
> struct stmfx_pinctrl *pctl = gpiochip_get_data(gc);
> u32 reg = value ? STMFX_REG_GPO_SET : STMFX_REG_GPO_CLR;
> u32 mask = get_mask(offset);
>
> - regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset),
> - mask, mask);
> + return regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset),
> + mask, mask);
> }
>
> static int stmfx_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
> @@ -161,8 +161,11 @@ static int stmfx_gpio_direction_output(struct gpio_chip *gc,
> struct stmfx_pinctrl *pctl = gpiochip_get_data(gc);
> u32 reg = STMFX_REG_GPIO_DIR + get_reg(offset);
> u32 mask = get_mask(offset);
> + int ret;
>
> - stmfx_gpio_set(gc, offset, value);
> + ret = stmfx_gpio_set(gc, offset, value);
> + if (ret)
> + return ret;
>
> return regmap_write_bits(pctl->stmfx->map, reg, mask, mask);
> }
> @@ -694,7 +697,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
> pctl->gpio_chip.direction_input = stmfx_gpio_direction_input;
> pctl->gpio_chip.direction_output = stmfx_gpio_direction_output;
> pctl->gpio_chip.get = stmfx_gpio_get;
> - pctl->gpio_chip.set = stmfx_gpio_set;
> + pctl->gpio_chip.set_rv = stmfx_gpio_set;
> pctl->gpio_chip.set_config = gpiochip_generic_config;
> pctl->gpio_chip.base = -1;
> pctl->gpio_chip.ngpio = pctl->pctl_desc.npins;
>
next prev parent reply other threads:[~2025-04-24 16:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 8:35 [PATCH 00/12] pinctrl: convert GPIO chips to using new value setters - part 2 for v6.16 Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 01/12] pinctrl: amd: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 02/12] pinctrl: axp209: " Bartosz Golaszewski
2025-04-24 17:43 ` Chen-Yu Tsai
2025-04-24 18:55 ` Bartosz Golaszewski
2025-04-29 8:35 ` Linus Walleij
2025-04-24 8:35 ` [PATCH 03/12] pinctrl: stmfx: " Bartosz Golaszewski
2025-04-24 14:59 ` Amelie Delaunay [this message]
2025-04-24 8:35 ` [PATCH 04/12] pinctrl: owl: " Bartosz Golaszewski
2025-04-28 16:07 ` Manivannan Sadhasivam
2025-04-24 8:35 ` [PATCH 05/12] pinctrl: stm32: " Bartosz Golaszewski
2025-04-24 16:04 ` [Linux-stm32] " Antonio Borneo
2025-04-24 8:35 ` [PATCH 06/12] pinctrl: ingenic: " Bartosz Golaszewski
2025-04-24 10:13 ` Paul Cercueil
2025-04-24 8:35 ` [PATCH 07/12] pinctrl: microchip-sgpio: " Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 08/12] pinctrl: at91: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 09/12] pinctrl: at91: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 10/12] pinctrl: armada-37xx: " Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 11/12] pinctrl: pistachio: " Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 12/12] pinctrl: samsung: " Bartosz Golaszewski
2025-04-27 19:17 ` (subset) " Krzysztof Kozlowski
2025-04-29 8:31 ` [PATCH 00/12] pinctrl: convert GPIO chips to using new value setters - part 2 for v6.16 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=fe3323d0-161c-498d-92e8-7a723f8d9780@foss.st.com \
--to=amelie.delaunay@foss.st.com \
--cc=Basavaraj.Natikar@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=afaerber@suse.de \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=alim.akhtar@samsung.com \
--cc=andrew@lunn.ch \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=claudiu.beznea@tuxon.dev \
--cc=daniel.machon@microchip.com \
--cc=gregory.clement@bootlin.com \
--cc=krzk@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-actions@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=ludovic.desroches@microchip.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=nicolas.ferre@microchip.com \
--cc=paul@crapouillou.net \
--cc=s.nawrocki@samsung.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=wens@csie.org \
/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).