[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdacYt4kS2QS4-W83ZtWWtTaAETeH8Buer2wOXBOoBK=qA@mail.gmail.com>
Date: Tue, 9 Nov 2021 23:17:34 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
Bartosz Golaszewski <brgl@...ev.pl>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 5/8] gpiolib: shrink further
On Tue, Nov 9, 2021 at 12:18 PM Arnd Bergmann <arnd@...nel.org> wrote:
> Ideally we should only use linux/gpio/consumer.h, which is required for
> gpiod_set_debounce(). of_gpio.h is still needed for of_get_named_gpio()
> and should be taken out once we change this to gpiod_get(), while
> linux/gpio.h is still needed for gpio_is_valid()/gpio_get_value() and should
> be removed when those are changed to the gpiod_ versions.
>
> We could do an intermediate patch that converts one half of the
> interface, something like
When I convert stuff I try to go all the way when I can. It can
be a bit daring if no one is there to test changes.
The patch looks good though apart from:
> - ts->gpio_pendown = pdata->gpio_pendown;
> + ts->gpio_pendown = gpio_to_desc(pdata->gpio_pendown);
I usually even go into the defined platform data and try to convert
the boardfile to use a descriptor table so this is never needed.
(But, more work.)
Examples:
git log -p --author=Walleij arch/arm/mach-pxa/
> - pdata->gpio_pendown = of_get_named_gpio(dev->of_node,
> "pendown-gpio", 0);
> + ts->gpio_pendown = gpiod_get(dev, "pendown-gpio", GPIOD_IN);
Needs to be just gpiod_get(dev, "pendown", GPIOD_IN); the new
API tries the "-gpio[s]" suffixes when going into the device tree.
Yours,
Linus Walleij
Powered by blists - more mailing lists