Skip to content

Commit c001fb7

Browse files
rddunlapglikely
authored andcommitted
gpio: add GPIOF_ values regardless on kconfig settings
Make GPIOF_ defined values available even when GPIOLIB nor GENERIC_GPIO is enabled by moving them to <linux/gpio.h>. Fixes these build errors in linux-next: sound/soc/codecs/ak4641.c:524: error: 'GPIOF_OUT_INIT_LOW' undeclared (first use in this function) sound/soc/codecs/wm8915.c:2921: error: 'GPIOF_OUT_INIT_LOW' undeclared (first use in this function) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
1 parent 158f1e9 commit c001fb7

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

include/asm-generic/gpio.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,6 @@ extern int __gpio_cansleep(unsigned gpio);
170170

171171
extern int __gpio_to_irq(unsigned gpio);
172172

173-
#define GPIOF_DIR_OUT (0 << 0)
174-
#define GPIOF_DIR_IN (1 << 0)
175-
176-
#define GPIOF_INIT_LOW (0 << 1)
177-
#define GPIOF_INIT_HIGH (1 << 1)
178-
179-
#define GPIOF_IN (GPIOF_DIR_IN)
180-
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
181-
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
182-
183173
/**
184174
* struct gpio - a structure describing a GPIO with configuration
185175
* @gpio: the GPIO number

include/linux/gpio.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33

44
/* see Documentation/gpio.txt */
55

6+
/* make these flag values available regardless of GPIO kconfig options */
7+
#define GPIOF_DIR_OUT (0 << 0)
8+
#define GPIOF_DIR_IN (1 << 0)
9+
10+
#define GPIOF_INIT_LOW (0 << 1)
11+
#define GPIOF_INIT_HIGH (1 << 1)
12+
13+
#define GPIOF_IN (GPIOF_DIR_IN)
14+
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
15+
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
16+
617
#ifdef CONFIG_GENERIC_GPIO
718
#include <asm/gpio.h>
819

0 commit comments

Comments
 (0)