1
2
3
4
5
6
7
8#include <linux/kernel.h>
9#include <linux/gpio/driver.h>
10#include <linux/pinctrl/pinctrl.h>
11#include <linux/mfd/abx500/ab8500.h>
12#include "pinctrl-abx500.h"
13
14
15#define ABX500_GPIO(offset) (offset)
16
17#define AB8500_PIN_T10 ABX500_GPIO(1)
18#define AB8500_PIN_T9 ABX500_GPIO(2)
19#define AB8500_PIN_U9 ABX500_GPIO(3)
20#define AB8500_PIN_W2 ABX500_GPIO(4)
21
22#define AB8500_PIN_Y18 ABX500_GPIO(6)
23#define AB8500_PIN_AA20 ABX500_GPIO(7)
24#define AB8500_PIN_W18 ABX500_GPIO(8)
25#define AB8500_PIN_AA19 ABX500_GPIO(9)
26#define AB8500_PIN_U17 ABX500_GPIO(10)
27#define AB8500_PIN_AA18 ABX500_GPIO(11)
28#define AB8500_PIN_U16 ABX500_GPIO(12)
29#define AB8500_PIN_W17 ABX500_GPIO(13)
30#define AB8500_PIN_F14 ABX500_GPIO(14)
31#define AB8500_PIN_B17 ABX500_GPIO(15)
32#define AB8500_PIN_F15 ABX500_GPIO(16)
33#define AB8500_PIN_P5 ABX500_GPIO(17)
34#define AB8500_PIN_R5 ABX500_GPIO(18)
35#define AB8500_PIN_U5 ABX500_GPIO(19)
36#define AB8500_PIN_T5 ABX500_GPIO(20)
37#define AB8500_PIN_H19 ABX500_GPIO(21)
38#define AB8500_PIN_G20 ABX500_GPIO(22)
39#define AB8500_PIN_G19 ABX500_GPIO(23)
40#define AB8500_PIN_T14 ABX500_GPIO(24)
41#define AB8500_PIN_R16 ABX500_GPIO(25)
42#define AB8500_PIN_M16 ABX500_GPIO(26)
43#define AB8500_PIN_J6 ABX500_GPIO(27)
44#define AB8500_PIN_K6 ABX500_GPIO(28)
45#define AB8500_PIN_G6 ABX500_GPIO(29)
46#define AB8500_PIN_H6 ABX500_GPIO(30)
47#define AB8500_PIN_F5 ABX500_GPIO(31)
48#define AB8500_PIN_G5 ABX500_GPIO(32)
49
50#define AB8500_PIN_R17 ABX500_GPIO(34)
51#define AB8500_PIN_W15 ABX500_GPIO(35)
52#define AB8500_PIN_A17 ABX500_GPIO(36)
53#define AB8500_PIN_E15 ABX500_GPIO(37)
54#define AB8500_PIN_C17 ABX500_GPIO(38)
55#define AB8500_PIN_E16 ABX500_GPIO(39)
56#define AB8500_PIN_T19 ABX500_GPIO(40)
57#define AB8500_PIN_U19 ABX500_GPIO(41)
58#define AB8500_PIN_U2 ABX500_GPIO(42)
59
60
61#define AB8500_GPIO_MAX_NUMBER 42
62
63
64
65
66
67
68
69static const struct pinctrl_pin_desc ab8500_pins[] = {
70 PINCTRL_PIN(AB8500_PIN_T10, "GPIO1_T10"),
71 PINCTRL_PIN(AB8500_PIN_T9, "GPIO2_T9"),
72 PINCTRL_PIN(AB8500_PIN_U9, "GPIO3_U9"),
73 PINCTRL_PIN(AB8500_PIN_W2, "GPIO4_W2"),
74
75 PINCTRL_PIN(AB8500_PIN_Y18, "GPIO6_Y18"),
76 PINCTRL_PIN(AB8500_PIN_AA20, "GPIO7_AA20"),
77 PINCTRL_PIN(AB8500_PIN_W18, "GPIO8_W18"),
78 PINCTRL_PIN(AB8500_PIN_AA19, "GPIO9_AA19"),
79 PINCTRL_PIN(AB8500_PIN_U17, "GPIO10_U17"),
80 PINCTRL_PIN(AB8500_PIN_AA18, "GPIO11_AA18"),
81 PINCTRL_PIN(AB8500_PIN_U16, "GPIO12_U16"),
82 PINCTRL_PIN(AB8500_PIN_W17, "GPIO13_W17"),
83 PINCTRL_PIN(AB8500_PIN_F14, "GPIO14_F14"),
84 PINCTRL_PIN(AB8500_PIN_B17, "GPIO15_B17"),
85 PINCTRL_PIN(AB8500_PIN_F15, "GPIO16_F15"),
86 PINCTRL_PIN(AB8500_PIN_P5, "GPIO17_P5"),
87 PINCTRL_PIN(AB8500_PIN_R5, "GPIO18_R5"),
88 PINCTRL_PIN(AB8500_PIN_U5, "GPIO19_U5"),
89 PINCTRL_PIN(AB8500_PIN_T5, "GPIO20_T5"),
90 PINCTRL_PIN(AB8500_PIN_H19, "GPIO21_H19"),
91 PINCTRL_PIN(AB8500_PIN_G20, "GPIO22_G20"),
92 PINCTRL_PIN(AB8500_PIN_G19, "GPIO23_G19"),
93 PINCTRL_PIN(AB8500_PIN_T14, "GPIO24_T14"),
94 PINCTRL_PIN(AB8500_PIN_R16, "GPIO25_R16"),
95 PINCTRL_PIN(AB8500_PIN_M16, "GPIO26_M16"),
96 PINCTRL_PIN(AB8500_PIN_J6, "GPIO27_J6"),
97 PINCTRL_PIN(AB8500_PIN_K6, "GPIO28_K6"),
98 PINCTRL_PIN(AB8500_PIN_G6, "GPIO29_G6"),
99 PINCTRL_PIN(AB8500_PIN_H6, "GPIO30_H6"),
100 PINCTRL_PIN(AB8500_PIN_F5, "GPIO31_F5"),
101 PINCTRL_PIN(AB8500_PIN_G5, "GPIO32_G5"),
102
103 PINCTRL_PIN(AB8500_PIN_R17, "GPIO34_R17"),
104 PINCTRL_PIN(AB8500_PIN_W15, "GPIO35_W15"),
105 PINCTRL_PIN(AB8500_PIN_A17, "GPIO36_A17"),
106 PINCTRL_PIN(AB8500_PIN_E15, "GPIO37_E15"),
107 PINCTRL_PIN(AB8500_PIN_C17, "GPIO38_C17"),
108 PINCTRL_PIN(AB8500_PIN_E16, "GPIO39_E16"),
109 PINCTRL_PIN(AB8500_PIN_T19, "GPIO40_T19"),
110 PINCTRL_PIN(AB8500_PIN_U19, "GPIO41_U19"),
111 PINCTRL_PIN(AB8500_PIN_U2, "GPIO42_U2"),
112};
113
114
115
116
117static const struct abx500_pinrange ab8500_pinranges[] = {
118 ABX500_PINRANGE(1, 4, ABX500_ALT_A),
119 ABX500_PINRANGE(6, 4, ABX500_ALT_A),
120 ABX500_PINRANGE(10, 4, ABX500_DEFAULT),
121 ABX500_PINRANGE(14, 12, ABX500_ALT_A),
122 ABX500_PINRANGE(26, 1, ABX500_DEFAULT),
123 ABX500_PINRANGE(27, 6, ABX500_ALT_A),
124 ABX500_PINRANGE(34, 1, ABX500_ALT_A),
125 ABX500_PINRANGE(35, 1, ABX500_DEFAULT),
126 ABX500_PINRANGE(36, 7, ABX500_ALT_A),
127};
128
129
130
131
132
133
134
135
136
137
138
139
140static const unsigned sysclkreq2_d_1_pins[] = { AB8500_PIN_T10 };
141static const unsigned sysclkreq3_d_1_pins[] = { AB8500_PIN_T9 };
142static const unsigned sysclkreq4_d_1_pins[] = { AB8500_PIN_U9 };
143static const unsigned sysclkreq6_d_1_pins[] = { AB8500_PIN_W2 };
144static const unsigned ycbcr0123_d_1_pins[] = { AB8500_PIN_Y18, AB8500_PIN_AA20,
145 AB8500_PIN_W18, AB8500_PIN_AA19};
146static const unsigned gpio10_d_1_pins[] = { AB8500_PIN_U17 };
147static const unsigned gpio11_d_1_pins[] = { AB8500_PIN_AA18 };
148static const unsigned gpio12_d_1_pins[] = { AB8500_PIN_U16 };
149static const unsigned gpio13_d_1_pins[] = { AB8500_PIN_W17 };
150static const unsigned pwmout1_d_1_pins[] = { AB8500_PIN_F14 };
151static const unsigned pwmout2_d_1_pins[] = { AB8500_PIN_B17 };
152static const unsigned pwmout3_d_1_pins[] = { AB8500_PIN_F15 };
153
154
155static const unsigned adi1_d_1_pins[] = { AB8500_PIN_P5, AB8500_PIN_R5,
156 AB8500_PIN_U5, AB8500_PIN_T5 };
157
158static const unsigned usbuicc_d_1_pins[] = { AB8500_PIN_H19, AB8500_PIN_G20,
159 AB8500_PIN_G19 };
160static const unsigned sysclkreq7_d_1_pins[] = { AB8500_PIN_T14 };
161static const unsigned sysclkreq8_d_1_pins[] = { AB8500_PIN_R16 };
162static const unsigned gpio26_d_1_pins[] = { AB8500_PIN_M16 };
163
164static const unsigned dmic12_d_1_pins[] = { AB8500_PIN_J6, AB8500_PIN_K6 };
165
166static const unsigned dmic34_d_1_pins[] = { AB8500_PIN_G6, AB8500_PIN_H6 };
167
168static const unsigned dmic56_d_1_pins[] = { AB8500_PIN_F5, AB8500_PIN_G5 };
169static const unsigned extcpena_d_1_pins[] = { AB8500_PIN_R17 };
170static const unsigned gpio35_d_1_pins[] = { AB8500_PIN_W15 };
171
172static const unsigned apespi_d_1_pins[] = { AB8500_PIN_A17, AB8500_PIN_E15,
173 AB8500_PIN_C17, AB8500_PIN_E16};
174
175static const unsigned modsclsda_d_1_pins[] = { AB8500_PIN_T19, AB8500_PIN_U19 };
176static const unsigned sysclkreq5_d_1_pins[] = { AB8500_PIN_U2 };
177
178
179static const unsigned gpio1_a_1_pins[] = { AB8500_PIN_T10 };
180static const unsigned gpio2_a_1_pins[] = { AB8500_PIN_T9 };
181static const unsigned gpio3_a_1_pins[] = { AB8500_PIN_U9 };
182static const unsigned gpio4_a_1_pins[] = { AB8500_PIN_W2 };
183static const unsigned gpio6_a_1_pins[] = { AB8500_PIN_Y18 };
184static const unsigned gpio7_a_1_pins[] = { AB8500_PIN_AA20 };
185static const unsigned gpio8_a_1_pins[] = { AB8500_PIN_W18 };
186static const unsigned gpio9_a_1_pins[] = { AB8500_PIN_AA19 };
187
188static const unsigned ycbcr4567_a_1_pins[] = { AB8500_PIN_U17, AB8500_PIN_AA18,
189 AB8500_PIN_U16, AB8500_PIN_W17};
190static const unsigned gpio14_a_1_pins[] = { AB8500_PIN_F14 };
191static const unsigned gpio15_a_1_pins[] = { AB8500_PIN_B17 };
192static const unsigned gpio16_a_1_pins[] = { AB8500_PIN_F15 };
193static const unsigned gpio17_a_1_pins[] = { AB8500_PIN_P5 };
194static const unsigned gpio18_a_1_pins[] = { AB8500_PIN_R5 };
195static const unsigned gpio19_a_1_pins[] = { AB8500_PIN_U5 };
196static const unsigned gpio20_a_1_pins[] = { AB8500_PIN_T5 };
197static const unsigned gpio21_a_1_pins[] = { AB8500_PIN_H19 };
198static const unsigned gpio22_a_1_pins[] = { AB8500_PIN_G20 };
199static const unsigned gpio23_a_1_pins[] = { AB8500_PIN_G19 };
200static const unsigned gpio24_a_1_pins[] = { AB8500_PIN_T14 };
201static const unsigned gpio25_a_1_pins[] = { AB8500_PIN_R16 };
202static const unsigned gpio27_a_1_pins[] = { AB8500_PIN_J6 };
203static const unsigned gpio28_a_1_pins[] = { AB8500_PIN_K6 };
204static const unsigned gpio29_a_1_pins[] = { AB8500_PIN_G6 };
205static const unsigned gpio30_a_1_pins[] = { AB8500_PIN_H6 };
206static const unsigned gpio31_a_1_pins[] = { AB8500_PIN_F5 };
207static const unsigned gpio32_a_1_pins[] = { AB8500_PIN_G5 };
208static const unsigned gpio34_a_1_pins[] = { AB8500_PIN_R17 };
209static const unsigned gpio36_a_1_pins[] = { AB8500_PIN_A17 };
210static const unsigned gpio37_a_1_pins[] = { AB8500_PIN_E15 };
211static const unsigned gpio38_a_1_pins[] = { AB8500_PIN_C17 };
212static const unsigned gpio39_a_1_pins[] = { AB8500_PIN_E16 };
213static const unsigned gpio40_a_1_pins[] = { AB8500_PIN_T19 };
214static const unsigned gpio41_a_1_pins[] = { AB8500_PIN_U19 };
215static const unsigned gpio42_a_1_pins[] = { AB8500_PIN_U2 };
216
217
218static const unsigned hiqclkena_b_1_pins[] = { AB8500_PIN_U17 };
219static const unsigned usbuiccpd_b_1_pins[] = { AB8500_PIN_AA18 };
220static const unsigned i2ctrig1_b_1_pins[] = { AB8500_PIN_U16 };
221static const unsigned i2ctrig2_b_1_pins[] = { AB8500_PIN_W17 };
222
223
224static const unsigned usbvdat_c_1_pins[] = { AB8500_PIN_W17 };
225
226
227#define AB8500_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins, \
228 .npins = ARRAY_SIZE(a##_pins), .altsetting = b }
229
230static const struct abx500_pingroup ab8500_groups[] = {
231
232 AB8500_PIN_GROUP(sysclkreq2_d_1, ABX500_DEFAULT),
233 AB8500_PIN_GROUP(sysclkreq3_d_1, ABX500_DEFAULT),
234 AB8500_PIN_GROUP(sysclkreq4_d_1, ABX500_DEFAULT),
235 AB8500_PIN_GROUP(sysclkreq6_d_1, ABX500_DEFAULT),
236 AB8500_PIN_GROUP(ycbcr0123_d_1, ABX500_DEFAULT),
237 AB8500_PIN_GROUP(gpio10_d_1, ABX500_DEFAULT),
238 AB8500_PIN_GROUP(gpio11_d_1, ABX500_DEFAULT),
239 AB8500_PIN_GROUP(gpio12_d_1, ABX500_DEFAULT),
240 AB8500_PIN_GROUP(gpio13_d_1, ABX500_DEFAULT),
241 AB8500_PIN_GROUP(pwmout1_d_1, ABX500_DEFAULT),
242 AB8500_PIN_GROUP(pwmout2_d_1, ABX500_DEFAULT),
243 AB8500_PIN_GROUP(pwmout3_d_1, ABX500_DEFAULT),
244 AB8500_PIN_GROUP(adi1_d_1, ABX500_DEFAULT),
245 AB8500_PIN_GROUP(usbuicc_d_1, ABX500_DEFAULT),
246 AB8500_PIN_GROUP(sysclkreq7_d_1, ABX500_DEFAULT),
247 AB8500_PIN_GROUP(sysclkreq8_d_1, ABX500_DEFAULT),
248 AB8500_PIN_GROUP(gpio26_d_1, ABX500_DEFAULT),
249 AB8500_PIN_GROUP(dmic12_d_1, ABX500_DEFAULT),
250 AB8500_PIN_GROUP(dmic34_d_1, ABX500_DEFAULT),
251 AB8500_PIN_GROUP(dmic56_d_1, ABX500_DEFAULT),
252 AB8500_PIN_GROUP(extcpena_d_1, ABX500_DEFAULT),
253 AB8500_PIN_GROUP(gpio35_d_1, ABX500_DEFAULT),
254 AB8500_PIN_GROUP(apespi_d_1, ABX500_DEFAULT),
255 AB8500_PIN_GROUP(modsclsda_d_1, ABX500_DEFAULT),
256 AB8500_PIN_GROUP(sysclkreq5_d_1, ABX500_DEFAULT),
257
258 AB8500_PIN_GROUP(gpio1_a_1, ABX500_ALT_A),
259 AB8500_PIN_GROUP(gpio2_a_1, ABX500_ALT_A),
260 AB8500_PIN_GROUP(gpio3_a_1, ABX500_ALT_A),
261 AB8500_PIN_GROUP(gpio4_a_1, ABX500_ALT_A),
262 AB8500_PIN_GROUP(gpio6_a_1, ABX500_ALT_A),
263 AB8500_PIN_GROUP(gpio7_a_1, ABX500_ALT_A),
264 AB8500_PIN_GROUP(gpio8_a_1, ABX500_ALT_A),
265 AB8500_PIN_GROUP(gpio9_a_1, ABX500_ALT_A),
266 AB8500_PIN_GROUP(ycbcr4567_a_1, ABX500_ALT_A),
267 AB8500_PIN_GROUP(gpio14_a_1, ABX500_ALT_A),
268 AB8500_PIN_GROUP(gpio15_a_1, ABX500_ALT_A),
269 AB8500_PIN_GROUP(gpio16_a_1, ABX500_ALT_A),
270 AB8500_PIN_GROUP(gpio17_a_1, ABX500_ALT_A),
271 AB8500_PIN_GROUP(gpio18_a_1, ABX500_ALT_A),
272 AB8500_PIN_GROUP(gpio19_a_1, ABX500_ALT_A),
273 AB8500_PIN_GROUP(gpio20_a_1, ABX500_ALT_A),
274 AB8500_PIN_GROUP(gpio21_a_1, ABX500_ALT_A),
275 AB8500_PIN_GROUP(gpio22_a_1, ABX500_ALT_A),
276 AB8500_PIN_GROUP(gpio23_a_1, ABX500_ALT_A),
277 AB8500_PIN_GROUP(gpio24_a_1, ABX500_ALT_A),
278 AB8500_PIN_GROUP(gpio25_a_1, ABX500_ALT_A),
279 AB8500_PIN_GROUP(gpio27_a_1, ABX500_ALT_A),
280 AB8500_PIN_GROUP(gpio28_a_1, ABX500_ALT_A),
281 AB8500_PIN_GROUP(gpio29_a_1, ABX500_ALT_A),
282 AB8500_PIN_GROUP(gpio30_a_1, ABX500_ALT_A),
283 AB8500_PIN_GROUP(gpio31_a_1, ABX500_ALT_A),
284 AB8500_PIN_GROUP(gpio32_a_1, ABX500_ALT_A),
285 AB8500_PIN_GROUP(gpio34_a_1, ABX500_ALT_A),
286 AB8500_PIN_GROUP(gpio36_a_1, ABX500_ALT_A),
287 AB8500_PIN_GROUP(gpio37_a_1, ABX500_ALT_A),
288 AB8500_PIN_GROUP(gpio38_a_1, ABX500_ALT_A),
289 AB8500_PIN_GROUP(gpio39_a_1, ABX500_ALT_A),
290 AB8500_PIN_GROUP(gpio40_a_1, ABX500_ALT_A),
291 AB8500_PIN_GROUP(gpio41_a_1, ABX500_ALT_A),
292 AB8500_PIN_GROUP(gpio42_a_1, ABX500_ALT_A),
293
294 AB8500_PIN_GROUP(hiqclkena_b_1, ABX500_ALT_B),
295 AB8500_PIN_GROUP(usbuiccpd_b_1, ABX500_ALT_B),
296 AB8500_PIN_GROUP(i2ctrig1_b_1, ABX500_ALT_B),
297 AB8500_PIN_GROUP(i2ctrig2_b_1, ABX500_ALT_B),
298
299 AB8500_PIN_GROUP(usbvdat_c_1, ABX500_ALT_C),
300};
301
302
303#define AB8500_FUNC_GROUPS(a, b...) \
304static const char * const a##_groups[] = { b };
305
306AB8500_FUNC_GROUPS(sysclkreq, "sysclkreq2_d_1", "sysclkreq3_d_1",
307 "sysclkreq4_d_1", "sysclkreq5_d_1", "sysclkreq6_d_1",
308 "sysclkreq7_d_1", "sysclkreq8_d_1");
309AB8500_FUNC_GROUPS(ycbcr, "ycbcr0123_d_1", "ycbcr4567_a_1");
310AB8500_FUNC_GROUPS(gpio, "gpio1_a_1", "gpio2_a_1", "gpio3_a_1", "gpio4_a_1",
311 "gpio6_a_1", "gpio7_a_1", "gpio8_a_1", "gpio9_a_1",
312 "gpio10_d_1", "gpio11_d_1", "gpio12_d_1", "gpio13_d_1",
313 "gpio14_a_1", "gpio15_a_1", "gpio16_a_1", "gpio17_a_1",
314 "gpio18_a_1", "gpio19_a_1", "gpio20_a_1", "gpio21_a_1",
315 "gpio22_a_1", "gpio23_a_1", "gpio24_a_1", "gpio25_a_1",
316 "gpio26_d_1", "gpio27_a_1", "gpio28_a_1", "gpio29_a_1",
317 "gpio30_a_1", "gpio31_a_1", "gpio32_a_1", "gpio34_a_1",
318 "gpio35_d_1", "gpio36_a_1", "gpio37_a_1", "gpio38_a_1",
319 "gpio39_a_1", "gpio40_a_1", "gpio41_a_1", "gpio42_a_1");
320AB8500_FUNC_GROUPS(pwmout, "pwmout1_d_1", "pwmout2_d_1", "pwmout3_d_1");
321AB8500_FUNC_GROUPS(adi1, "adi1_d_1");
322AB8500_FUNC_GROUPS(usbuicc, "usbuicc_d_1", "usbuiccpd_b_1");
323AB8500_FUNC_GROUPS(dmic, "dmic12_d_1", "dmic34_d_1", "dmic56_d_1");
324AB8500_FUNC_GROUPS(extcpena, "extcpena_d_1");
325AB8500_FUNC_GROUPS(apespi, "apespi_d_1");
326AB8500_FUNC_GROUPS(modsclsda, "modsclsda_d_1");
327AB8500_FUNC_GROUPS(hiqclkena, "hiqclkena_b_1");
328AB8500_FUNC_GROUPS(i2ctrig, "i2ctrig1_b_1", "i2ctrig2_b_1");
329AB8500_FUNC_GROUPS(usbvdat, "usbvdat_c_1");
330
331#define FUNCTION(fname) \
332 { \
333 .name = #fname, \
334 .groups = fname##_groups, \
335 .ngroups = ARRAY_SIZE(fname##_groups), \
336 }
337
338static const struct abx500_function ab8500_functions[] = {
339 FUNCTION(sysclkreq),
340 FUNCTION(ycbcr),
341 FUNCTION(gpio),
342 FUNCTION(pwmout),
343 FUNCTION(adi1),
344 FUNCTION(usbuicc),
345 FUNCTION(dmic),
346 FUNCTION(extcpena),
347 FUNCTION(apespi),
348 FUNCTION(modsclsda),
349 FUNCTION(hiqclkena),
350 FUNCTION(i2ctrig),
351 FUNCTION(usbvdat),
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
389static struct
390alternate_functions ab8500_alternate_functions[AB8500_GPIO_MAX_NUMBER + 1] = {
391 ALTERNATE_FUNCTIONS(0, UNUSED, UNUSED, UNUSED, 0, 0, 0),
392 ALTERNATE_FUNCTIONS(1, 0, UNUSED, UNUSED, 0, 0, 0),
393 ALTERNATE_FUNCTIONS(2, 1, UNUSED, UNUSED, 0, 0, 0),
394 ALTERNATE_FUNCTIONS(3, 2, UNUSED, UNUSED, 0, 0, 0),
395 ALTERNATE_FUNCTIONS(4, 3, UNUSED, UNUSED, 0, 0, 0),
396
397 ALTERNATE_FUNCTIONS(5, UNUSED, UNUSED, UNUSED, 0, 0, 0),
398 ALTERNATE_FUNCTIONS(6, 5, UNUSED, UNUSED, 0, 0, 0),
399 ALTERNATE_FUNCTIONS(7, 6, UNUSED, UNUSED, 0, 0, 0),
400 ALTERNATE_FUNCTIONS(8, 7, UNUSED, UNUSED, 0, 0, 0),
401
402 ALTERNATE_FUNCTIONS(9, 0, UNUSED, UNUSED, 0, 0, 0),
403 ALTERNATE_FUNCTIONS(10, 1, 0, UNUSED, 0, 1, 0),
404 ALTERNATE_FUNCTIONS(11, 2, 1, UNUSED, 0, 1, 0),
405 ALTERNATE_FUNCTIONS(12, 3, 2, UNUSED, 0, 1, 0),
406 ALTERNATE_FUNCTIONS(13, 4, 3, 4, 0, 1, 2),
407 ALTERNATE_FUNCTIONS(14, 5, UNUSED, UNUSED, 0, 0, 0),
408 ALTERNATE_FUNCTIONS(15, 6, UNUSED, UNUSED, 0, 0, 0),
409 ALTERNATE_FUNCTIONS(16, 7, UNUSED, UNUSED, 0, 0, 0),
410
411
412
413
414
415 ALTERNATE_FUNCTIONS(17, 0, UNUSED, UNUSED, 0, 0, 0),
416 ALTERNATE_FUNCTIONS(18, 0, UNUSED, UNUSED, 0, 0, 0),
417 ALTERNATE_FUNCTIONS(19, 0, UNUSED, UNUSED, 0, 0, 0),
418 ALTERNATE_FUNCTIONS(20, 0, UNUSED, UNUSED, 0, 0, 0),
419 ALTERNATE_FUNCTIONS(21, 4, UNUSED, UNUSED, 0, 0, 0),
420 ALTERNATE_FUNCTIONS(22, 5, UNUSED, UNUSED, 0, 0, 0),
421 ALTERNATE_FUNCTIONS(23, 6, UNUSED, UNUSED, 0, 0, 0),
422 ALTERNATE_FUNCTIONS(24, 7, UNUSED, UNUSED, 0, 0, 0),
423
424 ALTERNATE_FUNCTIONS(25, 0, UNUSED, UNUSED, 0, 0, 0),
425
426 ALTERNATE_FUNCTIONS(26, UNUSED, UNUSED, UNUSED, 0, 0, 0),
427 ALTERNATE_FUNCTIONS(27, 2, UNUSED, UNUSED, 0, 0, 0),
428 ALTERNATE_FUNCTIONS(28, 3, UNUSED, UNUSED, 0, 0, 0),
429 ALTERNATE_FUNCTIONS(29, 4, UNUSED, UNUSED, 0, 0, 0),
430 ALTERNATE_FUNCTIONS(30, 5, UNUSED, UNUSED, 0, 0, 0),
431 ALTERNATE_FUNCTIONS(31, 6, UNUSED, UNUSED, 0, 0, 0),
432 ALTERNATE_FUNCTIONS(32, 7, UNUSED, UNUSED, 0, 0, 0),
433
434 ALTERNATE_FUNCTIONS(33, UNUSED, UNUSED, UNUSED, 0, 0, 0),
435 ALTERNATE_FUNCTIONS(34, 1, UNUSED, UNUSED, 0, 0, 0),
436
437 ALTERNATE_FUNCTIONS(35, UNUSED, UNUSED, UNUSED, 0, 0, 0),
438 ALTERNATE_FUNCTIONS(36, 3, UNUSED, UNUSED, 0, 0, 0),
439 ALTERNATE_FUNCTIONS(37, 4, UNUSED, UNUSED, 0, 0, 0),
440 ALTERNATE_FUNCTIONS(38, 5, UNUSED, UNUSED, 0, 0, 0),
441 ALTERNATE_FUNCTIONS(39, 6, UNUSED, UNUSED, 0, 0, 0),
442 ALTERNATE_FUNCTIONS(40, 7, UNUSED, UNUSED, 0, 0, 0),
443
444 ALTERNATE_FUNCTIONS(41, 0, UNUSED, UNUSED, 0, 0, 0),
445 ALTERNATE_FUNCTIONS(42, 1, UNUSED, UNUSED, 0, 0, 0),
446};
447
448
449
450
451
452
453
454
455
456static struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
457 GPIO_IRQ_CLUSTER(6, 13, AB8500_INT_GPIO6R),
458 GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
459 GPIO_IRQ_CLUSTER(36, 41, AB8500_INT_GPIO36R),
460};
461
462static struct abx500_pinctrl_soc_data ab8500_soc = {
463 .gpio_ranges = ab8500_pinranges,
464 .gpio_num_ranges = ARRAY_SIZE(ab8500_pinranges),
465 .pins = ab8500_pins,
466 .npins = ARRAY_SIZE(ab8500_pins),
467 .functions = ab8500_functions,
468 .nfunctions = ARRAY_SIZE(ab8500_functions),
469 .groups = ab8500_groups,
470 .ngroups = ARRAY_SIZE(ab8500_groups),
471 .alternate_functions = ab8500_alternate_functions,
472 .gpio_irq_cluster = ab8500_gpio_irq_cluster,
473 .ngpio_irq_cluster = ARRAY_SIZE(ab8500_gpio_irq_cluster),
474 .irq_gpio_rising_offset = AB8500_INT_GPIO6R,
475 .irq_gpio_falling_offset = AB8500_INT_GPIO6F,
476 .irq_gpio_factor = 1,
477};
478
479void abx500_pinctrl_ab8500_init(struct abx500_pinctrl_soc_data **soc)
480{
481 *soc = &ab8500_soc;
482}
483