Commit | Line | Data |
---|---|---|
dfc5ed2a MB |
1 | /* |
2 | * include/asm-sh/gpio.h | |
3 | * | |
2967dab1 | 4 | * Generic GPIO API and pinmux table support for SuperH. |
dfc5ed2a | 5 | * |
2967dab1 | 6 | * Copyright (c) 2008 Magnus Damm |
dfc5ed2a MB |
7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | |
9 | * License. See the file "COPYING" in the main directory of this archive | |
10 | * for more details. | |
11 | */ | |
12 | #ifndef __ASM_SH_GPIO_H | |
13 | #define __ASM_SH_GPIO_H | |
14 | ||
e4b41dbd | 15 | #include <linux/kernel.h> |
55010937 PM |
16 | #include <linux/errno.h> |
17 | ||
dfc5ed2a | 18 | #if defined(CONFIG_CPU_SH3) |
f15cbe6f | 19 | #include <cpu/gpio.h> |
dfc5ed2a MB |
20 | #endif |
21 | ||
69edbba0 | 22 | #define ARCH_NR_GPIOS 512 |
e854547b | 23 | #include <asm-generic/gpio.h> |
69edbba0 MD |
24 | |
25 | #ifdef CONFIG_GPIOLIB | |
26 | ||
27 | static inline int gpio_get_value(unsigned gpio) | |
28 | { | |
29 | return __gpio_get_value(gpio); | |
30 | } | |
31 | ||
32 | static inline void gpio_set_value(unsigned gpio, int value) | |
33 | { | |
34 | __gpio_set_value(gpio, value); | |
35 | } | |
36 | ||
37 | static inline int gpio_cansleep(unsigned gpio) | |
38 | { | |
39 | return __gpio_cansleep(gpio); | |
40 | } | |
41 | ||
42 | static inline int gpio_to_irq(unsigned gpio) | |
43 | { | |
532f3759 | 44 | return __gpio_to_irq(gpio); |
69edbba0 MD |
45 | } |
46 | ||
47 | static inline int irq_to_gpio(unsigned int irq) | |
48 | { | |
532f3759 | 49 | return -ENOSYS; |
69edbba0 MD |
50 | } |
51 | ||
52 | #endif /* CONFIG_GPIOLIB */ | |
53 | ||
dfc5ed2a | 54 | #endif /* __ASM_SH_GPIO_H */ |