diff options
Diffstat (limited to 'arch/blackfin/include/asm')
-rw-r--r-- | arch/blackfin/include/asm/gpio.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 539468a05057..91bd2d7b9d55 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h | |||
@@ -70,6 +70,8 @@ | |||
70 | 70 | ||
71 | #ifndef __ASSEMBLY__ | 71 | #ifndef __ASSEMBLY__ |
72 | 72 | ||
73 | #include <linux/compiler.h> | ||
74 | |||
73 | /*********************************************************** | 75 | /*********************************************************** |
74 | * | 76 | * |
75 | * FUNCTIONS: Blackfin General Purpose Ports Access Functions | 77 | * FUNCTIONS: Blackfin General Purpose Ports Access Functions |
@@ -223,6 +225,9 @@ int bfin_gpio_direction_output(unsigned gpio, int value); | |||
223 | int bfin_gpio_get_value(unsigned gpio); | 225 | int bfin_gpio_get_value(unsigned gpio); |
224 | void bfin_gpio_set_value(unsigned gpio, int value); | 226 | void bfin_gpio_set_value(unsigned gpio, int value); |
225 | 227 | ||
228 | #include <asm/irq.h> | ||
229 | #include <asm/errno.h> | ||
230 | |||
226 | #ifdef CONFIG_GPIOLIB | 231 | #ifdef CONFIG_GPIOLIB |
227 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | 232 | #include <asm-generic/gpio.h> /* cansleep wrappers */ |
228 | 233 | ||
@@ -247,6 +252,11 @@ static inline int gpio_cansleep(unsigned int gpio) | |||
247 | return __gpio_cansleep(gpio); | 252 | return __gpio_cansleep(gpio); |
248 | } | 253 | } |
249 | 254 | ||
255 | static inline int gpio_to_irq(unsigned gpio) | ||
256 | { | ||
257 | return __gpio_to_irq(gpio); | ||
258 | } | ||
259 | |||
250 | #else /* !CONFIG_GPIOLIB */ | 260 | #else /* !CONFIG_GPIOLIB */ |
251 | 261 | ||
252 | static inline int gpio_request(unsigned gpio, const char *label) | 262 | static inline int gpio_request(unsigned gpio, const char *label) |
@@ -279,10 +289,6 @@ static inline void gpio_set_value(unsigned gpio, int value) | |||
279 | return bfin_gpio_set_value(gpio, value); | 289 | return bfin_gpio_set_value(gpio, value); |
280 | } | 290 | } |
281 | 291 | ||
282 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
283 | #endif /* !CONFIG_GPIOLIB */ | ||
284 | #include <asm/irq.h> | ||
285 | |||
286 | static inline int gpio_to_irq(unsigned gpio) | 292 | static inline int gpio_to_irq(unsigned gpio) |
287 | { | 293 | { |
288 | if (likely(gpio < MAX_BLACKFIN_GPIOS)) | 294 | if (likely(gpio < MAX_BLACKFIN_GPIOS)) |
@@ -291,6 +297,9 @@ static inline int gpio_to_irq(unsigned gpio) | |||
291 | return -EINVAL; | 297 | return -EINVAL; |
292 | } | 298 | } |
293 | 299 | ||
300 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
301 | #endif /* !CONFIG_GPIOLIB */ | ||
302 | |||
294 | static inline int irq_to_gpio(unsigned irq) | 303 | static inline int irq_to_gpio(unsigned irq) |
295 | { | 304 | { |
296 | return (irq - GPIO_IRQ_BASE); | 305 | return (irq - GPIO_IRQ_BASE); |