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.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 32720baf70f1..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
@@ -25,9 +36,9 @@ struct gpio_chip;
25 * warning when something is wrongly called. 36 * warning when something is wrongly called.
26 */ 37 */
27 38
28static inline int gpio_is_valid(int number) 39static inline bool gpio_is_valid(int number)
29{ 40{
30 return 0; 41 return false;
31} 42}
32 43
33static inline int gpio_request(unsigned gpio, const char *label) 44static inline int gpio_request(unsigned gpio, const char *label)
@@ -41,7 +52,7 @@ static inline int gpio_request_one(unsigned gpio,
41 return -ENOSYS; 52 return -ENOSYS;
42} 53}
43 54
44static inline int gpio_request_array(struct gpio *array, size_t num) 55static inline int gpio_request_array(const struct gpio *array, size_t num)
45{ 56{
46 return -ENOSYS; 57 return -ENOSYS;
47} 58}
@@ -54,7 +65,7 @@ static inline void gpio_free(unsigned gpio)
54 WARN_ON(1); 65 WARN_ON(1);
55} 66}
56 67
57static inline void gpio_free_array(struct gpio *array, size_t num) 68static inline void gpio_free_array(const struct gpio *array, size_t num)
58{ 69{
59 might_sleep(); 70 might_sleep();
60 71