Re: [PATCH] gpio: introduce a header for symbols shared by suppliers and consumers

From: Andy Shevchenko

Date: Mon Feb 23 2026 - 13:00:32 EST


On Mon, Feb 23, 2026 at 06:20:06PM +0100, Bartosz Golaszewski wrote:
> GPIO_LINE_DIRECTION_IN/OUT definitions are used both in supplier (GPIO
> controller drivers) as well as consumer code. In order to not force the
> consumers to include gpio/driver.h or - even worse - to redefine these
> values, create a new header file - gpio/defs.h - and move them over
> there. Include this header from both gpio/consumer.h and gpio/driver.h.

It was discussed before off the list, but I agree with the direction it goes.
Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
> ---
> Andy, Linus: I'm no longer sure who proposed it but I've had it on my
> TODO list. Please feel free to take credit below.

I believe both, I added mine above.

--
With Best Regards,
Andy Shevchenko