~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to arch/arm/mach-s5p6442/include/mach/gpio.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* linux/arch/arm/mach-s5p6442/include/mach/gpio.h
 
2
 *
 
3
 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
 
4
 *              http://www.samsung.com/
 
5
 *
 
6
 * S5P6442 - 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
/* 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)
 
47
 
 
48
/* GPIO bank numbers */
 
49
 
 
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.
 
53
*/
 
54
 
 
55
#define S5P6442_GPIO_NEXT(__gpio) \
 
56
        ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
 
57
 
 
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),
 
84
};
 
85
 
 
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))
 
112
 
 
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
 
116
 
 
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)
 
120
 
 
121
#include <asm-generic/gpio.h>
 
122
 
 
123
#endif /* __ASM_ARCH_GPIO_H */