[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdLwSoPpmDm1j=d9kLWzzfGsHCVvMSX-9wD+sgRzHC9oA@mail.gmail.com>
Date: Tue, 18 May 2021 13:39:22 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Michael Walle <michael@...le.cc>,
Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: Sander Vanheule <sander@...nheule.net>,
Pavel Machek <pavel@....cz>, Rob Herring <robh+dt@...nel.org>,
Lee Jones <lee.jones@...aro.org>,
Mark Brown <broonie@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Linux LED Subsystem <linux-leds@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Andrew Lunn <andrew@...n.ch>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/7] gpio: regmap: Add configurable dir/value order
+Matti
On Tue, May 18, 2021 at 11:39 AM Michael Walle <michael@...le.cc> wrote:
> Am 2021-05-17 21:28, schrieb Sander Vanheule:
...
> Instead of adding a new one, we can also just check no_set_on_input
> in gpio_regmap_direction_output(), which I'd prefer.
+! here.
> static int gpio_regmap_direction_output(struct gpio_chip *chip,
> unsigned int offset, int value)
> {
> struct gpio_regmap *gpio = gpiochip_get_data(chip);
> int ret;
>
> if (gpio->no_set_on_input) {
> /* some smart comment here, also mention gliches */
> ret = gpio_regmap_set_direction(chip, offset, true);
> gpio_regmap_set(chip, offset, value);
> } else {
> gpio_regmap_set(chip, offset, value);
> ret = gpio_regmap_set_direction(chip, offset, true);
> }
>
> return ret;
> }
...
> > + * @no_set_on_input: Set if output value can only be set when the
> > direction
> > + * is configured as output.
>
> set_direction_first ?
Perhaps we need to establish rather something like
/* Broken hardware can't set value on input pin, we have to set it to
output first */
#define GPIO_REGMAP_QUIRK_... BIT(0)
unsigned int quirks;
?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists