1 /* linux/arch/arm/mach-s5p6440/include/mach/gpio.h
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
6 * S5P6440 - 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
22 #define S5P6440_GPIO_A_NR (6)
23 #define S5P6440_GPIO_B_NR (7)
24 #define S5P6440_GPIO_C_NR (8)
25 #define S5P6440_GPIO_F_NR (2)
26 #define S5P6440_GPIO_G_NR (7)
27 #define S5P6440_GPIO_H_NR (10)
28 #define S5P6440_GPIO_I_NR (16)
29 #define S5P6440_GPIO_J_NR (12)
30 #define S5P6440_GPIO_N_NR (16)
31 #define S5P6440_GPIO_P_NR (8)
32 #define S5P6440_GPIO_R_NR (15)
34 /* GPIO bank numbers */
36 /* CONFIG_S3C_GPIO_SPACE allows the user to select extra
37 * space for debugging purposes so that any accidental
38 * change from one gpio bank to another can be caught.
40 #define S5P6440_GPIO_NEXT(__gpio) \
41 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
43 enum s5p_gpio_number {
44 S5P6440_GPIO_A_START = 0,
45 S5P6440_GPIO_B_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_A),
46 S5P6440_GPIO_C_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_B),
47 S5P6440_GPIO_F_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_C),
48 S5P6440_GPIO_G_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_F),
49 S5P6440_GPIO_H_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_G),
50 S5P6440_GPIO_I_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_H),
51 S5P6440_GPIO_J_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_I),
52 S5P6440_GPIO_N_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_J),
53 S5P6440_GPIO_P_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_N),
54 S5P6440_GPIO_R_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_P),
57 /* S5P6440 GPIO number definitions. */
58 #define S5P6440_GPA(_nr) (S5P6440_GPIO_A_START + (_nr))
59 #define S5P6440_GPB(_nr) (S5P6440_GPIO_B_START + (_nr))
60 #define S5P6440_GPC(_nr) (S5P6440_GPIO_C_START + (_nr))
61 #define S5P6440_GPF(_nr) (S5P6440_GPIO_F_START + (_nr))
62 #define S5P6440_GPG(_nr) (S5P6440_GPIO_G_START + (_nr))
63 #define S5P6440_GPH(_nr) (S5P6440_GPIO_H_START + (_nr))
64 #define S5P6440_GPI(_nr) (S5P6440_GPIO_I_START + (_nr))
65 #define S5P6440_GPJ(_nr) (S5P6440_GPIO_J_START + (_nr))
66 #define S5P6440_GPN(_nr) (S5P6440_GPIO_N_START + (_nr))
67 #define S5P6440_GPP(_nr) (S5P6440_GPIO_P_START + (_nr))
68 #define S5P6440_GPR(_nr) (S5P6440_GPIO_R_START + (_nr))
70 /* the end of the S5P6440 specific gpios */
71 #define S5P6440_GPIO_END (S5P6440_GPR(S5P6440_GPIO_R_NR) + 1)
72 #define S3C_GPIO_END S5P6440_GPIO_END
74 /* define the number of gpios we need to the one after the GPR() range */
75 #define ARCH_NR_GPIOS (S5P6440_GPR(S5P6440_GPIO_R_NR) + \
76 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
78 #include <asm-generic/gpio.h>
80 #endif /* __ASM_ARCH_GPIO_H */