diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/asm-generic/gpio.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'include/asm-generic/gpio.h')
-rw-r--r-- | include/asm-generic/gpio.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 8ca18e26d7e3..d494001b1226 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -35,9 +35,9 @@ | |||
35 | * platform data and other tables. | 35 | * platform data and other tables. |
36 | */ | 36 | */ |
37 | 37 | ||
38 | static inline int gpio_is_valid(int number) | 38 | static inline bool gpio_is_valid(int number) |
39 | { | 39 | { |
40 | return ((unsigned)number) < ARCH_NR_GPIOS; | 40 | return number >= 0 && number < ARCH_NR_GPIOS; |
41 | } | 41 | } |
42 | 42 | ||
43 | struct device; | 43 | struct device; |
@@ -170,16 +170,6 @@ extern int __gpio_cansleep(unsigned gpio); | |||
170 | 170 | ||
171 | extern int __gpio_to_irq(unsigned gpio); | 171 | extern int __gpio_to_irq(unsigned gpio); |
172 | 172 | ||
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 | |||
183 | /** | 173 | /** |
184 | * struct gpio - a structure describing a GPIO with configuration | 174 | * struct gpio - a structure describing a GPIO with configuration |
185 | * @gpio: the GPIO number | 175 | * @gpio: the GPIO number |
@@ -193,8 +183,8 @@ struct gpio { | |||
193 | }; | 183 | }; |
194 | 184 | ||
195 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | 185 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); |
196 | extern int gpio_request_array(struct gpio *array, size_t num); | 186 | extern int gpio_request_array(const struct gpio *array, size_t num); |
197 | extern void gpio_free_array(struct gpio *array, size_t num); | 187 | extern void gpio_free_array(const struct gpio *array, size_t num); |
198 | 188 | ||
199 | #ifdef CONFIG_GPIO_SYSFS | 189 | #ifdef CONFIG_GPIO_SYSFS |
200 | 190 | ||
@@ -210,9 +200,9 @@ extern void gpio_unexport(unsigned gpio); | |||
210 | 200 | ||
211 | #endif /* CONFIG_GPIO_SYSFS */ | 201 | #endif /* CONFIG_GPIO_SYSFS */ |
212 | 202 | ||
213 | #else /* !CONFIG_HAVE_GPIO_LIB */ | 203 | #else /* !CONFIG_GPIOLIB */ |
214 | 204 | ||
215 | static inline int gpio_is_valid(int number) | 205 | static inline bool gpio_is_valid(int number) |
216 | { | 206 | { |
217 | /* only non-negative numbers are valid */ | 207 | /* only non-negative numbers are valid */ |
218 | return number >= 0; | 208 | return number >= 0; |
@@ -239,7 +229,7 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) | |||
239 | gpio_set_value(gpio, value); | 229 | gpio_set_value(gpio, value); |
240 | } | 230 | } |
241 | 231 | ||
242 | #endif /* !CONFIG_HAVE_GPIO_LIB */ | 232 | #endif /* !CONFIG_GPIOLIB */ |
243 | 233 | ||
244 | #ifndef CONFIG_GPIO_SYSFS | 234 | #ifndef CONFIG_GPIO_SYSFS |
245 | 235 | ||