diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-07-26 06:04:51 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-08-12 03:53:15 -0400 |
commit | 22fe67837614469f8e86c97e9e43d46270701b33 (patch) | |
tree | 8823ecf3f60aa0c40b9e2d997875d565445261fa /arch | |
parent | 50ac01fbd29ba208d0cd4cb9467d3ffc07ae834a (diff) |
ARM: gpio: consolidate trivial gpiolib implementations
Consolidate 24 trivial gpiolib implementions out of mach/gpio.h
into asm/gpio.h. This is basically the include of asm-generic/gpio.h
and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep
as described in Documentation/gpio.txt
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: David Brown <davidb@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
25 files changed, 37 insertions, 150 deletions
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h index 166a7a3e2840..15e8970f20f4 100644 --- a/arch/arm/include/asm/gpio.h +++ b/arch/arm/include/asm/gpio.h | |||
@@ -4,4 +4,14 @@ | |||
4 | /* not all ARM platforms necessarily support this API ... */ | 4 | /* not all ARM platforms necessarily support this API ... */ |
5 | #include <mach/gpio.h> | 5 | #include <mach/gpio.h> |
6 | 6 | ||
7 | #ifdef __ARM_GPIOLIB_TRIVIAL | ||
8 | /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ | ||
9 | #include <asm-generic/gpio.h> | ||
10 | |||
11 | /* The trivial gpiolib dispatchers */ | ||
12 | #define gpio_get_value __gpio_get_value | ||
13 | #define gpio_set_value __gpio_set_value | ||
14 | #define gpio_cansleep __gpio_cansleep | ||
15 | #endif | ||
16 | |||
7 | #endif /* _ARCH_ARM_GPIO_H */ | 17 | #endif /* _ARCH_ARM_GPIO_H */ |
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h index 056dc6674b6b..6ddc1a628b7e 100644 --- a/arch/arm/mach-at91/include/mach/gpio.h +++ b/arch/arm/mach-at91/include/mach/gpio.h | |||
@@ -214,11 +214,8 @@ extern void at91_gpio_resume(void); | |||
214 | */ | 214 | */ |
215 | 215 | ||
216 | #include <asm/errno.h> | 216 | #include <asm/errno.h> |
217 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
218 | 217 | ||
219 | #define gpio_get_value __gpio_get_value | 218 | #define __ARM_GPIOLIB_TRIVIAL |
220 | #define gpio_set_value __gpio_set_value | ||
221 | #define gpio_cansleep __gpio_cansleep | ||
222 | 219 | ||
223 | #define gpio_to_irq(gpio) (gpio) | 220 | #define gpio_to_irq(gpio) (gpio) |
224 | #define irq_to_gpio(irq) (irq) | 221 | #define irq_to_gpio(irq) (irq) |
diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h index c57152c231f1..fbc770e3e0cf 100644 --- a/arch/arm/mach-ep93xx/include/mach/gpio.h +++ b/arch/arm/mach-ep93xx/include/mach/gpio.h | |||
@@ -100,12 +100,7 @@ | |||
100 | #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) | 100 | #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) |
101 | 101 | ||
102 | /* new generic GPIO API - see Documentation/gpio.txt */ | 102 | /* new generic GPIO API - see Documentation/gpio.txt */ |
103 | 103 | #define __ARM_GPIOLIB_TRIVIAL | |
104 | #include <asm-generic/gpio.h> | ||
105 | |||
106 | #define gpio_get_value __gpio_get_value | ||
107 | #define gpio_set_value __gpio_set_value | ||
108 | #define gpio_cansleep __gpio_cansleep | ||
109 | 104 | ||
110 | /* | 105 | /* |
111 | * Map GPIO A0..A7 (0..7) to irq 64..71, | 106 | * Map GPIO A0..A7 (0..7) to irq 64..71, |
diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h index be9266b10fdb..b2e3595ae943 100644 --- a/arch/arm/mach-exynos4/include/mach/gpio.h +++ b/arch/arm/mach-exynos4/include/mach/gpio.h | |||
@@ -13,9 +13,6 @@ | |||
13 | #ifndef __ASM_ARCH_GPIO_H | 13 | #ifndef __ASM_ARCH_GPIO_H |
14 | #define __ASM_ARCH_GPIO_H __FILE__ | 14 | #define __ASM_ARCH_GPIO_H __FILE__ |
15 | 15 | ||
16 | #define gpio_get_value __gpio_get_value | ||
17 | #define gpio_set_value __gpio_set_value | ||
18 | #define gpio_cansleep __gpio_cansleep | ||
19 | #define gpio_to_irq __gpio_to_irq | 16 | #define gpio_to_irq __gpio_to_irq |
20 | 17 | ||
21 | /* Practically, GPIO banks up to GPZ are the configurable gpio banks */ | 18 | /* Practically, GPIO banks up to GPZ are the configurable gpio banks */ |
@@ -151,6 +148,6 @@ enum s5p_gpio_number { | |||
151 | #define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \ | 148 | #define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \ |
152 | CONFIG_SAMSUNG_GPIO_EXTRA + 1) | 149 | CONFIG_SAMSUNG_GPIO_EXTRA + 1) |
153 | 150 | ||
154 | #include <asm-generic/gpio.h> | 151 | #define __ARM_GPIOLIB_TRIVIAL |
155 | 152 | ||
156 | #endif /* __ASM_ARCH_GPIO_H */ | 153 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-gemini/include/mach/gpio.h b/arch/arm/mach-gemini/include/mach/gpio.h index 3bc2c70f2989..20c0a3623779 100644 --- a/arch/arm/mach-gemini/include/mach/gpio.h +++ b/arch/arm/mach-gemini/include/mach/gpio.h | |||
@@ -13,11 +13,8 @@ | |||
13 | #define __MACH_GPIO_H__ | 13 | #define __MACH_GPIO_H__ |
14 | 14 | ||
15 | #include <mach/irqs.h> | 15 | #include <mach/irqs.h> |
16 | #include <asm-generic/gpio.h> | ||
17 | 16 | ||
18 | #define gpio_get_value __gpio_get_value | 17 | #define __ARM_GPIOLIB_TRIVIAL |
19 | #define gpio_set_value __gpio_set_value | ||
20 | #define gpio_cansleep __gpio_cansleep | ||
21 | 18 | ||
22 | #define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE) | 19 | #define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE) |
23 | #define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE) | 20 | #define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE) |
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 86312d476bc6..c13952c22a39 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h | |||
@@ -40,17 +40,10 @@ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); | |||
40 | */ | 40 | */ |
41 | extern int irq_to_gpio(unsigned int irq); | 41 | extern int irq_to_gpio(unsigned int irq); |
42 | 42 | ||
43 | #include <asm-generic/gpio.h> | ||
44 | |||
45 | /* If it turns out that we need to optimise GPIO access for the | ||
46 | * Micrel's GPIOs, then these can be changed to check their argument | ||
47 | * directly as static inlines. However for now it's probably not | ||
48 | * worthwhile. | ||
49 | */ | ||
50 | #define gpio_get_value __gpio_get_value | ||
51 | #define gpio_set_value __gpio_set_value | ||
52 | #define gpio_to_irq __gpio_to_irq | 43 | #define gpio_to_irq __gpio_to_irq |
53 | 44 | ||
45 | #define __ARM_GPIOLIB_TRIVIAL | ||
46 | |||
54 | /* Register the GPIOs */ | 47 | /* Register the GPIOs */ |
55 | extern void ks8695_register_gpios(void); | 48 | extern void ks8695_register_gpios(void); |
56 | 49 | ||
diff --git a/arch/arm/mach-lpc32xx/include/mach/gpio.h b/arch/arm/mach-lpc32xx/include/mach/gpio.h index 67d03da1eee9..0ca6c2778aa7 100644 --- a/arch/arm/mach-lpc32xx/include/mach/gpio.h +++ b/arch/arm/mach-lpc32xx/include/mach/gpio.h | |||
@@ -19,8 +19,6 @@ | |||
19 | #ifndef __ASM_ARCH_GPIO_H | 19 | #ifndef __ASM_ARCH_GPIO_H |
20 | #define __ASM_ARCH_GPIO_H | 20 | #define __ASM_ARCH_GPIO_H |
21 | 21 | ||
22 | #include <asm-generic/gpio.h> | ||
23 | |||
24 | /* | 22 | /* |
25 | * Note! | 23 | * Note! |
26 | * Muxed GP pins need to be setup to the GP state in the board level | 24 | * Muxed GP pins need to be setup to the GP state in the board level |
@@ -51,20 +49,7 @@ | |||
51 | */ | 49 | */ |
52 | #define LPC32XX_GPIO(x, y) ((x) + (y)) | 50 | #define LPC32XX_GPIO(x, y) ((x) + (y)) |
53 | 51 | ||
54 | static inline int gpio_get_value(unsigned gpio) | 52 | #define __ARM_GPIOLIB_TRIVIAL |
55 | { | ||
56 | return __gpio_get_value(gpio); | ||
57 | } | ||
58 | |||
59 | static inline void gpio_set_value(unsigned gpio, int value) | ||
60 | { | ||
61 | __gpio_set_value(gpio, value); | ||
62 | } | ||
63 | |||
64 | static inline int gpio_cansleep(unsigned gpio) | ||
65 | { | ||
66 | return __gpio_cansleep(gpio); | ||
67 | } | ||
68 | 53 | ||
69 | static inline int gpio_to_irq(unsigned gpio) | 54 | static inline int gpio_to_irq(unsigned gpio) |
70 | { | 55 | { |
diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h index 36ad50d3bfaa..bc75e2041144 100644 --- a/arch/arm/mach-msm/include/mach/gpio.h +++ b/arch/arm/mach-msm/include/mach/gpio.h | |||
@@ -16,11 +16,8 @@ | |||
16 | #ifndef __ASM_ARCH_MSM_GPIO_H | 16 | #ifndef __ASM_ARCH_MSM_GPIO_H |
17 | #define __ASM_ARCH_MSM_GPIO_H | 17 | #define __ASM_ARCH_MSM_GPIO_H |
18 | 18 | ||
19 | #include <asm-generic/gpio.h> | 19 | #define __ARM_GPIOLIB_TRIVIAL |
20 | 20 | ||
21 | #define gpio_get_value __gpio_get_value | ||
22 | #define gpio_set_value __gpio_set_value | ||
23 | #define gpio_cansleep __gpio_cansleep | ||
24 | #define gpio_to_irq __gpio_to_irq | 21 | #define gpio_to_irq __gpio_to_irq |
25 | 22 | ||
26 | #endif /* __ASM_ARCH_MSM_GPIO_H */ | 23 | #endif /* __ASM_ARCH_MSM_GPIO_H */ |
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h index 828ccccb6aad..bb44c8dcf31c 100644 --- a/arch/arm/mach-mxs/include/mach/gpio.h +++ b/arch/arm/mach-mxs/include/mach/gpio.h | |||
@@ -20,14 +20,10 @@ | |||
20 | #ifndef __MACH_MXS_GPIO_H__ | 20 | #ifndef __MACH_MXS_GPIO_H__ |
21 | #define __MACH_MXS_GPIO_H__ | 21 | #define __MACH_MXS_GPIO_H__ |
22 | 22 | ||
23 | #include <asm-generic/gpio.h> | ||
24 | |||
25 | #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) | 23 | #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) |
26 | 24 | ||
27 | /* use gpiolib dispatchers */ | 25 | /* use gpiolib dispatchers */ |
28 | #define gpio_get_value __gpio_get_value | 26 | #define __ARM_GPIOLIB_TRIVIAL |
29 | #define gpio_set_value __gpio_set_value | ||
30 | #define gpio_cansleep __gpio_cansleep | ||
31 | #define gpio_to_irq __gpio_to_irq | 27 | #define gpio_to_irq __gpio_to_irq |
32 | 28 | ||
33 | #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) | 29 | #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) |
diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h index 94ff27678a46..bd11dc503cce 100644 --- a/arch/arm/mach-realview/include/mach/gpio.h +++ b/arch/arm/mach-realview/include/mach/gpio.h | |||
@@ -1,6 +1,2 @@ | |||
1 | #include <asm-generic/gpio.h> | 1 | #define __ARM_GPIOLIB_TRIVIAL |
2 | |||
3 | #define gpio_get_value __gpio_get_value | ||
4 | #define gpio_set_value __gpio_set_value | ||
5 | #define gpio_cansleep __gpio_cansleep | ||
6 | #define gpio_to_irq __gpio_to_irq | 2 | #define gpio_to_irq __gpio_to_irq |
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h index f7f6b07df30e..998ef4c41de8 100644 --- a/arch/arm/mach-s3c2410/include/mach/gpio.h +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h | |||
@@ -11,9 +11,7 @@ | |||
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define gpio_get_value __gpio_get_value | 14 | #define __ARM_GPIOLIB_TRIVIAL |
15 | #define gpio_set_value __gpio_set_value | ||
16 | #define gpio_cansleep __gpio_cansleep | ||
17 | #define gpio_to_irq __gpio_to_irq | 15 | #define gpio_to_irq __gpio_to_irq |
18 | 16 | ||
19 | /* some boards require extra gpio capacity to support external | 17 | /* some boards require extra gpio capacity to support external |
@@ -28,7 +26,6 @@ | |||
28 | #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) | 26 | #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) |
29 | #endif | 27 | #endif |
30 | 28 | ||
31 | #include <asm-generic/gpio.h> | ||
32 | #include <mach/gpio-nrs.h> | 29 | #include <mach/gpio-nrs.h> |
33 | #include <mach/gpio-fns.h> | 30 | #include <mach/gpio-fns.h> |
34 | 31 | ||
diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h index 0d46e994048a..6958b3fe5255 100644 --- a/arch/arm/mach-s3c64xx/include/mach/gpio.h +++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h | |||
@@ -12,9 +12,7 @@ | |||
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define gpio_get_value __gpio_get_value | 15 | #define __ARM_GPIOLIB_TRIVIAL |
16 | #define gpio_set_value __gpio_set_value | ||
17 | #define gpio_cansleep __gpio_cansleep | ||
18 | #define gpio_to_irq __gpio_to_irq | 16 | #define gpio_to_irq __gpio_to_irq |
19 | 17 | ||
20 | /* GPIO bank sizes */ | 18 | /* GPIO bank sizes */ |
@@ -96,5 +94,3 @@ enum s3c_gpio_number { | |||
96 | #define BOARD_NR_GPIOS 16 | 94 | #define BOARD_NR_GPIOS 16 |
97 | 95 | ||
98 | #define ARCH_NR_GPIOS (GPIO_BOARD_START + BOARD_NR_GPIOS) | 96 | #define ARCH_NR_GPIOS (GPIO_BOARD_START + BOARD_NR_GPIOS) |
99 | |||
100 | #include <asm-generic/gpio.h> | ||
diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-s5p64x0/include/mach/gpio.h index adb5f298ead8..a25160b426dd 100644 --- a/arch/arm/mach-s5p64x0/include/mach/gpio.h +++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h | |||
@@ -13,9 +13,7 @@ | |||
13 | #ifndef __ASM_ARCH_GPIO_H | 13 | #ifndef __ASM_ARCH_GPIO_H |
14 | #define __ASM_ARCH_GPIO_H __FILE__ | 14 | #define __ASM_ARCH_GPIO_H __FILE__ |
15 | 15 | ||
16 | #define gpio_get_value __gpio_get_value | 16 | #define __ARM_GPIOLIB_TRIVIAL |
17 | #define gpio_set_value __gpio_set_value | ||
18 | #define gpio_cansleep __gpio_cansleep | ||
19 | #define gpio_to_irq __gpio_to_irq | 17 | #define gpio_to_irq __gpio_to_irq |
20 | 18 | ||
21 | /* GPIO bank sizes */ | 19 | /* GPIO bank sizes */ |
@@ -134,6 +132,4 @@ enum s5p6450_gpio_number { | |||
134 | 132 | ||
135 | #define ARCH_NR_GPIOS (S5P64X0_GPIO_END + CONFIG_SAMSUNG_GPIO_EXTRA) | 133 | #define ARCH_NR_GPIOS (S5P64X0_GPIO_END + CONFIG_SAMSUNG_GPIO_EXTRA) |
136 | 134 | ||
137 | #include <asm-generic/gpio.h> | ||
138 | |||
139 | #endif /* __ASM_ARCH_GPIO_H */ | 135 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h index 29a8a12d9b4f..f515bfb964a6 100644 --- a/arch/arm/mach-s5pc100/include/mach/gpio.h +++ b/arch/arm/mach-s5pc100/include/mach/gpio.h | |||
@@ -15,9 +15,7 @@ | |||
15 | #ifndef __ASM_ARCH_GPIO_H | 15 | #ifndef __ASM_ARCH_GPIO_H |
16 | #define __ASM_ARCH_GPIO_H __FILE__ | 16 | #define __ASM_ARCH_GPIO_H __FILE__ |
17 | 17 | ||
18 | #define gpio_get_value __gpio_get_value | 18 | #define __ARM_GPIOLIB_TRIVIAL |
19 | #define gpio_set_value __gpio_set_value | ||
20 | #define gpio_cansleep __gpio_cansleep | ||
21 | #define gpio_to_irq __gpio_to_irq | 19 | #define gpio_to_irq __gpio_to_irq |
22 | 20 | ||
23 | /* GPIO bank sizes */ | 21 | /* GPIO bank sizes */ |
@@ -146,6 +144,4 @@ enum s5p_gpio_number { | |||
146 | /* define the number of gpios we need to the one after the MP04() range */ | 144 | /* define the number of gpios we need to the one after the MP04() range */ |
147 | #define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1) | 145 | #define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1) |
148 | 146 | ||
149 | #include <asm-generic/gpio.h> | ||
150 | |||
151 | #endif /* __ASM_ARCH_GPIO_H */ | 147 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h index a5a1e331f8ed..27f2139df311 100644 --- a/arch/arm/mach-s5pv210/include/mach/gpio.h +++ b/arch/arm/mach-s5pv210/include/mach/gpio.h | |||
@@ -13,9 +13,7 @@ | |||
13 | #ifndef __ASM_ARCH_GPIO_H | 13 | #ifndef __ASM_ARCH_GPIO_H |
14 | #define __ASM_ARCH_GPIO_H __FILE__ | 14 | #define __ASM_ARCH_GPIO_H __FILE__ |
15 | 15 | ||
16 | #define gpio_get_value __gpio_get_value | 16 | #define __ARM_GPIOLIB_TRIVIAL |
17 | #define gpio_set_value __gpio_set_value | ||
18 | #define gpio_cansleep __gpio_cansleep | ||
19 | #define gpio_to_irq __gpio_to_irq | 17 | #define gpio_to_irq __gpio_to_irq |
20 | 18 | ||
21 | /* Practically, GPIO banks up to MP03 are the configurable gpio banks */ | 19 | /* Practically, GPIO banks up to MP03 are the configurable gpio banks */ |
@@ -142,6 +140,4 @@ enum s5p_gpio_number { | |||
142 | #define ARCH_NR_GPIOS (S5PV210_MP05(S5PV210_GPIO_MP05_NR) + \ | 140 | #define ARCH_NR_GPIOS (S5PV210_MP05(S5PV210_GPIO_MP05_NR) + \ |
143 | CONFIG_SAMSUNG_GPIO_EXTRA + 1) | 141 | CONFIG_SAMSUNG_GPIO_EXTRA + 1) |
144 | 142 | ||
145 | #include <asm-generic/gpio.h> | ||
146 | |||
147 | #endif /* __ASM_ARCH_GPIO_H */ | 143 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h index 2b1bb9e43dda..e8feff014d99 100644 --- a/arch/arm/mach-shmobile/include/mach/gpio.h +++ b/arch/arm/mach-shmobile/include/mach/gpio.h | |||
@@ -18,20 +18,7 @@ | |||
18 | 18 | ||
19 | #ifdef CONFIG_GPIOLIB | 19 | #ifdef CONFIG_GPIOLIB |
20 | 20 | ||
21 | static inline int gpio_get_value(unsigned gpio) | 21 | #define __ARM_GPIOLIB_TRIVIAL |
22 | { | ||
23 | return __gpio_get_value(gpio); | ||
24 | } | ||
25 | |||
26 | static inline void gpio_set_value(unsigned gpio, int value) | ||
27 | { | ||
28 | __gpio_set_value(gpio, value); | ||
29 | } | ||
30 | |||
31 | static inline int gpio_cansleep(unsigned gpio) | ||
32 | { | ||
33 | return __gpio_cansleep(gpio); | ||
34 | } | ||
35 | 22 | ||
36 | static inline int gpio_to_irq(unsigned gpio) | 23 | static inline int gpio_to_irq(unsigned gpio) |
37 | { | 24 | { |
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h index 196f114dc241..d51be09fe3ad 100644 --- a/arch/arm/mach-tegra/include/mach/gpio.h +++ b/arch/arm/mach-tegra/include/mach/gpio.h | |||
@@ -25,11 +25,7 @@ | |||
25 | 25 | ||
26 | #define TEGRA_NR_GPIOS INT_GPIO_NR | 26 | #define TEGRA_NR_GPIOS INT_GPIO_NR |
27 | 27 | ||
28 | #include <asm-generic/gpio.h> | 28 | #define __ARM_GPIOLIB_TRIVIAL |
29 | |||
30 | #define gpio_get_value __gpio_get_value | ||
31 | #define gpio_set_value __gpio_set_value | ||
32 | #define gpio_cansleep __gpio_cansleep | ||
33 | 29 | ||
34 | #define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) | 30 | #define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) |
35 | #define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE) | 31 | #define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE) |
diff --git a/arch/arm/mach-versatile/include/mach/gpio.h b/arch/arm/mach-versatile/include/mach/gpio.h index 94ff27678a46..bd11dc503cce 100644 --- a/arch/arm/mach-versatile/include/mach/gpio.h +++ b/arch/arm/mach-versatile/include/mach/gpio.h | |||
@@ -1,6 +1,2 @@ | |||
1 | #include <asm-generic/gpio.h> | 1 | #define __ARM_GPIOLIB_TRIVIAL |
2 | |||
3 | #define gpio_get_value __gpio_get_value | ||
4 | #define gpio_set_value __gpio_set_value | ||
5 | #define gpio_cansleep __gpio_cansleep | ||
6 | #define gpio_to_irq __gpio_to_irq | 2 | #define gpio_to_irq __gpio_to_irq |
diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h index 94ff27678a46..bd11dc503cce 100644 --- a/arch/arm/mach-vt8500/include/mach/gpio.h +++ b/arch/arm/mach-vt8500/include/mach/gpio.h | |||
@@ -1,6 +1,2 @@ | |||
1 | #include <asm-generic/gpio.h> | 1 | #define __ARM_GPIOLIB_TRIVIAL |
2 | |||
3 | #define gpio_get_value __gpio_get_value | ||
4 | #define gpio_set_value __gpio_set_value | ||
5 | #define gpio_cansleep __gpio_cansleep | ||
6 | #define gpio_to_irq __gpio_to_irq | 2 | #define gpio_to_irq __gpio_to_irq |
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h index 034da3e390c9..60c784619b2b 100644 --- a/arch/arm/mach-w90x900/include/mach/gpio.h +++ b/arch/arm/mach-w90x900/include/mach/gpio.h | |||
@@ -15,11 +15,8 @@ | |||
15 | 15 | ||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | #include <asm/irq.h> | 17 | #include <asm/irq.h> |
18 | #include <asm-generic/gpio.h> | ||
19 | 18 | ||
20 | #define gpio_get_value __gpio_get_value | 19 | #define __ARM_GPIOLIB_TRIVIAL |
21 | #define gpio_set_value __gpio_set_value | ||
22 | #define gpio_cansleep __gpio_cansleep | ||
23 | 20 | ||
24 | static inline int gpio_to_irq(unsigned gpio) | 21 | static inline int gpio_to_irq(unsigned gpio) |
25 | { | 22 | { |
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h index 31c820c1b796..4398edd03780 100644 --- a/arch/arm/plat-mxc/include/mach/gpio.h +++ b/arch/arm/plat-mxc/include/mach/gpio.h | |||
@@ -21,7 +21,6 @@ | |||
21 | 21 | ||
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <asm-generic/gpio.h> | ||
25 | 24 | ||
26 | 25 | ||
27 | /* There's a off-by-one betweem the gpio bank number and the gpiochip */ | 26 | /* There's a off-by-one betweem the gpio bank number and the gpiochip */ |
@@ -29,9 +28,7 @@ | |||
29 | #define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr)) | 28 | #define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr)) |
30 | 29 | ||
31 | /* use gpiolib dispatchers */ | 30 | /* use gpiolib dispatchers */ |
32 | #define gpio_get_value __gpio_get_value | 31 | #define __ARM_GPIOLIB_TRIVIAL |
33 | #define gpio_set_value __gpio_set_value | ||
34 | #define gpio_cansleep __gpio_cansleep | ||
35 | 32 | ||
36 | #define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio)) | 33 | #define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio)) |
37 | #define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START) | 34 | #define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START) |
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h index d5d7e651269c..c804c3474c85 100644 --- a/arch/arm/plat-nomadik/include/plat/gpio.h +++ b/arch/arm/plat-nomadik/include/plat/gpio.h | |||
@@ -12,16 +12,9 @@ | |||
12 | #ifndef __ASM_PLAT_GPIO_H | 12 | #ifndef __ASM_PLAT_GPIO_H |
13 | #define __ASM_PLAT_GPIO_H | 13 | #define __ASM_PLAT_GPIO_H |
14 | 14 | ||
15 | #include <asm-generic/gpio.h> | 15 | #include <linux/kernel.h> |
16 | 16 | ||
17 | /* | 17 | #define __ARM_GPIOLIB_TRIVIAL |
18 | * These currently cause a function call to happen, they may be optimized | ||
19 | * if needed by adding cpu-specific defines to identify blocks | ||
20 | * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc) | ||
21 | */ | ||
22 | #define gpio_get_value __gpio_get_value | ||
23 | #define gpio_set_value __gpio_set_value | ||
24 | #define gpio_cansleep __gpio_cansleep | ||
25 | #define gpio_to_irq __gpio_to_irq | 18 | #define gpio_to_irq __gpio_to_irq |
26 | 19 | ||
27 | /* | 20 | /* |
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h index 91e8de3db085..20eedbbcdcb5 100644 --- a/arch/arm/plat-omap/include/plat/gpio.h +++ b/arch/arm/plat-omap/include/plat/gpio.h | |||
@@ -222,20 +222,7 @@ extern void omap_gpio_restore_context(void); | |||
222 | #include <linux/errno.h> | 222 | #include <linux/errno.h> |
223 | #include <asm-generic/gpio.h> | 223 | #include <asm-generic/gpio.h> |
224 | 224 | ||
225 | static inline int gpio_get_value(unsigned gpio) | 225 | #define __ARM_GPIOLIB_TRIVIAL |
226 | { | ||
227 | return __gpio_get_value(gpio); | ||
228 | } | ||
229 | |||
230 | static inline void gpio_set_value(unsigned gpio, int value) | ||
231 | { | ||
232 | __gpio_set_value(gpio, value); | ||
233 | } | ||
234 | |||
235 | static inline int gpio_cansleep(unsigned gpio) | ||
236 | { | ||
237 | return __gpio_cansleep(gpio); | ||
238 | } | ||
239 | 226 | ||
240 | static inline int gpio_to_irq(unsigned gpio) | 227 | static inline int gpio_to_irq(unsigned gpio) |
241 | { | 228 | { |
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h index 3075b9fdde83..71c4c6c28e56 100644 --- a/arch/arm/plat-orion/include/plat/gpio.h +++ b/arch/arm/plat-orion/include/plat/gpio.h | |||
@@ -12,14 +12,12 @@ | |||
12 | #define __PLAT_GPIO_H | 12 | #define __PLAT_GPIO_H |
13 | 13 | ||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <asm-generic/gpio.h> | 15 | |
16 | #define __ARM_GPIOLIB_TRIVIAL | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * GENERIC_GPIO primitives. | 19 | * GENERIC_GPIO primitives. |
19 | */ | 20 | */ |
20 | #define gpio_get_value __gpio_get_value | ||
21 | #define gpio_set_value __gpio_set_value | ||
22 | #define gpio_cansleep __gpio_cansleep | ||
23 | #define gpio_to_irq __gpio_to_irq | 21 | #define gpio_to_irq __gpio_to_irq |
24 | 22 | ||
25 | /* | 23 | /* |
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h index b857c91257dd..3c6f04403d9b 100644 --- a/arch/arm/plat-spear/include/plat/gpio.h +++ b/arch/arm/plat-spear/include/plat/gpio.h | |||
@@ -14,11 +14,7 @@ | |||
14 | #ifndef __PLAT_GPIO_H | 14 | #ifndef __PLAT_GPIO_H |
15 | #define __PLAT_GPIO_H | 15 | #define __PLAT_GPIO_H |
16 | 16 | ||
17 | #include <asm-generic/gpio.h> | 17 | #define __ARM_GPIOLIB_TRIVIAL |
18 | |||
19 | #define gpio_get_value __gpio_get_value | ||
20 | #define gpio_set_value __gpio_set_value | ||
21 | #define gpio_cansleep __gpio_cansleep | ||
22 | #define gpio_to_irq __gpio_to_irq | 18 | #define gpio_to_irq __gpio_to_irq |
23 | 19 | ||
24 | #endif /* __PLAT_GPIO_H */ | 20 | #endif /* __PLAT_GPIO_H */ |