1 #include <linux/kernel.h>
6 #define _GPIO(offset) (offset)
8 #define STN8815_PIN_B4 _GPIO(0)
9 #define STN8815_PIN_D5 _GPIO(1)
10 #define STN8815_PIN_C5 _GPIO(2)
11 #define STN8815_PIN_A4 _GPIO(3)
12 #define STN8815_PIN_B5 _GPIO(4)
13 #define STN8815_PIN_D6 _GPIO(5)
14 #define STN8815_PIN_C6 _GPIO(6)
15 #define STN8815_PIN_B6 _GPIO(7)
16 #define STN8815_PIN_B10 _GPIO(8)
17 #define STN8815_PIN_A10 _GPIO(9)
18 #define STN8815_PIN_C11 _GPIO(10)
19 #define STN8815_PIN_B11 _GPIO(11)
20 #define STN8815_PIN_A11 _GPIO(12)
21 #define STN8815_PIN_C12 _GPIO(13)
22 #define STN8815_PIN_B12 _GPIO(14)
23 #define STN8815_PIN_A12 _GPIO(15)
24 #define STN8815_PIN_C13 _GPIO(16)
25 #define STN8815_PIN_B13 _GPIO(17)
26 #define STN8815_PIN_A13 _GPIO(18)
27 #define STN8815_PIN_D13 _GPIO(19)
28 #define STN8815_PIN_C14 _GPIO(20)
29 #define STN8815_PIN_B14 _GPIO(21)
30 #define STN8815_PIN_A14 _GPIO(22)
31 #define STN8815_PIN_D15 _GPIO(23)
32 #define STN8815_PIN_C15 _GPIO(24)
33 #define STN8815_PIN_B15 _GPIO(25)
34 #define STN8815_PIN_A15 _GPIO(26)
35 #define STN8815_PIN_C16 _GPIO(27)
36 #define STN8815_PIN_B16 _GPIO(28)
37 #define STN8815_PIN_A16 _GPIO(29)
38 #define STN8815_PIN_D17 _GPIO(30)
39 #define STN8815_PIN_C17 _GPIO(31)
40 #define STN8815_PIN_AB6 _GPIO(32)
41 #define STN8815_PIN_AA6 _GPIO(33)
42 #define STN8815_PIN_Y6 _GPIO(34)
43 #define STN8815_PIN_Y5 _GPIO(35)
44 #define STN8815_PIN_AA5 _GPIO(36)
45 #define STN8815_PIN_AB5 _GPIO(37)
46 #define STN8815_PIN_AB4 _GPIO(38)
47 #define STN8815_PIN_Y4 _GPIO(39)
48 #define STN8815_PIN_R1 _GPIO(40)
49 #define STN8815_PIN_R2 _GPIO(41)
50 #define STN8815_PIN_R3 _GPIO(42)
51 #define STN8815_PIN_P1 _GPIO(43)
52 #define STN8815_PIN_P2 _GPIO(44)
53 #define STN8815_PIN_P3 _GPIO(45)
54 #define STN8815_PIN_N1 _GPIO(46)
55 #define STN8815_PIN_N2 _GPIO(47)
56 #define STN8815_PIN_N3 _GPIO(48)
57 #define STN8815_PIN_M1 _GPIO(49)
58 #define STN8815_PIN_M3 _GPIO(50)
59 #define STN8815_PIN_M2 _GPIO(51)
60 #define STN8815_PIN_L1 _GPIO(52)
61 #define STN8815_PIN_L4 _GPIO(53)
62 #define STN8815_PIN_L3 _GPIO(54)
63 #define STN8815_PIN_L2 _GPIO(55)
64 #define STN8815_PIN_F3 _GPIO(56)
65 #define STN8815_PIN_F2 _GPIO(57)
66 #define STN8815_PIN_E1 _GPIO(58)
67 #define STN8815_PIN_E3 _GPIO(59)
68 #define STN8815_PIN_E2 _GPIO(60)
69 #define STN8815_PIN_E4 _GPIO(61)
70 #define STN8815_PIN_D3 _GPIO(62)
71 #define STN8815_PIN_D2 _GPIO(63)
72 #define STN8815_PIN_F21 _GPIO(64)
73 #define STN8815_PIN_F20 _GPIO(65)
74 #define STN8815_PIN_E22 _GPIO(66)
75 #define STN8815_PIN_D22 _GPIO(67)
76 #define STN8815_PIN_E21 _GPIO(68)
77 #define STN8815_PIN_E20 _GPIO(69)
78 #define STN8815_PIN_C22 _GPIO(70)
79 #define STN8815_PIN_D21 _GPIO(71)
80 #define STN8815_PIN_D20 _GPIO(72)
81 #define STN8815_PIN_C21 _GPIO(73)
82 #define STN8815_PIN_C20 _GPIO(74)
83 #define STN8815_PIN_C19 _GPIO(75)
84 #define STN8815_PIN_B20 _GPIO(76)
85 #define STN8815_PIN_B8 _GPIO(77)
86 #define STN8815_PIN_A8 _GPIO(78)
87 #define STN8815_PIN_C9 _GPIO(79)
88 #define STN8815_PIN_B9 _GPIO(80)
89 #define STN8815_PIN_A9 _GPIO(81)
90 #define STN8815_PIN_C10 _GPIO(82)
91 #define STN8815_PIN_K1 _GPIO(83)
92 #define STN8815_PIN_K3 _GPIO(84)
93 #define STN8815_PIN_K2 _GPIO(85)
94 #define STN8815_PIN_J1 _GPIO(86)
95 #define STN8815_PIN_J3 _GPIO(87)
96 #define STN8815_PIN_J2 _GPIO(88)
97 #define STN8815_PIN_H1 _GPIO(89)
98 #define STN8815_PIN_H3 _GPIO(90)
99 #define STN8815_PIN_H2 _GPIO(91)
100 #define STN8815_PIN_G1 _GPIO(92)
101 #define STN8815_PIN_G3 _GPIO(93)
102 #define STN8815_PIN_G2 _GPIO(94)
103 #define STN8815_PIN_F1 _GPIO(95)
104 #define STN8815_PIN_T20 _GPIO(96)
105 #define STN8815_PIN_R21 _GPIO(97)
106 #define STN8815_PIN_R20 _GPIO(98)
107 #define STN8815_PIN_U22 _GPIO(99)
108 #define STN8815_PIN_N21 _GPIO(100)
109 #define STN8815_PIN_N20 _GPIO(101)
110 #define STN8815_PIN_P22 _GPIO(102)
111 #define STN8815_PIN_N22 _GPIO(103)
112 #define STN8815_PIN_V22 _GPIO(104)
113 #define STN8815_PIN_V21 _GPIO(105)
114 #define STN8815_PIN_K22 _GPIO(106)
115 #define STN8815_PIN_K21 _GPIO(107)
116 #define STN8815_PIN_H20 _GPIO(108)
117 #define STN8815_PIN_G20 _GPIO(109)
118 #define STN8815_PIN_L21 _GPIO(110)
119 #define STN8815_PIN_H21 _GPIO(111)
120 #define STN8815_PIN_J21 _GPIO(112)
121 #define STN8815_PIN_H22 _GPIO(113)
122 #define STN8815_PIN_K20 _GPIO(114)
123 #define STN8815_PIN_L22 _GPIO(115)
124 #define STN8815_PIN_G21 _GPIO(116)
125 #define STN8815_PIN_J20 _GPIO(117)
126 #define STN8815_PIN_G22 _GPIO(118)
127 #define STN8815_PIN_U19 _GPIO(119)
128 #define STN8815_PIN_G19 _GPIO(120)
129 #define STN8815_PIN_M22 _GPIO(121)
130 #define STN8815_PIN_M19 _GPIO(122)
131 #define STN8815_PIN_J22 _GPIO(123)
140 static const struct pinctrl_pin_desc nmk_stn8815_pins[] = {
267 #define STN8815_GPIO_RANGE(a, b, c) { .name = "STN8815", .id = a, .base = b, \
268 .pin_base = b, .npins = c }
274 static struct pinctrl_gpio_range nmk_stn8815_ranges[] = {
302 #define STN8815_PIN_GROUP(a,b) { .name = #a, .pins = a##_pins, \
303 .npins = ARRAY_SIZE(a##_pins), .altsetting = b }
305 static const struct nmk_pingroup nmk_stn8815_groups[] = {
316 #define STN8815_FUNC_GROUPS(a, b...) \
317 static const char * const a##_groups[] = { b };
326 #define FUNCTION(fname) \
329 .groups = fname##_groups, \
330 .ngroups = ARRAY_SIZE(fname##_groups), \
333 static const struct nmk_function nmk_stn8815_functions[] = {
343 .gpio_ranges = nmk_stn8815_ranges,
344 .gpio_num_ranges =
ARRAY_SIZE(nmk_stn8815_ranges),
345 .pins = nmk_stn8815_pins,
347 .functions = nmk_stn8815_functions,
348 .nfunctions =
ARRAY_SIZE(nmk_stn8815_functions),
349 .groups = nmk_stn8815_groups,
356 *soc = &nmk_stn8815_soc;