diff options
Diffstat (limited to 'arch/arm/mach-s3c24xx/include/mach/gpio.h')
-rw-r--r-- | arch/arm/mach-s3c24xx/include/mach/gpio.h | 87 |
1 files changed, 83 insertions, 4 deletions
diff --git a/arch/arm/mach-s3c24xx/include/mach/gpio.h b/arch/arm/mach-s3c24xx/include/mach/gpio.h index 6fac70f3484e..14591563ca70 100644 --- a/arch/arm/mach-s3c24xx/include/mach/gpio.h +++ b/arch/arm/mach-s3c24xx/include/mach/gpio.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/gpio.h | 1 | /* |
2 | * | ||
3 | * Copyright (c) 2008 Simtec Electronics | 2 | * Copyright (c) 2008 Simtec Electronics |
4 | * http://armlinux.simtec.co.uk/ | 3 | * http://armlinux.simtec.co.uk/ |
5 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
@@ -15,6 +14,9 @@ | |||
15 | * devices that need GPIO. | 14 | * devices that need GPIO. |
16 | */ | 15 | */ |
17 | 16 | ||
17 | #ifndef __MACH_GPIO_H | ||
18 | #define __MACH_GPIO_H __FILE__ | ||
19 | |||
18 | #ifdef CONFIG_CPU_S3C244X | 20 | #ifdef CONFIG_CPU_S3C244X |
19 | #define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA) | 21 | #define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA) |
20 | #elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416) | 22 | #elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416) |
@@ -23,8 +25,83 @@ | |||
23 | #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) | 25 | #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) |
24 | #endif | 26 | #endif |
25 | 27 | ||
26 | #include <mach/gpio-nrs.h> | 28 | /* |
27 | #include <mach/gpio-fns.h> | 29 | * GPIO sizes for various SoCs: |
30 | * | ||
31 | * 2410 2412 2440 2443 2416 | ||
32 | * 2442 | ||
33 | * ---- ---- ---- ---- ---- | ||
34 | * A 23 22 25 16 25 | ||
35 | * B 11 11 11 11 9 | ||
36 | * C 16 15 16 16 16 | ||
37 | * D 16 16 16 16 16 | ||
38 | * E 16 16 16 16 16 | ||
39 | * F 8 8 8 8 8 | ||
40 | * G 16 16 16 16 8 | ||
41 | * H 11 11 9 15 15 | ||
42 | * J -- -- 13 16 -- | ||
43 | * K -- -- -- -- 16 | ||
44 | * L -- -- -- 15 7 | ||
45 | * M -- -- -- 2 2 | ||
46 | */ | ||
47 | |||
48 | /* GPIO bank sizes */ | ||
49 | |||
50 | #define S3C2410_GPIO_A_NR (32) | ||
51 | #define S3C2410_GPIO_B_NR (32) | ||
52 | #define S3C2410_GPIO_C_NR (32) | ||
53 | #define S3C2410_GPIO_D_NR (32) | ||
54 | #define S3C2410_GPIO_E_NR (32) | ||
55 | #define S3C2410_GPIO_F_NR (32) | ||
56 | #define S3C2410_GPIO_G_NR (32) | ||
57 | #define S3C2410_GPIO_H_NR (32) | ||
58 | #define S3C2410_GPIO_J_NR (32) /* technically 16. */ | ||
59 | #define S3C2410_GPIO_K_NR (32) /* technically 16. */ | ||
60 | #define S3C2410_GPIO_L_NR (32) /* technically 15. */ | ||
61 | #define S3C2410_GPIO_M_NR (32) /* technically 2. */ | ||
62 | |||
63 | #if CONFIG_S3C_GPIO_SPACE != 0 | ||
64 | #error CONFIG_S3C_GPIO_SPACE cannot be nonzero at the moment | ||
65 | #endif | ||
66 | |||
67 | #define S3C2410_GPIO_NEXT(__gpio) \ | ||
68 | ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 0) | ||
69 | |||
70 | #ifndef __ASSEMBLY__ | ||
71 | |||
72 | enum s3c_gpio_number { | ||
73 | S3C2410_GPIO_A_START = 0, | ||
74 | S3C2410_GPIO_B_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_A), | ||
75 | S3C2410_GPIO_C_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_B), | ||
76 | S3C2410_GPIO_D_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_C), | ||
77 | S3C2410_GPIO_E_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_D), | ||
78 | S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E), | ||
79 | S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F), | ||
80 | S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G), | ||
81 | S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H), | ||
82 | S3C2410_GPIO_K_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_J), | ||
83 | S3C2410_GPIO_L_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_K), | ||
84 | S3C2410_GPIO_M_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_L), | ||
85 | }; | ||
86 | |||
87 | #endif /* __ASSEMBLY__ */ | ||
88 | |||
89 | /* S3C2410 GPIO number definitions. */ | ||
90 | |||
91 | #define S3C2410_GPA(_nr) (S3C2410_GPIO_A_START + (_nr)) | ||
92 | #define S3C2410_GPB(_nr) (S3C2410_GPIO_B_START + (_nr)) | ||
93 | #define S3C2410_GPC(_nr) (S3C2410_GPIO_C_START + (_nr)) | ||
94 | #define S3C2410_GPD(_nr) (S3C2410_GPIO_D_START + (_nr)) | ||
95 | #define S3C2410_GPE(_nr) (S3C2410_GPIO_E_START + (_nr)) | ||
96 | #define S3C2410_GPF(_nr) (S3C2410_GPIO_F_START + (_nr)) | ||
97 | #define S3C2410_GPG(_nr) (S3C2410_GPIO_G_START + (_nr)) | ||
98 | #define S3C2410_GPH(_nr) (S3C2410_GPIO_H_START + (_nr)) | ||
99 | #define S3C2410_GPJ(_nr) (S3C2410_GPIO_J_START + (_nr)) | ||
100 | #define S3C2410_GPK(_nr) (S3C2410_GPIO_K_START + (_nr)) | ||
101 | #define S3C2410_GPL(_nr) (S3C2410_GPIO_L_START + (_nr)) | ||
102 | #define S3C2410_GPM(_nr) (S3C2410_GPIO_M_START + (_nr)) | ||
103 | |||
104 | #include <plat/gpio-cfg.h> | ||
28 | 105 | ||
29 | #ifdef CONFIG_CPU_S3C244X | 106 | #ifdef CONFIG_CPU_S3C244X |
30 | #define S3C_GPIO_END (S3C2410_GPJ(0) + 32) | 107 | #define S3C_GPIO_END (S3C2410_GPJ(0) + 32) |
@@ -33,3 +110,5 @@ | |||
33 | #else | 110 | #else |
34 | #define S3C_GPIO_END (S3C2410_GPH(0) + 32) | 111 | #define S3C_GPIO_END (S3C2410_GPH(0) + 32) |
35 | #endif | 112 | #endif |
113 | |||
114 | #endif /* __MACH_GPIO_H */ | ||