Merge branch 'v6v7' into devel
[linux/fpc-iii.git] / arch / arm / mach-s5p6442 / include / mach / gpio.h
blobb8715df2fdab8450d7e37999c7c61e2d6d3a2688
1 /* linux/arch/arm/mach-s5p6442/include/mach/gpio.h
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
6 * S5P6442 - GPIO lib support
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.
13 #ifndef __ASM_ARCH_GPIO_H
14 #define __ASM_ARCH_GPIO_H __FILE__
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
21 /* GPIO bank sizes */
22 #define S5P6442_GPIO_A0_NR (8)
23 #define S5P6442_GPIO_A1_NR (2)
24 #define S5P6442_GPIO_B_NR (4)
25 #define S5P6442_GPIO_C0_NR (5)
26 #define S5P6442_GPIO_C1_NR (5)
27 #define S5P6442_GPIO_D0_NR (2)
28 #define S5P6442_GPIO_D1_NR (6)
29 #define S5P6442_GPIO_E0_NR (8)
30 #define S5P6442_GPIO_E1_NR (5)
31 #define S5P6442_GPIO_F0_NR (8)
32 #define S5P6442_GPIO_F1_NR (8)
33 #define S5P6442_GPIO_F2_NR (8)
34 #define S5P6442_GPIO_F3_NR (6)
35 #define S5P6442_GPIO_G0_NR (7)
36 #define S5P6442_GPIO_G1_NR (7)
37 #define S5P6442_GPIO_G2_NR (7)
38 #define S5P6442_GPIO_H0_NR (8)
39 #define S5P6442_GPIO_H1_NR (8)
40 #define S5P6442_GPIO_H2_NR (8)
41 #define S5P6442_GPIO_H3_NR (8)
42 #define S5P6442_GPIO_J0_NR (8)
43 #define S5P6442_GPIO_J1_NR (6)
44 #define S5P6442_GPIO_J2_NR (8)
45 #define S5P6442_GPIO_J3_NR (8)
46 #define S5P6442_GPIO_J4_NR (5)
48 /* GPIO bank numbers */
50 /* CONFIG_S3C_GPIO_SPACE allows the user to select extra
51 * space for debugging purposes so that any accidental
52 * change from one gpio bank to another can be caught.
55 #define S5P6442_GPIO_NEXT(__gpio) \
56 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
58 enum s5p_gpio_number {
59 S5P6442_GPIO_A0_START = 0,
60 S5P6442_GPIO_A1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_A0),
61 S5P6442_GPIO_B_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_A1),
62 S5P6442_GPIO_C0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_B),
63 S5P6442_GPIO_C1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_C0),
64 S5P6442_GPIO_D0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_C1),
65 S5P6442_GPIO_D1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_D0),
66 S5P6442_GPIO_E0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_D1),
67 S5P6442_GPIO_E1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_E0),
68 S5P6442_GPIO_F0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_E1),
69 S5P6442_GPIO_F1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F0),
70 S5P6442_GPIO_F2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F1),
71 S5P6442_GPIO_F3_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F2),
72 S5P6442_GPIO_G0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F3),
73 S5P6442_GPIO_G1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_G0),
74 S5P6442_GPIO_G2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_G1),
75 S5P6442_GPIO_H0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_G2),
76 S5P6442_GPIO_H1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H0),
77 S5P6442_GPIO_H2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H1),
78 S5P6442_GPIO_H3_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H2),
79 S5P6442_GPIO_J0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H3),
80 S5P6442_GPIO_J1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J0),
81 S5P6442_GPIO_J2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J1),
82 S5P6442_GPIO_J3_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J2),
83 S5P6442_GPIO_J4_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J3),
86 /* S5P6442 GPIO number definitions. */
87 #define S5P6442_GPA0(_nr) (S5P6442_GPIO_A0_START + (_nr))
88 #define S5P6442_GPA1(_nr) (S5P6442_GPIO_A1_START + (_nr))
89 #define S5P6442_GPB(_nr) (S5P6442_GPIO_B_START + (_nr))
90 #define S5P6442_GPC0(_nr) (S5P6442_GPIO_C0_START + (_nr))
91 #define S5P6442_GPC1(_nr) (S5P6442_GPIO_C1_START + (_nr))
92 #define S5P6442_GPD0(_nr) (S5P6442_GPIO_D0_START + (_nr))
93 #define S5P6442_GPD1(_nr) (S5P6442_GPIO_D1_START + (_nr))
94 #define S5P6442_GPE0(_nr) (S5P6442_GPIO_E0_START + (_nr))
95 #define S5P6442_GPE1(_nr) (S5P6442_GPIO_E1_START + (_nr))
96 #define S5P6442_GPF0(_nr) (S5P6442_GPIO_F0_START + (_nr))
97 #define S5P6442_GPF1(_nr) (S5P6442_GPIO_F1_START + (_nr))
98 #define S5P6442_GPF2(_nr) (S5P6442_GPIO_F2_START + (_nr))
99 #define S5P6442_GPF3(_nr) (S5P6442_GPIO_F3_START + (_nr))
100 #define S5P6442_GPG0(_nr) (S5P6442_GPIO_G0_START + (_nr))
101 #define S5P6442_GPG1(_nr) (S5P6442_GPIO_G1_START + (_nr))
102 #define S5P6442_GPG2(_nr) (S5P6442_GPIO_G2_START + (_nr))
103 #define S5P6442_GPH0(_nr) (S5P6442_GPIO_H0_START + (_nr))
104 #define S5P6442_GPH1(_nr) (S5P6442_GPIO_H1_START + (_nr))
105 #define S5P6442_GPH2(_nr) (S5P6442_GPIO_H2_START + (_nr))
106 #define S5P6442_GPH3(_nr) (S5P6442_GPIO_H3_START + (_nr))
107 #define S5P6442_GPJ0(_nr) (S5P6442_GPIO_J0_START + (_nr))
108 #define S5P6442_GPJ1(_nr) (S5P6442_GPIO_J1_START + (_nr))
109 #define S5P6442_GPJ2(_nr) (S5P6442_GPIO_J2_START + (_nr))
110 #define S5P6442_GPJ3(_nr) (S5P6442_GPIO_J3_START + (_nr))
111 #define S5P6442_GPJ4(_nr) (S5P6442_GPIO_J4_START + (_nr))
113 /* the end of the S5P6442 specific gpios */
114 #define S5P6442_GPIO_END (S5P6442_GPJ4(S5P6442_GPIO_J4_NR) + 1)
115 #define S3C_GPIO_END S5P6442_GPIO_END
117 /* define the number of gpios we need to the one after the GPJ4() range */
118 #define ARCH_NR_GPIOS (S5P6442_GPJ4(S5P6442_GPIO_J4_NR) + \
119 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
121 #include <asm-generic/gpio.h>
123 #endif /* __ASM_ARCH_GPIO_H */