aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r--include/linux/gpio.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index e41f7dd1ae67..17b5a0d80e42 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -3,6 +3,17 @@
3 3
4/* see Documentation/gpio.txt */ 4/* see Documentation/gpio.txt */
5 5
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
6#ifdef CONFIG_GENERIC_GPIO 17#ifdef CONFIG_GENERIC_GPIO
7#include <asm/gpio.h> 18#include <asm/gpio.h>
8 19
@@ -13,6 +24,7 @@
13#include <linux/errno.h> 24#include <linux/errno.h>
14 25
15struct device; 26struct device;
27struct gpio;
16struct gpio_chip; 28struct gpio_chip;
17 29
18/* 30/*
@@ -24,9 +36,9 @@ struct gpio_chip;
24 * warning when something is wrongly called. 36 * warning when something is wrongly called.
25 */ 37 */
26 38
27static inline int gpio_is_valid(int number) 39static inline bool gpio_is_valid(int number)
28{ 40{
29 return 0; 41 return false;
30} 42}
31 43
32static inline int gpio_request(unsigned gpio, const char *label) 44static inline int gpio_request(unsigned gpio, const char *label)
@@ -34,6 +46,17 @@ static inline int gpio_request(unsigned gpio, const char *label)
34 return -ENOSYS; 46 return -ENOSYS;
35} 47}
36 48
49static inline int gpio_request_one(unsigned gpio,
50 unsigned long flags, const char *label)
51{
52 return -ENOSYS;
53}
54
55static inline int gpio_request_array(const struct gpio *array, size_t num)
56{
57 return -ENOSYS;
58}
59
37static inline void gpio_free(unsigned gpio) 60static inline void gpio_free(unsigned gpio)
38{ 61{
39 might_sleep(); 62 might_sleep();
@@ -42,6 +65,14 @@ static inline void gpio_free(unsigned gpio)
42 WARN_ON(1); 65 WARN_ON(1);
43} 66}
44 67
68static inline void gpio_free_array(const struct gpio *array, size_t num)
69{
70 might_sleep();
71
72 /* GPIO can never have been requested */
73 WARN_ON(1);
74}
75
45static inline int gpio_direction_input(unsigned gpio) 76static inline int gpio_direction_input(unsigned gpio)
46{ 77{
47 return -ENOSYS; 78 return -ENOSYS;