1 /* linux/arch/arm/mach-s5p64x0/include/mach/gpio.h
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
6 * S5P64X0 - 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
23 #define S5P6440_GPIO_A_NR (6)
24 #define S5P6440_GPIO_B_NR (7)
25 #define S5P6440_GPIO_C_NR (8)
26 #define S5P6440_GPIO_F_NR (16)
27 #define S5P6440_GPIO_G_NR (7)
28 #define S5P6440_GPIO_H_NR (10)
29 #define S5P6440_GPIO_I_NR (16)
30 #define S5P6440_GPIO_J_NR (12)
31 #define S5P6440_GPIO_N_NR (16)
32 #define S5P6440_GPIO_P_NR (8)
33 #define S5P6440_GPIO_R_NR (15)
35 #define S5P6450_GPIO_A_NR (6)
36 #define S5P6450_GPIO_B_NR (7)
37 #define S5P6450_GPIO_C_NR (8)
38 #define S5P6450_GPIO_D_NR (8)
39 #define S5P6450_GPIO_F_NR (16)
40 #define S5P6450_GPIO_G_NR (14)
41 #define S5P6450_GPIO_H_NR (10)
42 #define S5P6450_GPIO_I_NR (16)
43 #define S5P6450_GPIO_J_NR (12)
44 #define S5P6450_GPIO_K_NR (5)
45 #define S5P6450_GPIO_N_NR (16)
46 #define S5P6450_GPIO_P_NR (11)
47 #define S5P6450_GPIO_Q_NR (14)
48 #define S5P6450_GPIO_R_NR (15)
49 #define S5P6450_GPIO_S_NR (8)
51 /* GPIO bank numbers */
53 /* CONFIG_S3C_GPIO_SPACE allows the user to select extra
54 * space for debugging purposes so that any accidental
55 * change from one gpio bank to another can be caught.
58 #define S5P64X0_GPIO_NEXT(__gpio) \
59 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
61 enum s5p6440_gpio_number
{
62 S5P6440_GPIO_A_START
= 0,
63 S5P6440_GPIO_B_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_A
),
64 S5P6440_GPIO_C_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_B
),
65 S5P6440_GPIO_F_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_C
),
66 S5P6440_GPIO_G_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_F
),
67 S5P6440_GPIO_H_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_G
),
68 S5P6440_GPIO_I_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_H
),
69 S5P6440_GPIO_J_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_I
),
70 S5P6440_GPIO_N_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_J
),
71 S5P6440_GPIO_P_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_N
),
72 S5P6440_GPIO_R_START
= S5P64X0_GPIO_NEXT(S5P6440_GPIO_P
),
75 enum s5p6450_gpio_number
{
76 S5P6450_GPIO_A_START
= 0,
77 S5P6450_GPIO_B_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_A
),
78 S5P6450_GPIO_C_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_B
),
79 S5P6450_GPIO_D_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_C
),
80 S5P6450_GPIO_F_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_D
),
81 S5P6450_GPIO_G_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_F
),
82 S5P6450_GPIO_H_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_G
),
83 S5P6450_GPIO_I_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_H
),
84 S5P6450_GPIO_J_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_I
),
85 S5P6450_GPIO_K_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_J
),
86 S5P6450_GPIO_N_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_K
),
87 S5P6450_GPIO_P_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_N
),
88 S5P6450_GPIO_Q_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_P
),
89 S5P6450_GPIO_R_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_Q
),
90 S5P6450_GPIO_S_START
= S5P64X0_GPIO_NEXT(S5P6450_GPIO_R
),
93 /* GPIO number definitions */
95 #define S5P6440_GPA(_nr) (S5P6440_GPIO_A_START + (_nr))
96 #define S5P6440_GPB(_nr) (S5P6440_GPIO_B_START + (_nr))
97 #define S5P6440_GPC(_nr) (S5P6440_GPIO_C_START + (_nr))
98 #define S5P6440_GPF(_nr) (S5P6440_GPIO_F_START + (_nr))
99 #define S5P6440_GPG(_nr) (S5P6440_GPIO_G_START + (_nr))
100 #define S5P6440_GPH(_nr) (S5P6440_GPIO_H_START + (_nr))
101 #define S5P6440_GPI(_nr) (S5P6440_GPIO_I_START + (_nr))
102 #define S5P6440_GPJ(_nr) (S5P6440_GPIO_J_START + (_nr))
103 #define S5P6440_GPN(_nr) (S5P6440_GPIO_N_START + (_nr))
104 #define S5P6440_GPP(_nr) (S5P6440_GPIO_P_START + (_nr))
105 #define S5P6440_GPR(_nr) (S5P6440_GPIO_R_START + (_nr))
107 #define S5P6450_GPA(_nr) (S5P6450_GPIO_A_START + (_nr))
108 #define S5P6450_GPB(_nr) (S5P6450_GPIO_B_START + (_nr))
109 #define S5P6450_GPC(_nr) (S5P6450_GPIO_C_START + (_nr))
110 #define S5P6450_GPD(_nr) (S5P6450_GPIO_D_START + (_nr))
111 #define S5P6450_GPF(_nr) (S5P6450_GPIO_F_START + (_nr))
112 #define S5P6450_GPG(_nr) (S5P6450_GPIO_G_START + (_nr))
113 #define S5P6450_GPH(_nr) (S5P6450_GPIO_H_START + (_nr))
114 #define S5P6450_GPI(_nr) (S5P6450_GPIO_I_START + (_nr))
115 #define S5P6450_GPJ(_nr) (S5P6450_GPIO_J_START + (_nr))
116 #define S5P6450_GPK(_nr) (S5P6450_GPIO_K_START + (_nr))
117 #define S5P6450_GPN(_nr) (S5P6450_GPIO_N_START + (_nr))
118 #define S5P6450_GPP(_nr) (S5P6450_GPIO_P_START + (_nr))
119 #define S5P6450_GPQ(_nr) (S5P6450_GPIO_Q_START + (_nr))
120 #define S5P6450_GPR(_nr) (S5P6450_GPIO_R_START + (_nr))
121 #define S5P6450_GPS(_nr) (S5P6450_GPIO_S_START + (_nr))
123 /* the end of the S5P64X0 specific gpios */
125 #define S5P6440_GPIO_END (S5P6440_GPR(S5P6440_GPIO_R_NR) + 1)
126 #define S5P6450_GPIO_END (S5P6450_GPS(S5P6450_GPIO_S_NR) + 1)
128 #define S5P64X0_GPIO_END (S5P6440_GPIO_END > S5P6450_GPIO_END ? \
129 S5P6440_GPIO_END : S5P6450_GPIO_END)
131 #define S3C_GPIO_END S5P64X0_GPIO_END
133 /* define the number of gpios we need to the one after the last GPIO range */
135 #define ARCH_NR_GPIOS (S5P64X0_GPIO_END + CONFIG_SAMSUNG_GPIO_EXTRA)
137 #include <asm-generic/gpio.h>
139 #endif /* __ASM_ARCH_GPIO_H */