Thread (87 messages) 87 messages, 9 authors, 2024-01-24

Re: [PATCH 07/21] gpiolib: provide gpio_device_get_base()

From: Bartosz Golaszewski <hidden>
Date: 2023-09-07 17:00:37
Also in: linux-acpi, linux-gpio, linux-omap, linux-tegra, lkml, platform-driver-x86

On Thu, Sep 7, 2023 at 9:17 AM Linus Walleij [off-list ref] wrote:
On Tue, Sep 5, 2023 at 8:53 PM Bartosz Golaszewski [off-list ref] wrote:
quoted
From: Bartosz Golaszewski <redacted>

Let's start adding getters for the opaque struct gpio_device. Start with
a function allowing to retrieve the base GPIO number.

Signed-off-by: Bartosz Golaszewski <redacted>
I guess you have a solid usecase for drivers needing to do this
crazy thing, because I suppose you feel as much as me that
this should rather be gpiolib-internal and confined to
drivers/gpio/gpiolib.h?

If you add a valid reason for making this globally visible outside
of drivers/[gpio|pinctrl] to the commit message I guess I can live
with it because we need to think of the bigger picture:
Acked-by: Linus Walleij <redacted>

It brings to mind the now confusing "base" inside of
struct gpio_chip. We all know it should go away, but since it
is never used during the lifetime of the gpio_chip - or SHOULD
never be used - it should rather be an argument to
[devm_]gpiochip_add_data( .... int base);...

Maybe something we should add to our TODO file.

Yours,
Linus Walleij
For this series it's the HTE driver that uses it and I don't have a
good idea about how to change it. Dipen?

I would also love to make pinctrl not use the internal GPIOLIB header
so it'll be another user, unless you can figure out a way to not use
gc->base? :)

I think we're stuck with it for now.

Bart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help