[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdb7PZTx8WPQP8Jrj_sR8X2ejK3OgA+9v2PUaOcTM4NnrQ@mail.gmail.com>
Date: Thu, 21 Aug 2025 18:40:03 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Marcos Del Sol Vives <marcos@...a.pet>
Cc: linux-kernel@...r.kernel.org, Bartosz Golaszewski <brgl@...ev.pl>,
Michael Walle <mwalle@...nel.org>, Lee Jones <lee@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
linux-gpio@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
On Thu, Aug 21, 2025 at 12:19 PM Marcos Del Sol Vives <marcos@...a.pet> wrote:
> static int gpio_regmap_direction_output(struct gpio_chip *chip,
> unsigned int offset, int value)
> {
> - gpio_regmap_set(chip, offset, value);
> + struct gpio_regmap *gpio = gpiochip_get_data(chip);
> + int ret;
> +
> + if (gpio->flags & GPIO_REGMAP_DIR_BEFORE_SET) {
> + ret = gpio_regmap_set_direction(chip, offset, true);
> + if (ret)
> + return ret;
> +
> + return gpio_regmap_set(chip, offset, value);
> + }
> +
> + ret = gpio_regmap_set(chip, offset, value);
> + if (ret)
> + return ret;
>
> return gpio_regmap_set_direction(chip, offset, true);
I guess this looks like this because it is just copied from
gpio-mmio.c:
static int bgpio_simple_dir_out(struct gpio_chip *gc, unsigned int gpio,
int val)
{
gc->set(gc, gpio, val);
return bgpio_dir_return(gc, gpio, true);
}
It's hard to know which semantic to employ here, it's one
way or the other.
I like the new flag.
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
You can merge this with the rest of the series.
Yours,
Linus Walleij
Powered by blists - more mailing lists