diff options
Diffstat (limited to 'arch/arm/mach-exynos4/include/mach/gpio.h')
-rw-r--r-- | arch/arm/mach-exynos4/include/mach/gpio.h | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h new file mode 100644 index 000000000000..939728b38d48 --- /dev/null +++ b/arch/arm/mach-exynos4/include/mach/gpio.h | |||
@@ -0,0 +1,156 @@ | |||
1 | /* linux/arch/arm/mach-exynos4/include/mach/gpio.h | ||
2 | * | ||
3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * EXYNOS4 - GPIO lib support | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_GPIO_H | ||
14 | #define __ASM_ARCH_GPIO_H __FILE__ | ||
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 | ||
20 | |||
21 | /* Practically, GPIO banks upto GPZ are the configurable gpio banks */ | ||
22 | |||
23 | /* GPIO bank sizes */ | ||
24 | #define EXYNOS4_GPIO_A0_NR (8) | ||
25 | #define EXYNOS4_GPIO_A1_NR (6) | ||
26 | #define EXYNOS4_GPIO_B_NR (8) | ||
27 | #define EXYNOS4_GPIO_C0_NR (5) | ||
28 | #define EXYNOS4_GPIO_C1_NR (5) | ||
29 | #define EXYNOS4_GPIO_D0_NR (4) | ||
30 | #define EXYNOS4_GPIO_D1_NR (4) | ||
31 | #define EXYNOS4_GPIO_E0_NR (5) | ||
32 | #define EXYNOS4_GPIO_E1_NR (8) | ||
33 | #define EXYNOS4_GPIO_E2_NR (6) | ||
34 | #define EXYNOS4_GPIO_E3_NR (8) | ||
35 | #define EXYNOS4_GPIO_E4_NR (8) | ||
36 | #define EXYNOS4_GPIO_F0_NR (8) | ||
37 | #define EXYNOS4_GPIO_F1_NR (8) | ||
38 | #define EXYNOS4_GPIO_F2_NR (8) | ||
39 | #define EXYNOS4_GPIO_F3_NR (6) | ||
40 | #define EXYNOS4_GPIO_J0_NR (8) | ||
41 | #define EXYNOS4_GPIO_J1_NR (5) | ||
42 | #define EXYNOS4_GPIO_K0_NR (7) | ||
43 | #define EXYNOS4_GPIO_K1_NR (7) | ||
44 | #define EXYNOS4_GPIO_K2_NR (7) | ||
45 | #define EXYNOS4_GPIO_K3_NR (7) | ||
46 | #define EXYNOS4_GPIO_L0_NR (8) | ||
47 | #define EXYNOS4_GPIO_L1_NR (3) | ||
48 | #define EXYNOS4_GPIO_L2_NR (8) | ||
49 | #define EXYNOS4_GPIO_X0_NR (8) | ||
50 | #define EXYNOS4_GPIO_X1_NR (8) | ||
51 | #define EXYNOS4_GPIO_X2_NR (8) | ||
52 | #define EXYNOS4_GPIO_X3_NR (8) | ||
53 | #define EXYNOS4_GPIO_Y0_NR (6) | ||
54 | #define EXYNOS4_GPIO_Y1_NR (4) | ||
55 | #define EXYNOS4_GPIO_Y2_NR (6) | ||
56 | #define EXYNOS4_GPIO_Y3_NR (8) | ||
57 | #define EXYNOS4_GPIO_Y4_NR (8) | ||
58 | #define EXYNOS4_GPIO_Y5_NR (8) | ||
59 | #define EXYNOS4_GPIO_Y6_NR (8) | ||
60 | #define EXYNOS4_GPIO_Z_NR (7) | ||
61 | |||
62 | /* GPIO bank numbers */ | ||
63 | |||
64 | #define EXYNOS4_GPIO_NEXT(__gpio) \ | ||
65 | ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) | ||
66 | |||
67 | enum s5p_gpio_number { | ||
68 | EXYNOS4_GPIO_A0_START = 0, | ||
69 | EXYNOS4_GPIO_A1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_A0), | ||
70 | EXYNOS4_GPIO_B_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_A1), | ||
71 | EXYNOS4_GPIO_C0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_B), | ||
72 | EXYNOS4_GPIO_C1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_C0), | ||
73 | EXYNOS4_GPIO_D0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_C1), | ||
74 | EXYNOS4_GPIO_D1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_D0), | ||
75 | EXYNOS4_GPIO_E0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_D1), | ||
76 | EXYNOS4_GPIO_E1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E0), | ||
77 | EXYNOS4_GPIO_E2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E1), | ||
78 | EXYNOS4_GPIO_E3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E2), | ||
79 | EXYNOS4_GPIO_E4_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E3), | ||
80 | EXYNOS4_GPIO_F0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E4), | ||
81 | EXYNOS4_GPIO_F1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F0), | ||
82 | EXYNOS4_GPIO_F2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F1), | ||
83 | EXYNOS4_GPIO_F3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F2), | ||
84 | EXYNOS4_GPIO_J0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F3), | ||
85 | EXYNOS4_GPIO_J1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_J0), | ||
86 | EXYNOS4_GPIO_K0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_J1), | ||
87 | EXYNOS4_GPIO_K1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K0), | ||
88 | EXYNOS4_GPIO_K2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K1), | ||
89 | EXYNOS4_GPIO_K3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K2), | ||
90 | EXYNOS4_GPIO_L0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K3), | ||
91 | EXYNOS4_GPIO_L1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_L0), | ||
92 | EXYNOS4_GPIO_L2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_L1), | ||
93 | EXYNOS4_GPIO_X0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_L2), | ||
94 | EXYNOS4_GPIO_X1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X0), | ||
95 | EXYNOS4_GPIO_X2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X1), | ||
96 | EXYNOS4_GPIO_X3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X2), | ||
97 | EXYNOS4_GPIO_Y0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X3), | ||
98 | EXYNOS4_GPIO_Y1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y0), | ||
99 | EXYNOS4_GPIO_Y2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y1), | ||
100 | EXYNOS4_GPIO_Y3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y2), | ||
101 | EXYNOS4_GPIO_Y4_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y3), | ||
102 | EXYNOS4_GPIO_Y5_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y4), | ||
103 | EXYNOS4_GPIO_Y6_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y5), | ||
104 | EXYNOS4_GPIO_Z_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y6), | ||
105 | }; | ||
106 | |||
107 | /* EXYNOS4 GPIO number definitions */ | ||
108 | #define EXYNOS4_GPA0(_nr) (EXYNOS4_GPIO_A0_START + (_nr)) | ||
109 | #define EXYNOS4_GPA1(_nr) (EXYNOS4_GPIO_A1_START + (_nr)) | ||
110 | #define EXYNOS4_GPB(_nr) (EXYNOS4_GPIO_B_START + (_nr)) | ||
111 | #define EXYNOS4_GPC0(_nr) (EXYNOS4_GPIO_C0_START + (_nr)) | ||
112 | #define EXYNOS4_GPC1(_nr) (EXYNOS4_GPIO_C1_START + (_nr)) | ||
113 | #define EXYNOS4_GPD0(_nr) (EXYNOS4_GPIO_D0_START + (_nr)) | ||
114 | #define EXYNOS4_GPD1(_nr) (EXYNOS4_GPIO_D1_START + (_nr)) | ||
115 | #define EXYNOS4_GPE0(_nr) (EXYNOS4_GPIO_E0_START + (_nr)) | ||
116 | #define EXYNOS4_GPE1(_nr) (EXYNOS4_GPIO_E1_START + (_nr)) | ||
117 | #define EXYNOS4_GPE2(_nr) (EXYNOS4_GPIO_E2_START + (_nr)) | ||
118 | #define EXYNOS4_GPE3(_nr) (EXYNOS4_GPIO_E3_START + (_nr)) | ||
119 | #define EXYNOS4_GPE4(_nr) (EXYNOS4_GPIO_E4_START + (_nr)) | ||
120 | #define EXYNOS4_GPF0(_nr) (EXYNOS4_GPIO_F0_START + (_nr)) | ||
121 | #define EXYNOS4_GPF1(_nr) (EXYNOS4_GPIO_F1_START + (_nr)) | ||
122 | #define EXYNOS4_GPF2(_nr) (EXYNOS4_GPIO_F2_START + (_nr)) | ||
123 | #define EXYNOS4_GPF3(_nr) (EXYNOS4_GPIO_F3_START + (_nr)) | ||
124 | #define EXYNOS4_GPJ0(_nr) (EXYNOS4_GPIO_J0_START + (_nr)) | ||
125 | #define EXYNOS4_GPJ1(_nr) (EXYNOS4_GPIO_J1_START + (_nr)) | ||
126 | #define EXYNOS4_GPK0(_nr) (EXYNOS4_GPIO_K0_START + (_nr)) | ||
127 | #define EXYNOS4_GPK1(_nr) (EXYNOS4_GPIO_K1_START + (_nr)) | ||
128 | #define EXYNOS4_GPK2(_nr) (EXYNOS4_GPIO_K2_START + (_nr)) | ||
129 | #define EXYNOS4_GPK3(_nr) (EXYNOS4_GPIO_K3_START + (_nr)) | ||
130 | #define EXYNOS4_GPL0(_nr) (EXYNOS4_GPIO_L0_START + (_nr)) | ||
131 | #define EXYNOS4_GPL1(_nr) (EXYNOS4_GPIO_L1_START + (_nr)) | ||
132 | #define EXYNOS4_GPL2(_nr) (EXYNOS4_GPIO_L2_START + (_nr)) | ||
133 | #define EXYNOS4_GPX0(_nr) (EXYNOS4_GPIO_X0_START + (_nr)) | ||
134 | #define EXYNOS4_GPX1(_nr) (EXYNOS4_GPIO_X1_START + (_nr)) | ||
135 | #define EXYNOS4_GPX2(_nr) (EXYNOS4_GPIO_X2_START + (_nr)) | ||
136 | #define EXYNOS4_GPX3(_nr) (EXYNOS4_GPIO_X3_START + (_nr)) | ||
137 | #define EXYNOS4_GPY0(_nr) (EXYNOS4_GPIO_Y0_START + (_nr)) | ||
138 | #define EXYNOS4_GPY1(_nr) (EXYNOS4_GPIO_Y1_START + (_nr)) | ||
139 | #define EXYNOS4_GPY2(_nr) (EXYNOS4_GPIO_Y2_START + (_nr)) | ||
140 | #define EXYNOS4_GPY3(_nr) (EXYNOS4_GPIO_Y3_START + (_nr)) | ||
141 | #define EXYNOS4_GPY4(_nr) (EXYNOS4_GPIO_Y4_START + (_nr)) | ||
142 | #define EXYNOS4_GPY5(_nr) (EXYNOS4_GPIO_Y5_START + (_nr)) | ||
143 | #define EXYNOS4_GPY6(_nr) (EXYNOS4_GPIO_Y6_START + (_nr)) | ||
144 | #define EXYNOS4_GPZ(_nr) (EXYNOS4_GPIO_Z_START + (_nr)) | ||
145 | |||
146 | /* the end of the EXYNOS4 specific gpios */ | ||
147 | #define EXYNOS4_GPIO_END (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + 1) | ||
148 | #define S3C_GPIO_END EXYNOS4_GPIO_END | ||
149 | |||
150 | /* define the number of gpios we need to the one after the GPZ() range */ | ||
151 | #define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \ | ||
152 | CONFIG_SAMSUNG_GPIO_EXTRA + 1) | ||
153 | |||
154 | #include <asm-generic/gpio.h> | ||
155 | |||
156 | #endif /* __ASM_ARCH_GPIO_H */ | ||