1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
|
#include <linux/kernel.h>
#include <linux/pinctrl/pinctrl.h>
#include "pinctrl-nomadik.h"
/* All the pins that can be used for GPIO and some other functions */
#define _GPIO(offset) (offset)
#define DB8500_PIN_AJ5 _GPIO(0)
#define DB8500_PIN_AJ3 _GPIO(1)
#define DB8500_PIN_AH4 _GPIO(2)
#define DB8500_PIN_AH3 _GPIO(3)
#define DB8500_PIN_AH6 _GPIO(4)
#define DB8500_PIN_AG6 _GPIO(5)
#define DB8500_PIN_AF6 _GPIO(6)
#define DB8500_PIN_AG5 _GPIO(7)
#define DB8500_PIN_AD5 _GPIO(8)
#define DB8500_PIN_AE4 _GPIO(9)
#define DB8500_PIN_AF5 _GPIO(10)
#define DB8500_PIN_AG4 _GPIO(11)
#define DB8500_PIN_AC4 _GPIO(12)
#define DB8500_PIN_AF3 _GPIO(13)
#define DB8500_PIN_AE3 _GPIO(14)
#define DB8500_PIN_AC3 _GPIO(15)
#define DB8500_PIN_AD3 _GPIO(16)
#define DB8500_PIN_AD4 _GPIO(17)
#define DB8500_PIN_AC2 _GPIO(18)
#define DB8500_PIN_AC1 _GPIO(19)
#define DB8500_PIN_AB4 _GPIO(20)
#define DB8500_PIN_AB3 _GPIO(21)
#define DB8500_PIN_AA3 _GPIO(22)
#define DB8500_PIN_AA4 _GPIO(23)
#define DB8500_PIN_AB2 _GPIO(24)
#define DB8500_PIN_Y4 _GPIO(25)
#define DB8500_PIN_Y2 _GPIO(26)
#define DB8500_PIN_AA2 _GPIO(27)
#define DB8500_PIN_AA1 _GPIO(28)
#define DB8500_PIN_W2 _GPIO(29)
#define DB8500_PIN_W3 _GPIO(30)
#define DB8500_PIN_V3 _GPIO(31)
#define DB8500_PIN_V2 _GPIO(32)
#define DB8500_PIN_AF2 _GPIO(33)
#define DB8500_PIN_AE1 _GPIO(34)
#define DB8500_PIN_AE2 _GPIO(35)
#define DB8500_PIN_AG2 _GPIO(36)
/* Hole */
#define DB8500_PIN_F3 _GPIO(64)
#define DB8500_PIN_F1 _GPIO(65)
#define DB8500_PIN_G3 _GPIO(66)
#define DB8500_PIN_G2 _GPIO(67)
#define DB8500_PIN_E1 _GPIO(68)
#define DB8500_PIN_E2 _GPIO(69)
#define DB8500_PIN_G5 _GPIO(70)
#define DB8500_PIN_G4 _GPIO(71)
#define DB8500_PIN_H4 _GPIO(72)
#define DB8500_PIN_H3 _GPIO(73)
#define DB8500_PIN_J3 _GPIO(74)
#define DB8500_PIN_H2 _GPIO(75)
#define DB8500_PIN_J2 _GPIO(76)
#define DB8500_PIN_H1 _GPIO(77)
#define DB8500_PIN_F4 _GPIO(78)
#define DB8500_PIN_E3 _GPIO(79)
#define DB8500_PIN_E4 _GPIO(80)
#define DB8500_PIN_D2 _GPIO(81)
#define DB8500_PIN_C1 _GPIO(82)
#define DB8500_PIN_D3 _GPIO(83)
#define DB8500_PIN_C2 _GPIO(84)
#define DB8500_PIN_D5 _GPIO(85)
#define DB8500_PIN_C6 _GPIO(86)
#define DB8500_PIN_B3 _GPIO(87)
#define DB8500_PIN_C4 _GPIO(88)
#define DB8500_PIN_E6 _GPIO(89)
#define DB8500_PIN_A3 _GPIO(90)
#define DB8500_PIN_B6 _GPIO(91)
#define DB8500_PIN_D6 _GPIO(92)
#define DB8500_PIN_B7 _GPIO(93)
#define DB8500_PIN_D7 _GPIO(94)
#define DB8500_PIN_E8 _GPIO(95)
#define DB8500_PIN_D8 _GPIO(96)
#define DB8500_PIN_D9 _GPIO(97)
/* Hole */
#define DB8500_PIN_A5 _GPIO(128)
#define DB8500_PIN_B4 _GPIO(129)
#define DB8500_PIN_C8 _GPIO(130)
#define DB8500_PIN_A12 _GPIO(131)
#define DB8500_PIN_C10 _GPIO(132)
#define DB8500_PIN_B10 _GPIO(133)
#define DB8500_PIN_B9 _GPIO(134)
#define DB8500_PIN_A9 _GPIO(135)
#define DB8500_PIN_C7 _GPIO(136)
#define DB8500_PIN_A7 _GPIO(137)
#define DB8500_PIN_C5 _GPIO(138)
#define DB8500_PIN_C9 _GPIO(139)
#define DB8500_PIN_B11 _GPIO(140)
#define DB8500_PIN_C12 _GPIO(141)
#define DB8500_PIN_C11 _GPIO(142)
#define DB8500_PIN_D12 _GPIO(143)
#define DB8500_PIN_B13 _GPIO(144)
#define DB8500_PIN_C13 _GPIO(145)
#define DB8500_PIN_D13 _GPIO(146)
#define DB8500_PIN_C15 _GPIO(147)
#define DB8500_PIN_B16 _GPIO(148)
#define DB8500_PIN_B14 _GPIO(149)
#define DB8500_PIN_C14 _GPIO(150)
#define DB8500_PIN_D17 _GPIO(151)
#define DB8500_PIN_D16 _GPIO(152)
#define DB8500_PIN_B17 _GPIO(153)
#define DB8500_PIN_C16 _GPIO(154)
#define DB8500_PIN_C19 _GPIO(155)
#define DB8500_PIN_C17 _GPIO(156)
#define DB8500_PIN_A18 _GPIO(157)
#define DB8500_PIN_C18 _GPIO(158)
#define DB8500_PIN_B19 _GPIO(159)
#define DB8500_PIN_B20 _GPIO(160)
#define DB8500_PIN_D21 _GPIO(161)
#define DB8500_PIN_D20 _GPIO(162)
#define DB8500_PIN_C20 _GPIO(163)
#define DB8500_PIN_B21 _GPIO(164)
#define DB8500_PIN_C21 _GPIO(165)
#define DB8500_PIN_A22 _GPIO(166)
#define DB8500_PIN_B24 _GPIO(167)
#define DB8500_PIN_C22 _GPIO(168)
#define DB8500_PIN_D22 _GPIO(169)
#define DB8500_PIN_C23 _GPIO(170)
#define DB8500_PIN_D23 _GPIO(171)
/* Hole */
#define DB8500_PIN_AJ27 _GPIO(192)
#define DB8500_PIN_AH27 _GPIO(193)
#define DB8500_PIN_AF27 _GPIO(194)
#define DB8500_PIN_AG28 _GPIO(195)
#define DB8500_PIN_AG26 _GPIO(196)
#define DB8500_PIN_AH24 _GPIO(197)
#define DB8500_PIN_AG25 _GPIO(198)
#define DB8500_PIN_AH23 _GPIO(199)
#define DB8500_PIN_AH26 _GPIO(200)
#define DB8500_PIN_AF24 _GPIO(201)
#define DB8500_PIN_AF25 _GPIO(202)
#define DB8500_PIN_AE23 _GPIO(203)
#define DB8500_PIN_AF23 _GPIO(204)
#define DB8500_PIN_AG23 _GPIO(205)
#define DB8500_PIN_AG24 _GPIO(206)
#define DB8500_PIN_AJ23 _GPIO(207)
#define DB8500_PIN_AH16 _GPIO(208)
#define DB8500_PIN_AG15 _GPIO(209)
#define DB8500_PIN_AJ15 _GPIO(210)
#define DB8500_PIN_AG14 _GPIO(211)
#define DB8500_PIN_AF13 _GPIO(212)
#define DB8500_PIN_AG13 _GPIO(213)
#define DB8500_PIN_AH15 _GPIO(214)
#define DB8500_PIN_AH13 _GPIO(215)
#define DB8500_PIN_AG12 _GPIO(216)
#define DB8500_PIN_AH12 _GPIO(217)
#define DB8500_PIN_AH11 _GPIO(218)
#define DB8500_PIN_AG10 _GPIO(219)
#define DB8500_PIN_AH10 _GPIO(220)
#define DB8500_PIN_AJ11 _GPIO(221)
#define DB8500_PIN_AJ9 _GPIO(222)
#define DB8500_PIN_AH9 _GPIO(223)
#define DB8500_PIN_AG9 _GPIO(224)
#define DB8500_PIN_AG8 _GPIO(225)
#define DB8500_PIN_AF8 _GPIO(226)
#define DB8500_PIN_AH7 _GPIO(227)
#define DB8500_PIN_AJ6 _GPIO(228)
#define DB8500_PIN_AG7 _GPIO(229)
#define DB8500_PIN_AF7 _GPIO(230)
/* Hole */
#define DB8500_PIN_AF28 _GPIO(256)
#define DB8500_PIN_AE29 _GPIO(257)
#define DB8500_PIN_AD29 _GPIO(258)
#define DB8500_PIN_AC29 _GPIO(259)
#define DB8500_PIN_AD28 _GPIO(260)
#define DB8500_PIN_AD26 _GPIO(261)
#define DB8500_PIN_AE26 _GPIO(262)
#define DB8500_PIN_AG29 _GPIO(263)
#define DB8500_PIN_AE27 _GPIO(264)
#define DB8500_PIN_AD27 _GPIO(265)
#define DB8500_PIN_AC28 _GPIO(266)
#define DB8500_PIN_AC27 _GPIO(267)
/*
* The names of the pins are denoted by GPIO number and ball name, even
* though they can be used for other things than GPIO, this is the first
* column in the table of the data sheet and often used on schematics and
* such.
*/
static const struct pinctrl_pin_desc nmk_db8500_pins[] = {
PINCTRL_PIN(DB8500_PIN_AJ5, "GPIO0_AJ5"),
PINCTRL_PIN(DB8500_PIN_AJ3, "GPIO1_AJ3"),
PINCTRL_PIN(DB8500_PIN_AH4, "GPIO2_AH4"),
PINCTRL_PIN(DB8500_PIN_AH3, "GPIO3_AH3"),
PINCTRL_PIN(DB8500_PIN_AH6, "GPIO4_AH6"),
PINCTRL_PIN(DB8500_PIN_AG6, "GPIO5_AG6"),
PINCTRL_PIN(DB8500_PIN_AF6, "GPIO6_AF6"),
PINCTRL_PIN(DB8500_PIN_AG5, "GPIO7_AG5"),
PINCTRL_PIN(DB8500_PIN_AD5, "GPIO8_AD5"),
PINCTRL_PIN(DB8500_PIN_AE4, "GPIO9_AE4"),
PINCTRL_PIN(DB8500_PIN_AF5, "GPIO10_AF5"),
PINCTRL_PIN(DB8500_PIN_AG4, "GPIO11_AG4"),
PINCTRL_PIN(DB8500_PIN_AC4, "GPIO12_AC4"),
PINCTRL_PIN(DB8500_PIN_AF3, "GPIO13_AF3"),
PINCTRL_PIN(DB8500_PIN_AE3, "GPIO14_AE3"),
PINCTRL_PIN(DB8500_PIN_AC3, "GPIO15_AC3"),
PINCTRL_PIN(DB8500_PIN_AD3, "GPIO16_AD3"),
PINCTRL_PIN(DB8500_PIN_AD4, "GPIO17_AD4"),
PINCTRL_PIN(DB8500_PIN_AC2, "GPIO18_AC2"),
PINCTRL_PIN(DB8500_PIN_AC1, "GPIO19_AC1"),
PINCTRL_PIN(DB8500_PIN_AB4, "GPIO20_AB4"),
PINCTRL_PIN(DB8500_PIN_AB3, "GPIO21_AB3"),
PINCTRL_PIN(DB8500_PIN_AA3, "GPIO22_AA3"),
PINCTRL_PIN(DB8500_PIN_AA4, "GPIO23_AA4"),
PINCTRL_PIN(DB8500_PIN_AB2, "GPIO24_AB2"),
PINCTRL_PIN(DB8500_PIN_Y4, "GPIO25_Y4"),
PINCTRL_PIN(DB8500_PIN_Y2, "GPIO26_Y2"),
PINCTRL_PIN(DB8500_PIN_AA2, "GPIO27_AA2"),
PINCTRL_PIN(DB8500_PIN_AA1, "GPIO28_AA1"),
PINCTRL_PIN(DB8500_PIN_W2, "GPIO29_W2"),
PINCTRL_PIN(DB8500_PIN_W3, "GPIO30_W3"),
PINCTRL_PIN(DB8500_PIN_V3, "GPIO31_V3"),
PINCTRL_PIN(DB8500_PIN_V2, "GPIO32_V2"),
PINCTRL_PIN(DB8500_PIN_AF2, "GPIO33_AF2"),
PINCTRL_PIN(DB8500_PIN_AE1, "GPIO34_AE1"),
PINCTRL_PIN(DB8500_PIN_AE2, "GPIO35_AE2"),
PINCTRL_PIN(DB8500_PIN_AG2, "GPIO36_AG2"),
/* Hole */
PINCTRL_PIN(DB8500_PIN_F3, "GPIO64_F3"),
PINCTRL_PIN(DB8500_PIN_F1, "GPIO65_F1"),
PINCTRL_PIN(DB8500_PIN_G3, "GPIO66_G3"),
PINCTRL_PIN(DB8500_PIN_G2, "GPIO67_G2"),
PINCTRL_PIN(DB8500_PIN_E1, "GPIO68_E1"),
PINCTRL_PIN(DB8500_PIN_E2, "GPIO69_E2"),
PINCTRL_PIN(DB8500_PIN_G5, "GPIO70_G5"),
PINCTRL_PIN(DB8500_PIN_G4, "GPIO71_G4"),
PINCTRL_PIN(DB8500_PIN_H4, "GPIO72_H4"),
PINCTRL_PIN(DB8500_PIN_H3, "GPIO73_H3"),
PINCTRL_PIN(DB8500_PIN_J3, "GPIO74_J3"),
PINCTRL_PIN(DB8500_PIN_H2, "GPIO75_H2"),
PINCTRL_PIN(DB8500_PIN_J2, "GPIO76_J2"),
PINCTRL_PIN(DB8500_PIN_H1, "GPIO77_H1"),
PINCTRL_PIN(DB8500_PIN_F4, "GPIO78_F4"),
PINCTRL_PIN(DB8500_PIN_E3, "GPIO79_E3"),
PINCTRL_PIN(DB8500_PIN_E4, "GPIO80_E4"),
PINCTRL_PIN(DB8500_PIN_D2, "GPIO81_D2"),
PINCTRL_PIN(DB8500_PIN_C1, "GPIO82_C1"),
PINCTRL_PIN(DB8500_PIN_D3, "GPIO83_D3"),
PINCTRL_PIN(DB8500_PIN_C2, "GPIO84_C2"),
PINCTRL_PIN(DB8500_PIN_D5, "GPIO85_D5"),
PINCTRL_PIN(DB8500_PIN_C6, "GPIO86_C6"),
PINCTRL_PIN(DB8500_PIN_B3, "GPIO87_B3"),
PINCTRL_PIN(DB8500_PIN_C4, "GPIO88_C4"),
PINCTRL_PIN(DB8500_PIN_E6, "GPIO89_E6"),
PINCTRL_PIN(DB8500_PIN_A3, "GPIO90_A3"),
PINCTRL_PIN(DB8500_PIN_B6, "GPIO91_B6"),
PINCTRL_PIN(DB8500_PIN_D6, "GPIO92_D6"),
PINCTRL_PIN(DB8500_PIN_B7, "GPIO93_B7"),
PINCTRL_PIN(DB8500_
|