Skip to content

Commit

Permalink
gpio: add GPIOF_ values regardless on kconfig settings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Randy Dunlap authored and Grant Likely committed Jun 16, 2011
1 parent 158f1e9 commit c001fb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 0 additions & 10 deletions include/asm-generic/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,6 @@ extern int __gpio_cansleep(unsigned gpio);

extern int __gpio_to_irq(unsigned gpio);

#define GPIOF_DIR_OUT (0 << 0)
#define GPIOF_DIR_IN (1 << 0)

#define GPIOF_INIT_LOW (0 << 1)
#define GPIOF_INIT_HIGH (1 << 1)

#define GPIOF_IN (GPIOF_DIR_IN)
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)

/**
* struct gpio - a structure describing a GPIO with configuration
* @gpio: the GPIO number
Expand Down
11 changes: 11 additions & 0 deletions include/linux/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@

/* see Documentation/gpio.txt */

/* make these flag values available regardless of GPIO kconfig options */
#define GPIOF_DIR_OUT (0 << 0)
#define GPIOF_DIR_IN (1 << 0)

#define GPIOF_INIT_LOW (0 << 1)
#define GPIOF_INIT_HIGH (1 << 1)

#define GPIOF_IN (GPIOF_DIR_IN)
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)

#ifdef CONFIG_GENERIC_GPIO
#include <asm/gpio.h>

Expand Down

0 comments on commit c001fb7

Please sign in to comment.