Commit fa4a3a95 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpio: introduce a header for symbols shared by suppliers and consumers



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.

Reviewed-by: default avatarLinus Walleij <linusw@kernel.org>
Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260223172006.204268-1-bartosz.golaszewski@oss.qualcomm.com


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
parent b2d51bc1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@
#include <linux/err.h>
#include <linux/types.h>

#include "defs.h"

struct acpi_device;
struct device;
struct fwnode_handle;
+9 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */

#ifndef __LINUX_GPIO_DEFS_H
#define __LINUX_GPIO_DEFS_H

#define GPIO_LINE_DIRECTION_IN		1
#define GPIO_LINE_DIRECTION_OUT		0

#endif /* __LINUX_GPIO_DEFS_H */
+2 −3
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <asm/msi.h>
#endif

#include "defs.h"

struct device;
struct irq_chip;
struct irq_data;
@@ -42,9 +44,6 @@ union gpio_irq_fwspec {
#endif
};

#define GPIO_LINE_DIRECTION_IN	1
#define GPIO_LINE_DIRECTION_OUT	0

/**
 * struct gpio_irq_chip - GPIO interrupt controller
 */