blob: d5dbc22c18d0b1717ecba69fddd1df892fcb0aaf [file] [log] [blame]
Minkyu Kang399e5ae2009-10-01 17:20:01 +09001/*
2 * (C) Copyright 2009 Samsung Electronics
3 * Minkyu Kang <mk7.kang@samsung.com>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Minkyu Kang399e5ae2009-10-01 17:20:01 +09006 */
7
8#ifndef __ASM_ARCH_GPIO_H
9#define __ASM_ARCH_GPIO_H
10
11#ifndef __ASSEMBLY__
Minkyu Kang3bb6b032010-03-24 15:31:06 +090012struct s5p_gpio_bank {
Minkyu Kangf3807372009-10-15 11:19:15 +090013 unsigned int con;
14 unsigned int dat;
15 unsigned int pull;
16 unsigned int drv;
17 unsigned int pdn_con;
18 unsigned int pdn_pull;
Minkyu Kang399e5ae2009-10-01 17:20:01 +090019 unsigned char res1[8];
20};
21
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053022/* A list of valid GPIO numbers for the asm-generic/gpio.h interface */
23enum s5pc100_gpio_pin {
24 S5PC100_GPIO_A00,
25 S5PC100_GPIO_A01,
26 S5PC100_GPIO_A02,
27 S5PC100_GPIO_A03,
28 S5PC100_GPIO_A04,
29 S5PC100_GPIO_A05,
30 S5PC100_GPIO_A06,
31 S5PC100_GPIO_A07,
32 S5PC100_GPIO_A10,
33 S5PC100_GPIO_A11,
34 S5PC100_GPIO_A12,
35 S5PC100_GPIO_A13,
36 S5PC100_GPIO_A14,
37 S5PC100_GPIO_A15,
38 S5PC100_GPIO_A16,
39 S5PC100_GPIO_A17,
40 S5PC100_GPIO_B0,
41 S5PC100_GPIO_B1,
42 S5PC100_GPIO_B2,
43 S5PC100_GPIO_B3,
44 S5PC100_GPIO_B4,
45 S5PC100_GPIO_B5,
46 S5PC100_GPIO_B6,
47 S5PC100_GPIO_B7,
48 S5PC100_GPIO_C0,
49 S5PC100_GPIO_C1,
50 S5PC100_GPIO_C2,
51 S5PC100_GPIO_C3,
52 S5PC100_GPIO_C4,
53 S5PC100_GPIO_C5,
54 S5PC100_GPIO_C6,
55 S5PC100_GPIO_C7,
56 S5PC100_GPIO_D0,
57 S5PC100_GPIO_D1,
58 S5PC100_GPIO_D2,
59 S5PC100_GPIO_D3,
60 S5PC100_GPIO_D4,
61 S5PC100_GPIO_D5,
62 S5PC100_GPIO_D6,
63 S5PC100_GPIO_D7,
64 S5PC100_GPIO_E00,
65 S5PC100_GPIO_E01,
66 S5PC100_GPIO_E02,
67 S5PC100_GPIO_E03,
68 S5PC100_GPIO_E04,
69 S5PC100_GPIO_E05,
70 S5PC100_GPIO_E06,
71 S5PC100_GPIO_E07,
72 S5PC100_GPIO_E10,
73 S5PC100_GPIO_E11,
74 S5PC100_GPIO_E12,
75 S5PC100_GPIO_E13,
76 S5PC100_GPIO_E14,
77 S5PC100_GPIO_E15,
78 S5PC100_GPIO_E16,
79 S5PC100_GPIO_E17,
80 S5PC100_GPIO_F00,
81 S5PC100_GPIO_F01,
82 S5PC100_GPIO_F02,
83 S5PC100_GPIO_F03,
84 S5PC100_GPIO_F04,
85 S5PC100_GPIO_F05,
86 S5PC100_GPIO_F06,
87 S5PC100_GPIO_F07,
88 S5PC100_GPIO_F10,
89 S5PC100_GPIO_F11,
90 S5PC100_GPIO_F12,
91 S5PC100_GPIO_F13,
92 S5PC100_GPIO_F14,
93 S5PC100_GPIO_F15,
94 S5PC100_GPIO_F16,
95 S5PC100_GPIO_F17,
96 S5PC100_GPIO_F20,
97 S5PC100_GPIO_F21,
98 S5PC100_GPIO_F22,
99 S5PC100_GPIO_F23,
100 S5PC100_GPIO_F24,
101 S5PC100_GPIO_F25,
102 S5PC100_GPIO_F26,
103 S5PC100_GPIO_F27,
104 S5PC100_GPIO_F30,
105 S5PC100_GPIO_F31,
106 S5PC100_GPIO_F32,
107 S5PC100_GPIO_F33,
108 S5PC100_GPIO_F34,
109 S5PC100_GPIO_F35,
110 S5PC100_GPIO_F36,
111 S5PC100_GPIO_F37,
112 S5PC100_GPIO_G00,
113 S5PC100_GPIO_G01,
114 S5PC100_GPIO_G02,
115 S5PC100_GPIO_G03,
116 S5PC100_GPIO_G04,
117 S5PC100_GPIO_G05,
118 S5PC100_GPIO_G06,
119 S5PC100_GPIO_G07,
120 S5PC100_GPIO_G10,
121 S5PC100_GPIO_G11,
122 S5PC100_GPIO_G12,
123 S5PC100_GPIO_G13,
124 S5PC100_GPIO_G14,
125 S5PC100_GPIO_G15,
126 S5PC100_GPIO_G16,
127 S5PC100_GPIO_G17,
128 S5PC100_GPIO_G20,
129 S5PC100_GPIO_G21,
130 S5PC100_GPIO_G22,
131 S5PC100_GPIO_G23,
132 S5PC100_GPIO_G24,
133 S5PC100_GPIO_G25,
134 S5PC100_GPIO_G26,
135 S5PC100_GPIO_G27,
136 S5PC100_GPIO_G30,
137 S5PC100_GPIO_G31,
138 S5PC100_GPIO_G32,
139 S5PC100_GPIO_G33,
140 S5PC100_GPIO_G34,
141 S5PC100_GPIO_G35,
142 S5PC100_GPIO_G36,
143 S5PC100_GPIO_G37,
144 S5PC100_GPIO_I0,
145 S5PC100_GPIO_I1,
146 S5PC100_GPIO_I2,
147 S5PC100_GPIO_I3,
148 S5PC100_GPIO_I4,
149 S5PC100_GPIO_I5,
150 S5PC100_GPIO_I6,
151 S5PC100_GPIO_I7,
152 S5PC100_GPIO_J00,
153 S5PC100_GPIO_J01,
154 S5PC100_GPIO_J02,
155 S5PC100_GPIO_J03,
156 S5PC100_GPIO_J04,
157 S5PC100_GPIO_J05,
158 S5PC100_GPIO_J06,
159 S5PC100_GPIO_J07,
160 S5PC100_GPIO_J10,
161 S5PC100_GPIO_J11,
162 S5PC100_GPIO_J12,
163 S5PC100_GPIO_J13,
164 S5PC100_GPIO_J14,
165 S5PC100_GPIO_J15,
166 S5PC100_GPIO_J16,
167 S5PC100_GPIO_J17,
168 S5PC100_GPIO_J20,
169 S5PC100_GPIO_J21,
170 S5PC100_GPIO_J22,
171 S5PC100_GPIO_J23,
172 S5PC100_GPIO_J24,
173 S5PC100_GPIO_J25,
174 S5PC100_GPIO_J26,
175 S5PC100_GPIO_J27,
176 S5PC100_GPIO_J30,
177 S5PC100_GPIO_J31,
178 S5PC100_GPIO_J32,
179 S5PC100_GPIO_J33,
180 S5PC100_GPIO_J34,
181 S5PC100_GPIO_J35,
182 S5PC100_GPIO_J36,
183 S5PC100_GPIO_J37,
184 S5PC100_GPIO_J40,
185 S5PC100_GPIO_J41,
186 S5PC100_GPIO_J42,
187 S5PC100_GPIO_J43,
188 S5PC100_GPIO_J44,
189 S5PC100_GPIO_J45,
190 S5PC100_GPIO_J46,
191 S5PC100_GPIO_J47,
192 S5PC100_GPIO_K00,
193 S5PC100_GPIO_K01,
194 S5PC100_GPIO_K02,
195 S5PC100_GPIO_K03,
196 S5PC100_GPIO_K04,
197 S5PC100_GPIO_K05,
198 S5PC100_GPIO_K06,
199 S5PC100_GPIO_K07,
200 S5PC100_GPIO_K10,
201 S5PC100_GPIO_K11,
202 S5PC100_GPIO_K12,
203 S5PC100_GPIO_K13,
204 S5PC100_GPIO_K14,
205 S5PC100_GPIO_K15,
206 S5PC100_GPIO_K16,
207 S5PC100_GPIO_K17,
208 S5PC100_GPIO_K20,
209 S5PC100_GPIO_K21,
210 S5PC100_GPIO_K22,
211 S5PC100_GPIO_K23,
212 S5PC100_GPIO_K24,
213 S5PC100_GPIO_K25,
214 S5PC100_GPIO_K26,
215 S5PC100_GPIO_K27,
216 S5PC100_GPIO_K30,
217 S5PC100_GPIO_K31,
218 S5PC100_GPIO_K32,
219 S5PC100_GPIO_K33,
220 S5PC100_GPIO_K34,
221 S5PC100_GPIO_K35,
222 S5PC100_GPIO_K36,
223 S5PC100_GPIO_K37,
224 S5PC100_GPIO_L00,
225 S5PC100_GPIO_L01,
226 S5PC100_GPIO_L02,
227 S5PC100_GPIO_L03,
228 S5PC100_GPIO_L04,
229 S5PC100_GPIO_L05,
230 S5PC100_GPIO_L06,
231 S5PC100_GPIO_L07,
232 S5PC100_GPIO_L10,
233 S5PC100_GPIO_L11,
234 S5PC100_GPIO_L12,
235 S5PC100_GPIO_L13,
236 S5PC100_GPIO_L14,
237 S5PC100_GPIO_L15,
238 S5PC100_GPIO_L16,
239 S5PC100_GPIO_L17,
240 S5PC100_GPIO_L20,
241 S5PC100_GPIO_L21,
242 S5PC100_GPIO_L22,
243 S5PC100_GPIO_L23,
244 S5PC100_GPIO_L24,
245 S5PC100_GPIO_L25,
246 S5PC100_GPIO_L26,
247 S5PC100_GPIO_L27,
248 S5PC100_GPIO_L30,
249 S5PC100_GPIO_L31,
250 S5PC100_GPIO_L32,
251 S5PC100_GPIO_L33,
252 S5PC100_GPIO_L34,
253 S5PC100_GPIO_L35,
254 S5PC100_GPIO_L36,
255 S5PC100_GPIO_L37,
256 S5PC100_GPIO_L40,
257 S5PC100_GPIO_L41,
258 S5PC100_GPIO_L42,
259 S5PC100_GPIO_L43,
260 S5PC100_GPIO_L44,
261 S5PC100_GPIO_L45,
262 S5PC100_GPIO_L46,
263 S5PC100_GPIO_L47,
264 S5PC100_GPIO_H00,
265 S5PC100_GPIO_H01,
266 S5PC100_GPIO_H02,
267 S5PC100_GPIO_H03,
268 S5PC100_GPIO_H04,
269 S5PC100_GPIO_H05,
270 S5PC100_GPIO_H06,
271 S5PC100_GPIO_H07,
272 S5PC100_GPIO_H10,
273 S5PC100_GPIO_H11,
274 S5PC100_GPIO_H12,
275 S5PC100_GPIO_H13,
276 S5PC100_GPIO_H14,
277 S5PC100_GPIO_H15,
278 S5PC100_GPIO_H16,
279 S5PC100_GPIO_H17,
280 S5PC100_GPIO_H20,
281 S5PC100_GPIO_H21,
282 S5PC100_GPIO_H22,
283 S5PC100_GPIO_H23,
284 S5PC100_GPIO_H24,
285 S5PC100_GPIO_H25,
286 S5PC100_GPIO_H26,
287 S5PC100_GPIO_H27,
288 S5PC100_GPIO_H30,
289 S5PC100_GPIO_H31,
290 S5PC100_GPIO_H32,
291 S5PC100_GPIO_H33,
292 S5PC100_GPIO_H34,
293 S5PC100_GPIO_H35,
294 S5PC100_GPIO_H36,
295 S5PC100_GPIO_H37,
296
297 S5PC100_GPIO_MAX_PORT
Minkyu Kang399e5ae2009-10-01 17:20:01 +0900298};
299
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +0530300enum s5pc110_gpio_pin {
301 S5PC110_GPIO_A00,
302 S5PC110_GPIO_A01,
303 S5PC110_GPIO_A02,
304 S5PC110_GPIO_A03,
305 S5PC110_GPIO_A04,
306 S5PC110_GPIO_A05,
307 S5PC110_GPIO_A06,
308 S5PC110_GPIO_A07,
309 S5PC110_GPIO_A10,
310 S5PC110_GPIO_A11,
311 S5PC110_GPIO_A12,
312 S5PC110_GPIO_A13,
313 S5PC110_GPIO_A14,
314 S5PC110_GPIO_A15,
315 S5PC110_GPIO_A16,
316 S5PC110_GPIO_A17,
317 S5PC110_GPIO_B0,
318 S5PC110_GPIO_B1,
319 S5PC110_GPIO_B2,
320 S5PC110_GPIO_B3,
321 S5PC110_GPIO_B4,
322 S5PC110_GPIO_B5,
323 S5PC110_GPIO_B6,
324 S5PC110_GPIO_B7,
325 S5PC110_GPIO_C00,
326 S5PC110_GPIO_C01,
327 S5PC110_GPIO_C02,
328 S5PC110_GPIO_C03,
329 S5PC110_GPIO_C04,
330 S5PC110_GPIO_C05,
331 S5PC110_GPIO_C06,
332 S5PC110_GPIO_C07,
333 S5PC110_GPIO_C10,
334 S5PC110_GPIO_C11,
335 S5PC110_GPIO_C12,
336 S5PC110_GPIO_C13,
337 S5PC110_GPIO_C14,
338 S5PC110_GPIO_C15,
339 S5PC110_GPIO_C16,
340 S5PC110_GPIO_C17,
341 S5PC110_GPIO_D00,
342 S5PC110_GPIO_D01,
343 S5PC110_GPIO_D02,
344 S5PC110_GPIO_D03,
345 S5PC110_GPIO_D04,
346 S5PC110_GPIO_D05,
347 S5PC110_GPIO_D06,
348 S5PC110_GPIO_D07,
349 S5PC110_GPIO_D10,
350 S5PC110_GPIO_D11,
351 S5PC110_GPIO_D12,
352 S5PC110_GPIO_D13,
353 S5PC110_GPIO_D14,
354 S5PC110_GPIO_D15,
355 S5PC110_GPIO_D16,
356 S5PC110_GPIO_D17,
357 S5PC110_GPIO_E00,
358 S5PC110_GPIO_E01,
359 S5PC110_GPIO_E02,
360 S5PC110_GPIO_E03,
361 S5PC110_GPIO_E04,
362 S5PC110_GPIO_E05,
363 S5PC110_GPIO_E06,
364 S5PC110_GPIO_E07,
365 S5PC110_GPIO_E10,
366 S5PC110_GPIO_E11,
367 S5PC110_GPIO_E12,
368 S5PC110_GPIO_E13,
369 S5PC110_GPIO_E14,
370 S5PC110_GPIO_E15,
371 S5PC110_GPIO_E16,
372 S5PC110_GPIO_E17,
373 S5PC110_GPIO_F00,
374 S5PC110_GPIO_F01,
375 S5PC110_GPIO_F02,
376 S5PC110_GPIO_F03,
377 S5PC110_GPIO_F04,
378 S5PC110_GPIO_F05,
379 S5PC110_GPIO_F06,
380 S5PC110_GPIO_F07,
381 S5PC110_GPIO_F10,
382 S5PC110_GPIO_F11,
383 S5PC110_GPIO_F12,
384 S5PC110_GPIO_F13,
385 S5PC110_GPIO_F14,
386 S5PC110_GPIO_F15,
387 S5PC110_GPIO_F16,
388 S5PC110_GPIO_F17,
389 S5PC110_GPIO_F20,
390 S5PC110_GPIO_F21,
391 S5PC110_GPIO_F22,
392 S5PC110_GPIO_F23,
393 S5PC110_GPIO_F24,
394 S5PC110_GPIO_F25,
395 S5PC110_GPIO_F26,
396 S5PC110_GPIO_F27,
397 S5PC110_GPIO_F30,
398 S5PC110_GPIO_F31,
399 S5PC110_GPIO_F32,
400 S5PC110_GPIO_F33,
401 S5PC110_GPIO_F34,
402 S5PC110_GPIO_F35,
403 S5PC110_GPIO_F36,
404 S5PC110_GPIO_F37,
405 S5PC110_GPIO_G00,
406 S5PC110_GPIO_G01,
407 S5PC110_GPIO_G02,
408 S5PC110_GPIO_G03,
409 S5PC110_GPIO_G04,
410 S5PC110_GPIO_G05,
411 S5PC110_GPIO_G06,
412 S5PC110_GPIO_G07,
413 S5PC110_GPIO_G10,
414 S5PC110_GPIO_G11,
415 S5PC110_GPIO_G12,
416 S5PC110_GPIO_G13,
417 S5PC110_GPIO_G14,
418 S5PC110_GPIO_G15,
419 S5PC110_GPIO_G16,
420 S5PC110_GPIO_G17,
421 S5PC110_GPIO_G20,
422 S5PC110_GPIO_G21,
423 S5PC110_GPIO_G22,
424 S5PC110_GPIO_G23,
425 S5PC110_GPIO_G24,
426 S5PC110_GPIO_G25,
427 S5PC110_GPIO_G26,
428 S5PC110_GPIO_G27,
429 S5PC110_GPIO_G30,
430 S5PC110_GPIO_G31,
431 S5PC110_GPIO_G32,
432 S5PC110_GPIO_G33,
433 S5PC110_GPIO_G34,
434 S5PC110_GPIO_G35,
435 S5PC110_GPIO_G36,
436 S5PC110_GPIO_G37,
437 S5PC110_GPIO_I0,
438 S5PC110_GPIO_I1,
439 S5PC110_GPIO_I2,
440 S5PC110_GPIO_I3,
441 S5PC110_GPIO_I4,
442 S5PC110_GPIO_I5,
443 S5PC110_GPIO_I6,
444 S5PC110_GPIO_I7,
445 S5PC110_GPIO_J00,
446 S5PC110_GPIO_J01,
447 S5PC110_GPIO_J02,
448 S5PC110_GPIO_J03,
449 S5PC110_GPIO_J04,
450 S5PC110_GPIO_J05,
451 S5PC110_GPIO_J06,
452 S5PC110_GPIO_J07,
453 S5PC110_GPIO_J10,
454 S5PC110_GPIO_J11,
455 S5PC110_GPIO_J12,
456 S5PC110_GPIO_J13,
457 S5PC110_GPIO_J14,
458 S5PC110_GPIO_J15,
459 S5PC110_GPIO_J16,
460 S5PC110_GPIO_J17,
461 S5PC110_GPIO_J20,
462 S5PC110_GPIO_J21,
463 S5PC110_GPIO_J22,
464 S5PC110_GPIO_J23,
465 S5PC110_GPIO_J24,
466 S5PC110_GPIO_J25,
467 S5PC110_GPIO_J26,
468 S5PC110_GPIO_J27,
469 S5PC110_GPIO_J30,
470 S5PC110_GPIO_J31,
471 S5PC110_GPIO_J32,
472 S5PC110_GPIO_J33,
473 S5PC110_GPIO_J34,
474 S5PC110_GPIO_J35,
475 S5PC110_GPIO_J36,
476 S5PC110_GPIO_J37,
477 S5PC110_GPIO_J40,
478 S5PC110_GPIO_J41,
479 S5PC110_GPIO_J42,
480 S5PC110_GPIO_J43,
481 S5PC110_GPIO_J44,
482 S5PC110_GPIO_J45,
483 S5PC110_GPIO_J46,
484 S5PC110_GPIO_J47,
485 S5PC110_GPIO_MP010,
486 S5PC110_GPIO_MP011,
487 S5PC110_GPIO_MP012,
488 S5PC110_GPIO_MP013,
489 S5PC110_GPIO_MP014,
490 S5PC110_GPIO_MP015,
491 S5PC110_GPIO_MP016,
492 S5PC110_GPIO_MP017,
493 S5PC110_GPIO_MP020,
494 S5PC110_GPIO_MP021,
495 S5PC110_GPIO_MP022,
496 S5PC110_GPIO_MP023,
497 S5PC110_GPIO_MP024,
498 S5PC110_GPIO_MP025,
499 S5PC110_GPIO_MP026,
500 S5PC110_GPIO_MP027,
501 S5PC110_GPIO_MP030,
502 S5PC110_GPIO_MP031,
503 S5PC110_GPIO_MP032,
504 S5PC110_GPIO_MP033,
505 S5PC110_GPIO_MP034,
506 S5PC110_GPIO_MP035,
507 S5PC110_GPIO_MP036,
508 S5PC110_GPIO_MP037,
509 S5PC110_GPIO_MP040,
510 S5PC110_GPIO_MP041,
511 S5PC110_GPIO_MP042,
512 S5PC110_GPIO_MP043,
513 S5PC110_GPIO_MP044,
514 S5PC110_GPIO_MP045,
515 S5PC110_GPIO_MP046,
516 S5PC110_GPIO_MP047,
517 S5PC110_GPIO_MP050,
518 S5PC110_GPIO_MP051,
519 S5PC110_GPIO_MP052,
520 S5PC110_GPIO_MP053,
521 S5PC110_GPIO_MP054,
522 S5PC110_GPIO_MP055,
523 S5PC110_GPIO_MP056,
524 S5PC110_GPIO_MP057,
525 S5PC110_GPIO_MP060,
526 S5PC110_GPIO_MP061,
527 S5PC110_GPIO_MP062,
528 S5PC110_GPIO_MP063,
529 S5PC110_GPIO_MP064,
530 S5PC110_GPIO_MP065,
531 S5PC110_GPIO_MP066,
532 S5PC110_GPIO_MP067,
533 S5PC110_GPIO_MP070,
534 S5PC110_GPIO_MP071,
535 S5PC110_GPIO_MP072,
536 S5PC110_GPIO_MP073,
537 S5PC110_GPIO_MP074,
538 S5PC110_GPIO_MP075,
539 S5PC110_GPIO_MP076,
540 S5PC110_GPIO_MP077,
541 S5PC110_GPIO_MP100,
542 S5PC110_GPIO_MP101,
543 S5PC110_GPIO_MP102,
544 S5PC110_GPIO_MP103,
545 S5PC110_GPIO_MP104,
546 S5PC110_GPIO_MP105,
547 S5PC110_GPIO_MP106,
548 S5PC110_GPIO_MP107,
549 S5PC110_GPIO_MP110,
550 S5PC110_GPIO_MP111,
551 S5PC110_GPIO_MP112,
552 S5PC110_GPIO_MP113,
553 S5PC110_GPIO_MP114,
554 S5PC110_GPIO_MP115,
555 S5PC110_GPIO_MP116,
556 S5PC110_GPIO_MP117,
557 S5PC110_GPIO_MP120,
558 S5PC110_GPIO_MP121,
559 S5PC110_GPIO_MP122,
560 S5PC110_GPIO_MP123,
561 S5PC110_GPIO_MP124,
562 S5PC110_GPIO_MP125,
563 S5PC110_GPIO_MP126,
564 S5PC110_GPIO_MP127,
565 S5PC110_GPIO_MP130,
566 S5PC110_GPIO_MP131,
567 S5PC110_GPIO_MP132,
568 S5PC110_GPIO_MP133,
569 S5PC110_GPIO_MP134,
570 S5PC110_GPIO_MP135,
571 S5PC110_GPIO_MP136,
572 S5PC110_GPIO_MP137,
573 S5PC110_GPIO_MP140,
574 S5PC110_GPIO_MP141,
575 S5PC110_GPIO_MP142,
576 S5PC110_GPIO_MP143,
577 S5PC110_GPIO_MP144,
578 S5PC110_GPIO_MP145,
579 S5PC110_GPIO_MP146,
580 S5PC110_GPIO_MP147,
581 S5PC110_GPIO_MP150,
582 S5PC110_GPIO_MP151,
583 S5PC110_GPIO_MP152,
584 S5PC110_GPIO_MP153,
585 S5PC110_GPIO_MP154,
586 S5PC110_GPIO_MP155,
587 S5PC110_GPIO_MP156,
588 S5PC110_GPIO_MP157,
589 S5PC110_GPIO_MP160,
590 S5PC110_GPIO_MP161,
591 S5PC110_GPIO_MP162,
592 S5PC110_GPIO_MP163,
593 S5PC110_GPIO_MP164,
594 S5PC110_GPIO_MP165,
595 S5PC110_GPIO_MP166,
596 S5PC110_GPIO_MP167,
597 S5PC110_GPIO_MP170,
598 S5PC110_GPIO_MP171,
599 S5PC110_GPIO_MP172,
600 S5PC110_GPIO_MP173,
601 S5PC110_GPIO_MP174,
602 S5PC110_GPIO_MP175,
603 S5PC110_GPIO_MP176,
604 S5PC110_GPIO_MP177,
605 S5PC110_GPIO_MP180,
606 S5PC110_GPIO_MP181,
607 S5PC110_GPIO_MP182,
608 S5PC110_GPIO_MP183,
609 S5PC110_GPIO_MP184,
610 S5PC110_GPIO_MP185,
611 S5PC110_GPIO_MP186,
612 S5PC110_GPIO_MP187,
613 S5PC110_GPIO_MP200,
614 S5PC110_GPIO_MP201,
615 S5PC110_GPIO_MP202,
616 S5PC110_GPIO_MP203,
617 S5PC110_GPIO_MP204,
618 S5PC110_GPIO_MP205,
619 S5PC110_GPIO_MP206,
620 S5PC110_GPIO_MP207,
621 S5PC110_GPIO_MP210,
622 S5PC110_GPIO_MP211,
623 S5PC110_GPIO_MP212,
624 S5PC110_GPIO_MP213,
625 S5PC110_GPIO_MP214,
626 S5PC110_GPIO_MP215,
627 S5PC110_GPIO_MP216,
628 S5PC110_GPIO_MP217,
629 S5PC110_GPIO_MP220,
630 S5PC110_GPIO_MP221,
631 S5PC110_GPIO_MP222,
632 S5PC110_GPIO_MP223,
633 S5PC110_GPIO_MP224,
634 S5PC110_GPIO_MP225,
635 S5PC110_GPIO_MP226,
636 S5PC110_GPIO_MP227,
637 S5PC110_GPIO_MP230,
638 S5PC110_GPIO_MP231,
639 S5PC110_GPIO_MP232,
640 S5PC110_GPIO_MP233,
641 S5PC110_GPIO_MP234,
642 S5PC110_GPIO_MP235,
643 S5PC110_GPIO_MP236,
644 S5PC110_GPIO_MP237,
645 S5PC110_GPIO_MP240,
646 S5PC110_GPIO_MP241,
647 S5PC110_GPIO_MP242,
648 S5PC110_GPIO_MP243,
649 S5PC110_GPIO_MP244,
650 S5PC110_GPIO_MP245,
651 S5PC110_GPIO_MP246,
652 S5PC110_GPIO_MP247,
653 S5PC110_GPIO_MP250,
654 S5PC110_GPIO_MP251,
655 S5PC110_GPIO_MP252,
656 S5PC110_GPIO_MP253,
657 S5PC110_GPIO_MP254,
658 S5PC110_GPIO_MP255,
659 S5PC110_GPIO_MP256,
660 S5PC110_GPIO_MP257,
661 S5PC110_GPIO_MP260,
662 S5PC110_GPIO_MP261,
663 S5PC110_GPIO_MP262,
664 S5PC110_GPIO_MP263,
665 S5PC110_GPIO_MP264,
666 S5PC110_GPIO_MP265,
667 S5PC110_GPIO_MP266,
668 S5PC110_GPIO_MP267,
669 S5PC110_GPIO_MP270,
670 S5PC110_GPIO_MP271,
671 S5PC110_GPIO_MP272,
672 S5PC110_GPIO_MP273,
673 S5PC110_GPIO_MP274,
674 S5PC110_GPIO_MP275,
675 S5PC110_GPIO_MP276,
676 S5PC110_GPIO_MP277,
677 S5PC110_GPIO_MP280,
678 S5PC110_GPIO_MP281,
679 S5PC110_GPIO_MP282,
680 S5PC110_GPIO_MP283,
681 S5PC110_GPIO_MP284,
682 S5PC110_GPIO_MP285,
683 S5PC110_GPIO_MP286,
684 S5PC110_GPIO_MP287,
685 S5PC110_GPIO_RES,
686 S5PC110_GPIO_H00 = (S5PC110_GPIO_RES + (48 * 8)),
687 S5PC110_GPIO_H01,
688 S5PC110_GPIO_H02,
689 S5PC110_GPIO_H03,
690 S5PC110_GPIO_H04,
691 S5PC110_GPIO_H05,
692 S5PC110_GPIO_H06,
693 S5PC110_GPIO_H07,
694 S5PC110_GPIO_H10,
695 S5PC110_GPIO_H11,
696 S5PC110_GPIO_H12,
697 S5PC110_GPIO_H13,
698 S5PC110_GPIO_H14,
699 S5PC110_GPIO_H15,
700 S5PC110_GPIO_H16,
701 S5PC110_GPIO_H17,
702 S5PC110_GPIO_H20,
703 S5PC110_GPIO_H21,
704 S5PC110_GPIO_H22,
705 S5PC110_GPIO_H23,
706 S5PC110_GPIO_H24,
707 S5PC110_GPIO_H25,
708 S5PC110_GPIO_H26,
709 S5PC110_GPIO_H27,
710 S5PC110_GPIO_H30,
711 S5PC110_GPIO_H31,
712 S5PC110_GPIO_H32,
713 S5PC110_GPIO_H33,
714 S5PC110_GPIO_H34,
715 S5PC110_GPIO_H35,
716 S5PC110_GPIO_H36,
717 S5PC110_GPIO_H37,
718
719 S5PC110_GPIO_MAX_PORT
720};
721
722struct gpio_info {
723 unsigned int reg_addr; /* Address of register for this part */
724 unsigned int max_gpio; /* Maximum GPIO in this part */
725};
726
727#define S5PC100_GPIO_NUM_PARTS 1
728static struct gpio_info s5pc100_gpio_data[S5PC100_GPIO_NUM_PARTS] = {
729 { S5PC100_GPIO_BASE, S5PC100_GPIO_MAX_PORT },
730};
731
732#define S5PC110_GPIO_NUM_PARTS 1
733static struct gpio_info s5pc110_gpio_data[S5PC110_GPIO_NUM_PARTS] = {
734 { S5PC110_GPIO_BASE, S5PC110_GPIO_MAX_PORT },
735};
736
737static inline struct gpio_info *get_gpio_data(void)
738{
739 if (cpu_is_s5pc100())
740 return s5pc100_gpio_data;
741 else if (cpu_is_s5pc110())
742 return s5pc110_gpio_data;
743
744 return NULL;
745}
746
747static inline unsigned int get_bank_num(void)
748{
749 if (cpu_is_s5pc100())
750 return S5PC100_GPIO_NUM_PARTS;
751 else if (cpu_is_s5pc110())
752 return S5PC110_GPIO_NUM_PARTS;
753
754 return 0;
755}
756
757/*
758 * This structure helps mapping symbolic GPIO names into indices from
759 * exynos5_gpio_pin/exynos5420_gpio_pin enums.
760 *
761 * By convention, symbolic GPIO name is defined as follows:
762 *
763 * g[p]<bank><set><bit>, where
764 * p is optional
765 * <bank> - a single character bank name, as defined by the SOC
766 * <set> - a single digit set number
767 * <bit> - bit number within the set (in 0..7 range).
768 *
769 * <set><bit> essentially form an octal number of the GPIO pin within the bank
770 * space. On the 5420 architecture some banks' sets do not start not from zero
771 * ('d' starts from 1 and 'j' starts from 4). To compensate for that and
772 * maintain flat number space withoout holes, those banks use offsets to be
773 * deducted from the pin number.
774 */
775struct gpio_name_num_table {
776 char bank; /* bank name symbol */
777 u8 bank_size; /* total number of pins in the bank */
778 char bank_offset; /* offset of the first bank's pin */
779 unsigned int base; /* index of the first bank's pin in the enum */
780};
781
782#define GPIO_PER_BANK 8
783#define GPIO_ENTRY(name, base, top, offset) { name, top - base, offset, base }
784static const struct gpio_name_num_table s5pc100_gpio_table[] = {
785 GPIO_ENTRY('a', S5PC100_GPIO_A00, S5PC100_GPIO_B0, 0),
786 GPIO_ENTRY('b', S5PC100_GPIO_B0, S5PC100_GPIO_C0, 0),
787 GPIO_ENTRY('c', S5PC100_GPIO_C0, S5PC100_GPIO_D0, 0),
788 GPIO_ENTRY('d', S5PC100_GPIO_D0, S5PC100_GPIO_E00, 0),
789 GPIO_ENTRY('e', S5PC100_GPIO_E00, S5PC100_GPIO_F00, 0),
790 GPIO_ENTRY('f', S5PC100_GPIO_F00, S5PC100_GPIO_G00, 0),
791 GPIO_ENTRY('g', S5PC100_GPIO_G00, S5PC100_GPIO_I0, 0),
792 GPIO_ENTRY('i', S5PC100_GPIO_I0, S5PC100_GPIO_J00, 0),
793 GPIO_ENTRY('j', S5PC100_GPIO_J00, S5PC100_GPIO_K00, 0),
794 GPIO_ENTRY('k', S5PC100_GPIO_K00, S5PC100_GPIO_L00, 0),
795 GPIO_ENTRY('l', S5PC100_GPIO_L00, S5PC100_GPIO_H00, 0),
796 GPIO_ENTRY('h', S5PC100_GPIO_H00, S5PC100_GPIO_MAX_PORT, 0),
797 { 0 }
798};
799
800static const struct gpio_name_num_table s5pc110_gpio_table[] = {
801 GPIO_ENTRY('a', S5PC110_GPIO_A00, S5PC110_GPIO_B0, 0),
802 GPIO_ENTRY('b', S5PC110_GPIO_B0, S5PC110_GPIO_C00, 0),
803 GPIO_ENTRY('c', S5PC110_GPIO_C00, S5PC110_GPIO_D00, 0),
804 GPIO_ENTRY('d', S5PC110_GPIO_D00, S5PC110_GPIO_E00, 0),
805 GPIO_ENTRY('e', S5PC110_GPIO_E00, S5PC110_GPIO_F00, 0),
806 GPIO_ENTRY('f', S5PC110_GPIO_F00, S5PC110_GPIO_G00, 0),
807 GPIO_ENTRY('g', S5PC110_GPIO_G00, S5PC110_GPIO_I0, 0),
808 GPIO_ENTRY('i', S5PC110_GPIO_I0, S5PC110_GPIO_J00, 0),
809 GPIO_ENTRY('j', S5PC110_GPIO_J00, S5PC110_GPIO_MP010, 0),
810 GPIO_ENTRY('h', S5PC110_GPIO_H00, S5PC110_GPIO_MAX_PORT, 0),
811 { 0 }
Minkyu Kang399e5ae2009-10-01 17:20:01 +0900812};
Minkyu Kangab693e92010-02-12 18:17:52 +0900813
814/* functions */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +0530815void gpio_cfg_pin(int gpio, int cfg);
816void gpio_set_pull(int gpio, int mode);
817void gpio_set_drv(int gpio, int mode);
818int gpio_direction_output(unsigned gpio, int value);
819int gpio_set_value(unsigned gpio, int value);
820int gpio_get_value(unsigned gpio);
821void gpio_set_rate(int gpio, int mode);
822struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio);
823int s5p_gpio_get_pin(unsigned gpio);
Ɓukasz Majewski9f15bc02011-08-22 22:34:58 +0000824
825/* GPIO pins per bank */
826#define GPIO_PER_BANK 8
Minkyu Kang399e5ae2009-10-01 17:20:01 +0900827#endif
828
Minkyu Kangab693e92010-02-12 18:17:52 +0900829/* Pin configurations */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +0530830#define S5P_GPIO_INPUT 0x0
831#define S5P_GPIO_OUTPUT 0x1
832#define S5P_GPIO_IRQ 0xf
833#define S5P_GPIO_FUNC(x) (x)
Minkyu Kangab693e92010-02-12 18:17:52 +0900834
835/* Pull mode */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +0530836#define S5P_GPIO_PULL_NONE 0x0
837#define S5P_GPIO_PULL_DOWN 0x1
838#define S5P_GPIO_PULL_UP 0x2
Minkyu Kangab693e92010-02-12 18:17:52 +0900839
840/* Drive Strength level */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +0530841#define S5P_GPIO_DRV_1X 0x0
842#define S5P_GPIO_DRV_3X 0x1
843#define S5P_GPIO_DRV_2X 0x2
844#define S5P_GPIO_DRV_4X 0x3
845#define S5P_GPIO_DRV_FAST 0x0
846#define S5P_GPIO_DRV_SLOW 0x1
Minkyu Kangab693e92010-02-12 18:17:52 +0900847
Minkyu Kang399e5ae2009-10-01 17:20:01 +0900848#endif