tools, slub: Fix off-by-one buffer corruption after readlink() call
[linux-2.6/linux-mips.git] / arch / arm / mach-ux500 / board-mop500-pins.c
blobf26fd76f72b4f26301b2af1226664c4767ae6b86
1 /*
2 * Copyright (C) ST-Ericsson SA 2010
4 * License terms: GNU General Public License (GPL) version 2
5 */
7 #include <linux/kernel.h>
8 #include <linux/init.h>
9 #include <linux/gpio.h>
11 #include <asm/mach-types.h>
12 #include <plat/pincfg.h>
13 #include <mach/hardware.h>
15 #include "pins-db8500.h"
17 static pin_cfg_t mop500_pins_common[] = {
18 /* I2C */
19 GPIO147_I2C0_SCL,
20 GPIO148_I2C0_SDA,
21 GPIO16_I2C1_SCL,
22 GPIO17_I2C1_SDA,
23 GPIO10_I2C2_SDA,
24 GPIO11_I2C2_SCL,
25 GPIO229_I2C3_SDA,
26 GPIO230_I2C3_SCL,
28 /* MSP0 */
29 GPIO12_MSP0_TXD,
30 GPIO13_MSP0_TFS,
31 GPIO14_MSP0_TCK,
32 GPIO15_MSP0_RXD,
34 /* MSP2: HDMI */
35 GPIO193_MSP2_TXD,
36 GPIO194_MSP2_TCK,
37 GPIO195_MSP2_TFS,
38 GPIO196_MSP2_RXD | PIN_OUTPUT_LOW,
40 /* Touch screen INTERFACE */
41 GPIO84_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT1 */
43 /* STMPE1601/tc35893 keypad IRQ */
44 GPIO218_GPIO | PIN_INPUT_PULLUP,
46 /* MMC0 (MicroSD card) */
47 GPIO18_MC0_CMDDIR | PIN_OUTPUT_HIGH,
48 GPIO19_MC0_DAT0DIR | PIN_OUTPUT_HIGH,
49 GPIO20_MC0_DAT2DIR | PIN_OUTPUT_HIGH,
51 GPIO22_MC0_FBCLK | PIN_INPUT_NOPULL,
52 GPIO23_MC0_CLK | PIN_OUTPUT_LOW,
53 GPIO24_MC0_CMD | PIN_INPUT_PULLUP,
54 GPIO25_MC0_DAT0 | PIN_INPUT_PULLUP,
55 GPIO26_MC0_DAT1 | PIN_INPUT_PULLUP,
56 GPIO27_MC0_DAT2 | PIN_INPUT_PULLUP,
57 GPIO28_MC0_DAT3 | PIN_INPUT_PULLUP,
59 /* SDI1 (SDIO) */
60 GPIO208_MC1_CLK | PIN_OUTPUT_LOW,
61 GPIO209_MC1_FBCLK | PIN_INPUT_NOPULL,
62 GPIO210_MC1_CMD | PIN_INPUT_PULLUP,
63 GPIO211_MC1_DAT0 | PIN_INPUT_PULLUP,
64 GPIO212_MC1_DAT1 | PIN_INPUT_PULLUP,
65 GPIO213_MC1_DAT2 | PIN_INPUT_PULLUP,
66 GPIO214_MC1_DAT3 | PIN_INPUT_PULLUP,
68 /* MMC2 (On-board DATA INTERFACE eMMC) */
69 GPIO128_MC2_CLK | PIN_OUTPUT_LOW,
70 GPIO129_MC2_CMD | PIN_INPUT_PULLUP,
71 GPIO130_MC2_FBCLK | PIN_INPUT_NOPULL,
72 GPIO131_MC2_DAT0 | PIN_INPUT_PULLUP,
73 GPIO132_MC2_DAT1 | PIN_INPUT_PULLUP,
74 GPIO133_MC2_DAT2 | PIN_INPUT_PULLUP,
75 GPIO134_MC2_DAT3 | PIN_INPUT_PULLUP,
76 GPIO135_MC2_DAT4 | PIN_INPUT_PULLUP,
77 GPIO136_MC2_DAT5 | PIN_INPUT_PULLUP,
78 GPIO137_MC2_DAT6 | PIN_INPUT_PULLUP,
79 GPIO138_MC2_DAT7 | PIN_INPUT_PULLUP,
81 /* MMC4 (On-board STORAGE INTERFACE eMMC) */
82 GPIO197_MC4_DAT3 | PIN_INPUT_PULLUP,
83 GPIO198_MC4_DAT2 | PIN_INPUT_PULLUP,
84 GPIO199_MC4_DAT1 | PIN_INPUT_PULLUP,
85 GPIO200_MC4_DAT0 | PIN_INPUT_PULLUP,
86 GPIO201_MC4_CMD | PIN_INPUT_PULLUP,
87 GPIO202_MC4_FBCLK | PIN_INPUT_NOPULL,
88 GPIO203_MC4_CLK | PIN_OUTPUT_LOW,
89 GPIO204_MC4_DAT7 | PIN_INPUT_PULLUP,
90 GPIO205_MC4_DAT6 | PIN_INPUT_PULLUP,
91 GPIO206_MC4_DAT5 | PIN_INPUT_PULLUP,
92 GPIO207_MC4_DAT4 | PIN_INPUT_PULLUP,
94 /* SKE keypad */
95 GPIO153_KP_I7,
96 GPIO154_KP_I6,
97 GPIO155_KP_I5,
98 GPIO156_KP_I4,
99 GPIO157_KP_O7,
100 GPIO158_KP_O6,
101 GPIO159_KP_O5,
102 GPIO160_KP_O4,
103 GPIO161_KP_I3,
104 GPIO162_KP_I2,
105 GPIO163_KP_I1,
106 GPIO164_KP_I0,
107 GPIO165_KP_O3,
108 GPIO166_KP_O2,
109 GPIO167_KP_O1,
110 GPIO168_KP_O0,
112 /* UART */
113 /* uart-0 pins gpio configuration should be
114 * kept intact to prevent glitch in tx line
115 * when tty dev is opened. Later these pins
116 * are configured to uart mop500_pins_uart0
118 * It will be replaced with uart configuration
119 * once the issue is solved.
121 GPIO0_GPIO | PIN_INPUT_PULLUP,
122 GPIO1_GPIO | PIN_OUTPUT_HIGH,
123 GPIO2_GPIO | PIN_INPUT_PULLUP,
124 GPIO3_GPIO | PIN_OUTPUT_HIGH,
126 GPIO29_U2_RXD | PIN_INPUT_PULLUP,
127 GPIO30_U2_TXD | PIN_OUTPUT_HIGH,
128 GPIO31_U2_CTSn | PIN_INPUT_PULLUP,
129 GPIO32_U2_RTSn | PIN_OUTPUT_HIGH,
131 /* Display & HDMI HW sync */
132 GPIO68_LCD_VSI0 | PIN_INPUT_PULLUP,
133 GPIO69_LCD_VSI1 | PIN_INPUT_PULLUP,
136 static pin_cfg_t mop500_pins_default[] = {
137 /* SSP0 */
138 GPIO143_SSP0_CLK,
139 GPIO144_SSP0_FRM,
140 GPIO145_SSP0_RXD | PIN_PULL_DOWN,
141 GPIO146_SSP0_TXD,
144 GPIO217_GPIO | PIN_INPUT_PULLUP, /* TC35892 IRQ */
146 /* SDI0 (MicroSD card) */
147 GPIO21_MC0_DAT31DIR | PIN_OUTPUT_HIGH,
149 /* UART */
150 GPIO4_U1_RXD | PIN_INPUT_PULLUP,
151 GPIO5_U1_TXD | PIN_OUTPUT_HIGH,
152 GPIO6_U1_CTSn | PIN_INPUT_PULLUP,
153 GPIO7_U1_RTSn | PIN_OUTPUT_HIGH,
156 static pin_cfg_t mop500_pins_hrefv60[] = {
157 /* WLAN */
158 GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
159 GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */
161 /* XENON Flashgun INTERFACE */
162 GPIO6_IP_GPIO0 | PIN_INPUT_PULLUP,/* XENON_FLASH_ID */
163 GPIO7_IP_GPIO1 | PIN_INPUT_PULLUP,/* XENON_READY */
164 GPIO170_GPIO | PIN_OUTPUT_LOW, /* XENON_CHARGE */
166 /* Assistant LED INTERFACE */
167 GPIO21_GPIO | PIN_OUTPUT_LOW, /* XENON_EN1 */
168 GPIO64_IP_GPIO4 | PIN_OUTPUT_LOW, /* XENON_EN2 */
170 /* Magnetometer */
171 GPIO31_GPIO | PIN_INPUT_PULLUP, /* magnetometer_INT */
172 GPIO32_GPIO | PIN_INPUT_PULLDOWN, /* Magnetometer DRDY */
174 /* Display Interface */
175 GPIO65_GPIO | PIN_OUTPUT_LOW, /* DISP1 RST */
176 GPIO66_GPIO | PIN_OUTPUT_LOW, /* DISP2 RST */
178 /* Touch screen INTERFACE */
179 GPIO143_GPIO | PIN_OUTPUT_LOW,/*TOUCH_RST1 */
181 /* Touch screen INTERFACE 2 */
182 GPIO67_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT2 */
183 GPIO146_GPIO | PIN_OUTPUT_LOW,/*TOUCH_RST2 */
185 /* ETM_PTM_TRACE INTERFACE */
186 GPIO70_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA23 */
187 GPIO71_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA22 */
188 GPIO72_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA21 */
189 GPIO73_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA20 */
190 GPIO74_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA19 */
192 /* NAHJ INTERFACE */
193 GPIO76_GPIO | PIN_OUTPUT_LOW,/* NAHJ_CTRL */
194 GPIO216_GPIO | PIN_OUTPUT_HIGH,/* NAHJ_CTRL_INV */
196 /* NFC INTERFACE */
197 GPIO77_GPIO | PIN_OUTPUT_LOW, /* NFC_ENA */
198 GPIO144_GPIO | PIN_INPUT_PULLDOWN, /* NFC_IRQ */
199 GPIO142_GPIO | PIN_OUTPUT_LOW, /* NFC_RESET */
201 /* Keyboard MATRIX INTERFACE */
202 GPIO90_MC5_CMD | PIN_OUTPUT_LOW, /* KP_O_1 */
203 GPIO87_MC5_DAT1 | PIN_OUTPUT_LOW, /* KP_O_2 */
204 GPIO86_MC5_DAT0 | PIN_OUTPUT_LOW, /* KP_O_3 */
205 GPIO96_KP_O6 | PIN_OUTPUT_LOW, /* KP_O_6 */
206 GPIO94_KP_O7 | PIN_OUTPUT_LOW, /* KP_O_7 */
207 GPIO93_MC5_DAT4 | PIN_INPUT_PULLUP, /* KP_I_0 */
208 GPIO89_MC5_DAT3 | PIN_INPUT_PULLUP, /* KP_I_2 */
209 GPIO88_MC5_DAT2 | PIN_INPUT_PULLUP, /* KP_I_3 */
210 GPIO91_GPIO | PIN_INPUT_PULLUP, /* FORCE_SENSING_INT */
211 GPIO92_GPIO | PIN_OUTPUT_LOW, /* FORCE_SENSING_RST */
212 GPIO97_GPIO | PIN_OUTPUT_LOW, /* FORCE_SENSING_WU */
214 /* DiPro Sensor Interface */
215 GPIO139_GPIO | PIN_INPUT_PULLUP, /* DIPRO_INT */
217 /* HAL SWITCH INTERFACE */
218 GPIO145_GPIO | PIN_INPUT_PULLDOWN,/* HAL_SW */
220 /* Audio Amplifier Interface */
221 GPIO149_GPIO | PIN_OUTPUT_LOW, /* VAUDIO_HF_EN */
223 /* GBF INTERFACE */
224 GPIO171_GPIO | PIN_OUTPUT_LOW, /* GBF_ENA_RESET */
226 /* MSP : HDTV INTERFACE */
227 GPIO192_GPIO | PIN_INPUT_PULLDOWN,
229 /* ACCELEROMETER_INTERFACE */
230 GPIO82_GPIO | PIN_INPUT_PULLUP, /* ACC_INT1 */
231 GPIO83_GPIO | PIN_INPUT_PULLUP, /* ACC_INT2 */
233 /* Proximity Sensor */
234 GPIO217_GPIO | PIN_INPUT_PULLUP,
239 static pin_cfg_t snowball_pins[] = {
240 /* SSP0, to AB8500 */
241 GPIO143_SSP0_CLK,
242 GPIO144_SSP0_FRM,
243 GPIO145_SSP0_RXD | PIN_PULL_DOWN,
244 GPIO146_SSP0_TXD,
246 /* MMC0: MicroSD card */
247 GPIO21_MC0_DAT31DIR | PIN_OUTPUT_HIGH,
249 /* MMC2: LAN */
250 GPIO86_SM_ADQ0,
251 GPIO87_SM_ADQ1,
252 GPIO88_SM_ADQ2,
253 GPIO89_SM_ADQ3,
254 GPIO90_SM_ADQ4,
255 GPIO91_SM_ADQ5,
256 GPIO92_SM_ADQ6,
257 GPIO93_SM_ADQ7,
259 GPIO94_SM_ADVn,
260 GPIO95_SM_CS0n,
261 GPIO96_SM_OEn,
262 GPIO97_SM_WEn,
264 GPIO128_SM_CKO,
265 GPIO130_SM_FBCLK,
266 GPIO131_SM_ADQ8,
267 GPIO132_SM_ADQ9,
268 GPIO133_SM_ADQ10,
269 GPIO134_SM_ADQ11,
270 GPIO135_SM_ADQ12,
271 GPIO136_SM_ADQ13,
272 GPIO137_SM_ADQ14,
273 GPIO138_SM_ADQ15,
275 /* RSTn_LAN */
276 GPIO141_GPIO | PIN_OUTPUT_HIGH,
279 void __init mop500_pins_init(void)
281 nmk_config_pins(mop500_pins_common,
282 ARRAY_SIZE(mop500_pins_common));
283 if (machine_is_hrefv60())
284 nmk_config_pins(mop500_pins_hrefv60,
285 ARRAY_SIZE(mop500_pins_hrefv60));
286 else if (machine_is_snowball())
287 nmk_config_pins(snowball_pins,
288 ARRAY_SIZE(snowball_pins));
289 else
290 nmk_config_pins(mop500_pins_default,
291 ARRAY_SIZE(mop500_pins_default));