[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<ZQ2PR01MB1307AB5E7CC4C3D7291964B1E6722@ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn>
Date: Wed, 18 Jun 2025 03:28:01 +0000
From: Hal Feng <hal.feng@...rfivetech.com>
To: Bartosz Golaszewski <brgl@...ev.pl>, Emil Renner Berthing
<kernel@...il.dk>, Jianlong Huang <jianlong.huang@...rfivetech.com>, Linus
Walleij <linus.walleij@...aro.org>
CC: "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Bartosz
Golaszewski <bartosz.golaszewski@...aro.org>
Subject: RE: [PATCH 1/2] pinctrl: starfive: jh7100: use new GPIO line value
setter callbacks
> On 12.06.25 20:25, Bartosz Golaszewski wrote:
>
> 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@...aro.org>
Reviewed-by: Hal Feng <hal.feng@...rfivetech.com>
> ---
> drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> index
> 27f99183d994dccb92aac81ca42228bdb9225e87..78952523e5b62d2653f0
> 57fdb985438beba269b6 100644
> --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> @@ -969,8 +969,8 @@ static int starfive_gpio_get(struct gpio_chip *gc,
> unsigned int gpio)
> return !!(readl_relaxed(din) & BIT(gpio % 32)); }
>
> -static void starfive_gpio_set(struct gpio_chip *gc, unsigned int gpio,
> - int value)
> +static int starfive_gpio_set(struct gpio_chip *gc, unsigned int gpio,
> + int value)
> {
> struct starfive_pinctrl *sfp = container_of(gc, struct starfive_pinctrl,
> gc);
> void __iomem *dout = sfp->base + GPON_DOUT_CFG + 8 * gpio; @@ -
> 979,6 +979,8 @@ static void starfive_gpio_set(struct gpio_chip *gc, unsigned
> int gpio,
> raw_spin_lock_irqsave(&sfp->lock, flags);
> writel_relaxed(value, dout);
> raw_spin_unlock_irqrestore(&sfp->lock, flags);
> +
> + return 0;
> }
>
> static int starfive_gpio_set_config(struct gpio_chip *gc, unsigned int gpio,
> @@ -1300,7 +1302,7 @@ static int starfive_probe(struct platform_device
> *pdev)
> sfp->gc.direction_input = starfive_gpio_direction_input;
> sfp->gc.direction_output = starfive_gpio_direction_output;
> sfp->gc.get = starfive_gpio_get;
> - sfp->gc.set = starfive_gpio_set;
> + sfp->gc.set_rv = starfive_gpio_set;
> sfp->gc.set_config = starfive_gpio_set_config;
> sfp->gc.add_pin_ranges = starfive_gpio_add_pin_ranges;
> sfp->gc.base = -1;
>
> --
> 2.48.1
Powered by blists - more mailing lists