diff options
author | Bjorn Andersson <bjorn.andersson@sonymobile.com> | 2013-12-05 21:10:04 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-12-06 08:58:34 -0500 |
commit | 55aaf8342db44c1d0d8bb911c50774f6eaeefbf3 (patch) | |
tree | 0019cc6f70538516e64e95a288844b5bf87a5c2c /drivers/pinctrl/pinctrl-msm8x74.c | |
parent | f365be0925729508fd8e62f8bdb504ef896cb6e0 (diff) |
pinctrl: Add msm8x74 configuration
Add initial definition of parameters for pinctrl-msm for the msm8x74
platform.
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-msm8x74.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-msm8x74.c | 636 |
1 files changed, 636 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-msm8x74.c b/drivers/pinctrl/pinctrl-msm8x74.c new file mode 100644 index 000000000000..762552bc53b9 --- /dev/null +++ b/drivers/pinctrl/pinctrl-msm8x74.c | |||
@@ -0,0 +1,636 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Sony Mobile Communications AB. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/of.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/pinctrl/pinctrl.h> | ||
18 | #include <linux/pinctrl/pinmux.h> | ||
19 | |||
20 | #include "pinctrl-msm.h" | ||
21 | |||
22 | static const struct pinctrl_pin_desc msm8x74_pins[] = { | ||
23 | PINCTRL_PIN(0, "GPIO_0"), | ||
24 | PINCTRL_PIN(1, "GPIO_1"), | ||
25 | PINCTRL_PIN(2, "GPIO_2"), | ||
26 | PINCTRL_PIN(3, "GPIO_3"), | ||
27 | PINCTRL_PIN(4, "GPIO_4"), | ||
28 | PINCTRL_PIN(5, "GPIO_5"), | ||
29 | PINCTRL_PIN(6, "GPIO_6"), | ||
30 | PINCTRL_PIN(7, "GPIO_7"), | ||
31 | PINCTRL_PIN(8, "GPIO_8"), | ||
32 | PINCTRL_PIN(9, "GPIO_9"), | ||
33 | PINCTRL_PIN(10, "GPIO_10"), | ||
34 | PINCTRL_PIN(11, "GPIO_11"), | ||
35 | PINCTRL_PIN(12, "GPIO_12"), | ||
36 | PINCTRL_PIN(13, "GPIO_13"), | ||
37 | PINCTRL_PIN(14, "GPIO_14"), | ||
38 | PINCTRL_PIN(15, "GPIO_15"), | ||
39 | PINCTRL_PIN(16, "GPIO_16"), | ||
40 | PINCTRL_PIN(17, "GPIO_17"), | ||
41 | PINCTRL_PIN(18, "GPIO_18"), | ||
42 | PINCTRL_PIN(19, "GPIO_19"), | ||
43 | PINCTRL_PIN(20, "GPIO_20"), | ||
44 | PINCTRL_PIN(21, "GPIO_21"), | ||
45 | PINCTRL_PIN(22, "GPIO_22"), | ||
46 | PINCTRL_PIN(23, "GPIO_23"), | ||
47 | PINCTRL_PIN(24, "GPIO_24"), | ||
48 | PINCTRL_PIN(25, "GPIO_25"), | ||
49 | PINCTRL_PIN(26, "GPIO_26"), | ||
50 | PINCTRL_PIN(27, "GPIO_27"), | ||
51 | PINCTRL_PIN(28, "GPIO_28"), | ||
52 | PINCTRL_PIN(29, "GPIO_29"), | ||
53 | PINCTRL_PIN(30, "GPIO_30"), | ||
54 | PINCTRL_PIN(31, "GPIO_31"), | ||
55 | PINCTRL_PIN(32, "GPIO_32"), | ||
56 | PINCTRL_PIN(33, "GPIO_33"), | ||
57 | PINCTRL_PIN(34, "GPIO_34"), | ||
58 | PINCTRL_PIN(35, "GPIO_35"), | ||
59 | PINCTRL_PIN(36, "GPIO_36"), | ||
60 | PINCTRL_PIN(37, "GPIO_37"), | ||
61 | PINCTRL_PIN(38, "GPIO_38"), | ||
62 | PINCTRL_PIN(39, "GPIO_39"), | ||
63 | PINCTRL_PIN(40, "GPIO_40"), | ||
64 | PINCTRL_PIN(41, "GPIO_41"), | ||
65 | PINCTRL_PIN(42, "GPIO_42"), | ||
66 | PINCTRL_PIN(43, "GPIO_43"), | ||
67 | PINCTRL_PIN(44, "GPIO_44"), | ||
68 | PINCTRL_PIN(45, "GPIO_45"), | ||
69 | PINCTRL_PIN(46, "GPIO_46"), | ||
70 | PINCTRL_PIN(47, "GPIO_47"), | ||
71 | PINCTRL_PIN(48, "GPIO_48"), | ||
72 | PINCTRL_PIN(49, "GPIO_49"), | ||
73 | PINCTRL_PIN(50, "GPIO_50"), | ||
74 | PINCTRL_PIN(51, "GPIO_51"), | ||
75 | PINCTRL_PIN(52, "GPIO_52"), | ||
76 | PINCTRL_PIN(53, "GPIO_53"), | ||
77 | PINCTRL_PIN(54, "GPIO_54"), | ||
78 | PINCTRL_PIN(55, "GPIO_55"), | ||
79 | PINCTRL_PIN(56, "GPIO_56"), | ||
80 | PINCTRL_PIN(57, "GPIO_57"), | ||
81 | PINCTRL_PIN(58, "GPIO_58"), | ||
82 | PINCTRL_PIN(59, "GPIO_59"), | ||
83 | PINCTRL_PIN(60, "GPIO_60"), | ||
84 | PINCTRL_PIN(61, "GPIO_61"), | ||
85 | PINCTRL_PIN(62, "GPIO_62"), | ||
86 | PINCTRL_PIN(63, "GPIO_63"), | ||
87 | PINCTRL_PIN(64, "GPIO_64"), | ||
88 | PINCTRL_PIN(65, "GPIO_65"), | ||
89 | PINCTRL_PIN(66, "GPIO_66"), | ||
90 | PINCTRL_PIN(67, "GPIO_67"), | ||
91 | PINCTRL_PIN(68, "GPIO_68"), | ||
92 | PINCTRL_PIN(69, "GPIO_69"), | ||
93 | PINCTRL_PIN(70, "GPIO_70"), | ||
94 | PINCTRL_PIN(71, "GPIO_71"), | ||
95 | PINCTRL_PIN(72, "GPIO_72"), | ||
96 | PINCTRL_PIN(73, "GPIO_73"), | ||
97 | PINCTRL_PIN(74, "GPIO_74"), | ||
98 | PINCTRL_PIN(75, "GPIO_75"), | ||
99 | PINCTRL_PIN(76, "GPIO_76"), | ||
100 | PINCTRL_PIN(77, "GPIO_77"), | ||
101 | PINCTRL_PIN(78, "GPIO_78"), | ||
102 | PINCTRL_PIN(79, "GPIO_79"), | ||
103 | PINCTRL_PIN(80, "GPIO_80"), | ||
104 | PINCTRL_PIN(81, "GPIO_81"), | ||
105 | PINCTRL_PIN(82, "GPIO_82"), | ||
106 | PINCTRL_PIN(83, "GPIO_83"), | ||
107 | PINCTRL_PIN(84, "GPIO_84"), | ||
108 | PINCTRL_PIN(85, "GPIO_85"), | ||
109 | PINCTRL_PIN(86, "GPIO_86"), | ||
110 | PINCTRL_PIN(87, "GPIO_87"), | ||
111 | PINCTRL_PIN(88, "GPIO_88"), | ||
112 | PINCTRL_PIN(89, "GPIO_89"), | ||
113 | PINCTRL_PIN(90, "GPIO_90"), | ||
114 | PINCTRL_PIN(91, "GPIO_91"), | ||
115 | PINCTRL_PIN(92, "GPIO_92"), | ||
116 | PINCTRL_PIN(93, "GPIO_93"), | ||
117 | PINCTRL_PIN(94, "GPIO_94"), | ||
118 | PINCTRL_PIN(95, "GPIO_95"), | ||
119 | PINCTRL_PIN(96, "GPIO_96"), | ||
120 | PINCTRL_PIN(97, "GPIO_97"), | ||
121 | PINCTRL_PIN(98, "GPIO_98"), | ||
122 | PINCTRL_PIN(99, "GPIO_99"), | ||
123 | PINCTRL_PIN(100, "GPIO_100"), | ||
124 | PINCTRL_PIN(101, "GPIO_101"), | ||
125 | PINCTRL_PIN(102, "GPIO_102"), | ||
126 | PINCTRL_PIN(103, "GPIO_103"), | ||
127 | PINCTRL_PIN(104, "GPIO_104"), | ||
128 | PINCTRL_PIN(105, "GPIO_105"), | ||
129 | PINCTRL_PIN(106, "GPIO_106"), | ||
130 | PINCTRL_PIN(107, "GPIO_107"), | ||
131 | PINCTRL_PIN(108, "GPIO_108"), | ||
132 | PINCTRL_PIN(109, "GPIO_109"), | ||
133 | PINCTRL_PIN(110, "GPIO_110"), | ||
134 | PINCTRL_PIN(111, "GPIO_111"), | ||
135 | PINCTRL_PIN(112, "GPIO_112"), | ||
136 | PINCTRL_PIN(113, "GPIO_113"), | ||
137 | PINCTRL_PIN(114, "GPIO_114"), | ||
138 | PINCTRL_PIN(115, "GPIO_115"), | ||
139 | PINCTRL_PIN(116, "GPIO_116"), | ||
140 | PINCTRL_PIN(117, "GPIO_117"), | ||
141 | PINCTRL_PIN(118, "GPIO_118"), | ||
142 | PINCTRL_PIN(119, "GPIO_119"), | ||
143 | PINCTRL_PIN(120, "GPIO_120"), | ||
144 | PINCTRL_PIN(121, "GPIO_121"), | ||
145 | PINCTRL_PIN(122, "GPIO_122"), | ||
146 | PINCTRL_PIN(123, "GPIO_123"), | ||
147 | PINCTRL_PIN(124, "GPIO_124"), | ||
148 | PINCTRL_PIN(125, "GPIO_125"), | ||
149 | PINCTRL_PIN(126, "GPIO_126"), | ||
150 | PINCTRL_PIN(127, "GPIO_127"), | ||
151 | PINCTRL_PIN(128, "GPIO_128"), | ||
152 | PINCTRL_PIN(129, "GPIO_129"), | ||
153 | PINCTRL_PIN(130, "GPIO_130"), | ||
154 | PINCTRL_PIN(131, "GPIO_131"), | ||
155 | PINCTRL_PIN(132, "GPIO_132"), | ||
156 | PINCTRL_PIN(133, "GPIO_133"), | ||
157 | PINCTRL_PIN(134, "GPIO_134"), | ||
158 | PINCTRL_PIN(135, "GPIO_135"), | ||
159 | PINCTRL_PIN(136, "GPIO_136"), | ||
160 | PINCTRL_PIN(137, "GPIO_137"), | ||
161 | PINCTRL_PIN(138, "GPIO_138"), | ||
162 | PINCTRL_PIN(139, "GPIO_139"), | ||
163 | PINCTRL_PIN(140, "GPIO_140"), | ||
164 | PINCTRL_PIN(141, "GPIO_141"), | ||
165 | PINCTRL_PIN(142, "GPIO_142"), | ||
166 | PINCTRL_PIN(143, "GPIO_143"), | ||
167 | PINCTRL_PIN(144, "GPIO_144"), | ||
168 | PINCTRL_PIN(145, "GPIO_145"), | ||
169 | |||
170 | PINCTRL_PIN(146, "SDC1_CLK"), | ||
171 | PINCTRL_PIN(147, "SDC1_CMD"), | ||
172 | PINCTRL_PIN(148, "SDC1_DATA"), | ||
173 | PINCTRL_PIN(149, "SDC2_CLK"), | ||
174 | PINCTRL_PIN(150, "SDC2_CMD"), | ||
175 | PINCTRL_PIN(151, "SDC2_DATA"), | ||
176 | }; | ||
177 | |||
178 | #define DECLARE_MSM_GPIO_PINS(pin) static const unsigned int gpio##pin##_pins[] = { pin } | ||
179 | DECLARE_MSM_GPIO_PINS(0); | ||
180 | DECLARE_MSM_GPIO_PINS(1); | ||
181 | DECLARE_MSM_GPIO_PINS(2); | ||
182 | DECLARE_MSM_GPIO_PINS(3); | ||
183 | DECLARE_MSM_GPIO_PINS(4); | ||
184 | DECLARE_MSM_GPIO_PINS(5); | ||
185 | DECLARE_MSM_GPIO_PINS(6); | ||
186 | DECLARE_MSM_GPIO_PINS(7); | ||
187 | DECLARE_MSM_GPIO_PINS(8); | ||
188 | DECLARE_MSM_GPIO_PINS(9); | ||
189 | DECLARE_MSM_GPIO_PINS(10); | ||
190 | DECLARE_MSM_GPIO_PINS(11); | ||
191 | DECLARE_MSM_GPIO_PINS(12); | ||
192 | DECLARE_MSM_GPIO_PINS(13); | ||
193 | DECLARE_MSM_GPIO_PINS(14); | ||
194 | DECLARE_MSM_GPIO_PINS(15); | ||
195 | DECLARE_MSM_GPIO_PINS(16); | ||
196 | DECLARE_MSM_GPIO_PINS(17); | ||
197 | DECLARE_MSM_GPIO_PINS(18); | ||
198 | DECLARE_MSM_GPIO_PINS(19); | ||
199 | DECLARE_MSM_GPIO_PINS(20); | ||
200 | DECLARE_MSM_GPIO_PINS(21); | ||
201 | DECLARE_MSM_GPIO_PINS(22); | ||
202 | DECLARE_MSM_GPIO_PINS(23); | ||
203 | DECLARE_MSM_GPIO_PINS(24); | ||
204 | DECLARE_MSM_GPIO_PINS(25); | ||
205 | DECLARE_MSM_GPIO_PINS(26); | ||
206 | DECLARE_MSM_GPIO_PINS(27); | ||
207 | DECLARE_MSM_GPIO_PINS(28); | ||
208 | DECLARE_MSM_GPIO_PINS(29); | ||
209 | DECLARE_MSM_GPIO_PINS(30); | ||
210 | DECLARE_MSM_GPIO_PINS(31); | ||
211 | DECLARE_MSM_GPIO_PINS(32); | ||
212 | DECLARE_MSM_GPIO_PINS(33); | ||
213 | DECLARE_MSM_GPIO_PINS(34); | ||
214 | DECLARE_MSM_GPIO_PINS(35); | ||
215 | DECLARE_MSM_GPIO_PINS(36); | ||
216 | DECLARE_MSM_GPIO_PINS(37); | ||
217 | DECLARE_MSM_GPIO_PINS(38); | ||
218 | DECLARE_MSM_GPIO_PINS(39); | ||
219 | DECLARE_MSM_GPIO_PINS(40); | ||
220 | DECLARE_MSM_GPIO_PINS(41); | ||
221 | DECLARE_MSM_GPIO_PINS(42); | ||
222 | DECLARE_MSM_GPIO_PINS(43); | ||
223 | DECLARE_MSM_GPIO_PINS(44); | ||
224 | DECLARE_MSM_GPIO_PINS(45); | ||
225 | DECLARE_MSM_GPIO_PINS(46); | ||
226 | DECLARE_MSM_GPIO_PINS(47); | ||
227 | DECLARE_MSM_GPIO_PINS(48); | ||
228 | DECLARE_MSM_GPIO_PINS(49); | ||
229 | DECLARE_MSM_GPIO_PINS(50); | ||
230 | DECLARE_MSM_GPIO_PINS(51); | ||
231 | DECLARE_MSM_GPIO_PINS(52); | ||
232 | DECLARE_MSM_GPIO_PINS(53); | ||
233 | DECLARE_MSM_GPIO_PINS(54); | ||
234 | DECLARE_MSM_GPIO_PINS(55); | ||
235 | DECLARE_MSM_GPIO_PINS(56); | ||
236 | DECLARE_MSM_GPIO_PINS(57); | ||
237 | DECLARE_MSM_GPIO_PINS(58); | ||
238 | DECLARE_MSM_GPIO_PINS(59); | ||
239 | DECLARE_MSM_GPIO_PINS(60); | ||
240 | DECLARE_MSM_GPIO_PINS(61); | ||
241 | DECLARE_MSM_GPIO_PINS(62); | ||
242 | DECLARE_MSM_GPIO_PINS(63); | ||
243 | DECLARE_MSM_GPIO_PINS(64); | ||
244 | DECLARE_MSM_GPIO_PINS(65); | ||
245 | DECLARE_MSM_GPIO_PINS(66); | ||
246 | DECLARE_MSM_GPIO_PINS(67); | ||
247 | DECLARE_MSM_GPIO_PINS(68); | ||
248 | DECLARE_MSM_GPIO_PINS(69); | ||
249 | DECLARE_MSM_GPIO_PINS(70); | ||
250 | DECLARE_MSM_GPIO_PINS(71); | ||
251 | DECLARE_MSM_GPIO_PINS(72); | ||
252 | DECLARE_MSM_GPIO_PINS(73); | ||
253 | DECLARE_MSM_GPIO_PINS(74); | ||
254 | DECLARE_MSM_GPIO_PINS(75); | ||
255 | DECLARE_MSM_GPIO_PINS(76); | ||
256 | DECLARE_MSM_GPIO_PINS(77); | ||
257 | DECLARE_MSM_GPIO_PINS(78); | ||
258 | DECLARE_MSM_GPIO_PINS(79); | ||
259 | DECLARE_MSM_GPIO_PINS(80); | ||
260 | DECLARE_MSM_GPIO_PINS(81); | ||
261 | DECLARE_MSM_GPIO_PINS(82); | ||
262 | DECLARE_MSM_GPIO_PINS(83); | ||
263 | DECLARE_MSM_GPIO_PINS(84); | ||
264 | DECLARE_MSM_GPIO_PINS(85); | ||
265 | DECLARE_MSM_GPIO_PINS(86); | ||
266 | DECLARE_MSM_GPIO_PINS(87); | ||
267 | DECLARE_MSM_GPIO_PINS(88); | ||
268 | DECLARE_MSM_GPIO_PINS(89); | ||
269 | DECLARE_MSM_GPIO_PINS(90); | ||
270 | DECLARE_MSM_GPIO_PINS(91); | ||
271 | DECLARE_MSM_GPIO_PINS(92); | ||
272 | DECLARE_MSM_GPIO_PINS(93); | ||
273 | DECLARE_MSM_GPIO_PINS(94); | ||
274 | DECLARE_MSM_GPIO_PINS(95); | ||
275 | DECLARE_MSM_GPIO_PINS(96); | ||
276 | DECLARE_MSM_GPIO_PINS(97); | ||
277 | DECLARE_MSM_GPIO_PINS(98); | ||
278 | DECLARE_MSM_GPIO_PINS(99); | ||
279 | DECLARE_MSM_GPIO_PINS(100); | ||
280 | DECLARE_MSM_GPIO_PINS(101); | ||
281 | DECLARE_MSM_GPIO_PINS(102); | ||
282 | DECLARE_MSM_GPIO_PINS(103); | ||
283 | DECLARE_MSM_GPIO_PINS(104); | ||
284 | DECLARE_MSM_GPIO_PINS(105); | ||
285 | DECLARE_MSM_GPIO_PINS(106); | ||
286 | DECLARE_MSM_GPIO_PINS(107); | ||
287 | DECLARE_MSM_GPIO_PINS(108); | ||
288 | DECLARE_MSM_GPIO_PINS(109); | ||
289 | DECLARE_MSM_GPIO_PINS(110); | ||
290 | DECLARE_MSM_GPIO_PINS(111); | ||
291 | DECLARE_MSM_GPIO_PINS(112); | ||
292 | DECLARE_MSM_GPIO_PINS(113); | ||
293 | DECLARE_MSM_GPIO_PINS(114); | ||
294 | DECLARE_MSM_GPIO_PINS(115); | ||
295 | DECLARE_MSM_GPIO_PINS(116); | ||
296 | DECLARE_MSM_GPIO_PINS(117); | ||
297 | DECLARE_MSM_GPIO_PINS(118); | ||
298 | DECLARE_MSM_GPIO_PINS(119); | ||
299 | DECLARE_MSM_GPIO_PINS(120); | ||
300 | DECLARE_MSM_GPIO_PINS(121); | ||
301 | DECLARE_MSM_GPIO_PINS(122); | ||
302 | DECLARE_MSM_GPIO_PINS(123); | ||
303 | DECLARE_MSM_GPIO_PINS(124); | ||
304 | DECLARE_MSM_GPIO_PINS(125); | ||
305 | DECLARE_MSM_GPIO_PINS(126); | ||
306 | DECLARE_MSM_GPIO_PINS(127); | ||
307 | DECLARE_MSM_GPIO_PINS(128); | ||
308 | DECLARE_MSM_GPIO_PINS(129); | ||
309 | DECLARE_MSM_GPIO_PINS(130); | ||
310 | DECLARE_MSM_GPIO_PINS(131); | ||
311 | DECLARE_MSM_GPIO_PINS(132); | ||
312 | DECLARE_MSM_GPIO_PINS(133); | ||
313 | DECLARE_MSM_GPIO_PINS(134); | ||
314 | DECLARE_MSM_GPIO_PINS(135); | ||
315 | DECLARE_MSM_GPIO_PINS(136); | ||
316 | DECLARE_MSM_GPIO_PINS(137); | ||
317 | DECLARE_MSM_GPIO_PINS(138); | ||
318 | DECLARE_MSM_GPIO_PINS(139); | ||
319 | DECLARE_MSM_GPIO_PINS(140); | ||
320 | DECLARE_MSM_GPIO_PINS(141); | ||
321 | DECLARE_MSM_GPIO_PINS(142); | ||
322 | DECLARE_MSM_GPIO_PINS(143); | ||
323 | DECLARE_MSM_GPIO_PINS(144); | ||
324 | DECLARE_MSM_GPIO_PINS(145); | ||
325 | |||
326 | static const unsigned int sdc1_clk_pins[] = { 146 }; | ||
327 | static const unsigned int sdc1_cmd_pins[] = { 147 }; | ||
328 | static const unsigned int sdc1_data_pins[] = { 148 }; | ||
329 | static const unsigned int sdc2_clk_pins[] = { 149 }; | ||
330 | static const unsigned int sdc2_cmd_pins[] = { 150 }; | ||
331 | static const unsigned int sdc2_data_pins[] = { 151 }; | ||
332 | |||
333 | #define FUNCTION(fname) \ | ||
334 | [MSM_MUX_##fname] = { \ | ||
335 | .name = #fname, \ | ||
336 | .groups = fname##_groups, \ | ||
337 | .ngroups = ARRAY_SIZE(fname##_groups), \ | ||
338 | } | ||
339 | |||
340 | #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7) \ | ||
341 | { \ | ||
342 | .name = "gpio" #id, \ | ||
343 | .pins = gpio##id##_pins, \ | ||
344 | .npins = ARRAY_SIZE(gpio##id##_pins), \ | ||
345 | .funcs = { \ | ||
346 | MSM_MUX_NA, /* gpio mode */ \ | ||
347 | MSM_MUX_##f1, \ | ||
348 | MSM_MUX_##f2, \ | ||
349 | MSM_MUX_##f3, \ | ||
350 | MSM_MUX_##f4, \ | ||
351 | MSM_MUX_##f5, \ | ||
352 | MSM_MUX_##f6, \ | ||
353 | MSM_MUX_##f7 \ | ||
354 | }, \ | ||
355 | .ctl_reg = 0x1000 + 0x10 * id , \ | ||
356 | .io_reg = 0x1004 + 0x10 * id, \ | ||
357 | .intr_cfg_reg = 0x1008 + 0x10 * id, \ | ||
358 | .intr_status_reg = 0x100c + 0x10 * id, \ | ||
359 | .intr_target_reg = 0x1008 + 0x10 * id, \ | ||
360 | .mux_bit = 2, \ | ||
361 | .pull_bit = 0, \ | ||
362 | .drv_bit = 6, \ | ||
363 | .oe_bit = 9, \ | ||
364 | .in_bit = 0, \ | ||
365 | .out_bit = 1, \ | ||
366 | .intr_enable_bit = 0, \ | ||
367 | .intr_status_bit = 0, \ | ||
368 | .intr_target_bit = 5, \ | ||
369 | .intr_raw_status_bit = 4, \ | ||
370 | .intr_polarity_bit = 1, \ | ||
371 | .intr_detection_bit = 2, \ | ||
372 | .intr_detection_width = 2, \ | ||
373 | } | ||
374 | |||
375 | #define SDC_PINGROUP(pg_name, ctl, pull, drv) \ | ||
376 | { \ | ||
377 | .name = #pg_name, \ | ||
378 | .pins = pg_name##_pins, \ | ||
379 | .npins = ARRAY_SIZE(pg_name##_pins), \ | ||
380 | .ctl_reg = ctl, \ | ||
381 | .io_reg = 0, \ | ||
382 | .intr_cfg_reg = 0, \ | ||
383 | .intr_status_reg = 0, \ | ||
384 | .intr_target_reg = 0, \ | ||
385 | .mux_bit = -1, \ | ||
386 | .pull_bit = pull, \ | ||
387 | .drv_bit = drv, \ | ||
388 | .oe_bit = -1, \ | ||
389 | .in_bit = -1, \ | ||
390 | .out_bit = -1, \ | ||
391 | .intr_enable_bit = -1, \ | ||
392 | .intr_status_bit = -1, \ | ||
393 | .intr_target_bit = -1, \ | ||
394 | .intr_raw_status_bit = -1, \ | ||
395 | .intr_polarity_bit = -1, \ | ||
396 | .intr_detection_bit = -1, \ | ||
397 | .intr_detection_width = -1, \ | ||
398 | } | ||
399 | |||
400 | /* | ||
401 | * TODO: Add the rest of the possible functions and fill out | ||
402 | * the pingroup table below. | ||
403 | */ | ||
404 | enum msm8x74_functions { | ||
405 | MSM_MUX_blsp_i2c2, | ||
406 | MSM_MUX_blsp_i2c6, | ||
407 | MSM_MUX_blsp_i2c11, | ||
408 | MSM_MUX_blsp_spi1, | ||
409 | MSM_MUX_blsp_uart2, | ||
410 | MSM_MUX_blsp_uart8, | ||
411 | MSM_MUX_slimbus, | ||
412 | MSM_MUX_NA, | ||
413 | }; | ||
414 | |||
415 | static const char * const blsp_i2c2_groups[] = { "gpio6", "gpio7" }; | ||
416 | static const char * const blsp_i2c6_groups[] = { "gpio29", "gpio30" }; | ||
417 | static const char * const blsp_i2c11_groups[] = { "gpio83", "gpio84" }; | ||
418 | static const char * const blsp_spi1_groups[] = { "gpio0", "gpio1", "gpio2", "gpio3" }; | ||
419 | static const char * const blsp_uart2_groups[] = { "gpio4", "gpio5" }; | ||
420 | static const char * const blsp_uart8_groups[] = { "gpio45", "gpio46" }; | ||
421 | static const char * const slimbus_groups[] = { "gpio70", "gpio71" }; | ||
422 | |||
423 | static const struct msm_function msm8x74_functions[] = { | ||
424 | FUNCTION(blsp_i2c2), | ||
425 | FUNCTION(blsp_i2c6), | ||
426 | FUNCTION(blsp_i2c11), | ||
427 | FUNCTION(blsp_spi1), | ||
428 | FUNCTION(blsp_uart2), | ||
429 | FUNCTION(blsp_uart8), | ||
430 | FUNCTION(slimbus), | ||
431 | }; | ||
432 | |||
433 | static const struct msm_pingroup msm8x74_groups[] = { | ||
434 | PINGROUP(0, blsp_spi1, NA, NA, NA, NA, NA, NA), | ||
435 | PINGROUP(1, blsp_spi1, NA, NA, NA, NA, NA, NA), | ||
436 | PINGROUP(2, blsp_spi1, NA, NA, NA, NA, NA, NA), | ||
437 | PINGROUP(3, blsp_spi1, NA, NA, NA, NA, NA, NA), | ||
438 | PINGROUP(4, NA, blsp_uart2, NA, NA, NA, NA, NA), | ||
439 | PINGROUP(5, NA, blsp_uart2, NA, NA, NA, NA, NA), | ||
440 | PINGROUP(6, NA, NA, blsp_i2c2, NA, NA, NA, NA), | ||
441 | PINGROUP(7, NA, NA, blsp_i2c2, NA, NA, NA, NA), | ||
442 | PINGROUP(8, NA, NA, NA, NA, NA, NA, NA), | ||
443 | PINGROUP(9, NA, NA, NA, NA, NA, NA, NA), | ||
444 | PINGROUP(10, NA, NA, NA, NA, NA, NA, NA), | ||
445 | PINGROUP(11, NA, NA, NA, NA, NA, NA, NA), | ||
446 | PINGROUP(12, NA, NA, NA, NA, NA, NA, NA), | ||
447 | PINGROUP(13, NA, NA, NA, NA, NA, NA, NA), | ||
448 | PINGROUP(14, NA, NA, NA, NA, NA, NA, NA), | ||
449 | PINGROUP(15, NA, NA, NA, NA, NA, NA, NA), | ||
450 | PINGROUP(16, NA, NA, NA, NA, NA, NA, NA), | ||
451 | PINGROUP(17, NA, NA, NA, NA, NA, NA, NA), | ||
452 | PINGROUP(18, NA, NA, NA, NA, NA, NA, NA), | ||
453 | PINGROUP(19, NA, NA, NA, NA, NA, NA, NA), | ||
454 | PINGROUP(20, NA, NA, NA, NA, NA, NA, NA), | ||
455 | PINGROUP(21, NA, NA, NA, NA, NA, NA, NA), | ||
456 | PINGROUP(22, NA, NA, NA, NA, NA, NA, NA), | ||
457 | PINGROUP(23, NA, NA, NA, NA, NA, NA, NA), | ||
458 | PINGROUP(24, NA, NA, NA, NA, NA, NA, NA), | ||
459 | PINGROUP(25, NA, NA, NA, NA, NA, NA, NA), | ||
460 | PINGROUP(26, NA, NA, NA, NA, NA, NA, NA), | ||
461 | PINGROUP(27, NA, NA, NA, NA, NA, NA, NA), | ||
462 | PINGROUP(28, NA, NA, NA, NA, NA, NA, NA), | ||
463 | PINGROUP(29, NA, NA, blsp_i2c6, NA, NA, NA, NA), | ||
464 | PINGROUP(30, NA, NA, blsp_i2c6, NA, NA, NA, NA), | ||
465 | PINGROUP(31, NA, NA, NA, NA, NA, NA, NA), | ||
466 | PINGROUP(32, NA, NA, NA, NA, NA, NA, NA), | ||
467 | PINGROUP(33, NA, NA, NA, NA, NA, NA, NA), | ||
468 | PINGROUP(34, NA, NA, NA, NA, NA, NA, NA), | ||
469 | PINGROUP(35, NA, NA, NA, NA, NA, NA, NA), | ||
470 | PINGROUP(36, NA, NA, NA, NA, NA, NA, NA), | ||
471 | PINGROUP(37, NA, NA, NA, NA, NA, NA, NA), | ||
472 | PINGROUP(38, NA, NA, NA, NA, NA, NA, NA), | ||
473 | PINGROUP(39, NA, NA, NA, NA, NA, NA, NA), | ||
474 | PINGROUP(40, NA, NA, NA, NA, NA, NA, NA), | ||
475 | PINGROUP(41, NA, NA, NA, NA, NA, NA, NA), | ||
476 | PINGROUP(42, NA, NA, NA, NA, NA, NA, NA), | ||
477 | PINGROUP(43, NA, NA, NA, NA, NA, NA, NA), | ||
478 | PINGROUP(44, NA, NA, NA, NA, NA, NA, NA), | ||
479 | PINGROUP(45, NA, blsp_uart8, NA, NA, NA, NA, NA), | ||
480 | PINGROUP(46, NA, blsp_uart8, NA, NA, NA, NA, NA), | ||
481 | PINGROUP(47, NA, NA, NA, NA, NA, NA, NA), | ||
482 | PINGROUP(48, NA, NA, NA, NA, NA, NA, NA), | ||
483 | PINGROUP(49, NA, NA, NA, NA, NA, NA, NA), | ||
484 | PINGROUP(50, NA, NA, NA, NA, NA, NA, NA), | ||
485 | PINGROUP(51, NA, NA, NA, NA, NA, NA, NA), | ||
486 | PINGROUP(52, NA, NA, NA, NA, NA, NA, NA), | ||
487 | PINGROUP(53, NA, NA, NA, NA, NA, NA, NA), | ||
488 | PINGROUP(54, NA, NA, NA, NA, NA, NA, NA), | ||
489 | PINGROUP(55, NA, NA, NA, NA, NA, NA, NA), | ||
490 | PINGROUP(56, NA, NA, NA, NA, NA, NA, NA), | ||
491 | PINGROUP(57, NA, NA, NA, NA, NA, NA, NA), | ||
492 | PINGROUP(58, NA, NA, NA, NA, NA, NA, NA), | ||
493 | PINGROUP(59, NA, NA, NA, NA, NA, NA, NA), | ||
494 | PINGROUP(60, NA, NA, NA, NA, NA, NA, NA), | ||
495 | PINGROUP(61, NA, NA, NA, NA, NA, NA, NA), | ||
496 | PINGROUP(62, NA, NA, NA, NA, NA, NA, NA), | ||
497 | PINGROUP(63, NA, NA, NA, NA, NA, NA, NA), | ||
498 | PINGROUP(64, NA, NA, NA, NA, NA, NA, NA), | ||
499 | PINGROUP(65, NA, NA, NA, NA, NA, NA, NA), | ||
500 | PINGROUP(66, NA, NA, NA, NA, NA, NA, NA), | ||
501 | PINGROUP(67, NA, NA, NA, NA, NA, NA, NA), | ||
502 | PINGROUP(68, NA, NA, NA, NA, NA, NA, NA), | ||
503 | PINGROUP(69, NA, NA, NA, NA, NA, NA, NA), | ||
504 | PINGROUP(70, slimbus, NA, NA, NA, NA, NA, NA), | ||
505 | PINGROUP(71, slimbus, NA, NA, NA, NA, NA, NA), | ||
506 | PINGROUP(72, NA, NA, NA, NA, NA, NA, NA), | ||
507 | PINGROUP(73, NA, NA, NA, NA, NA, NA, NA), | ||
508 | PINGROUP(74, NA, NA, NA, NA, NA, NA, NA), | ||
509 | PINGROUP(75, NA, NA, NA, NA, NA, NA, NA), | ||
510 | PINGROUP(76, NA, NA, NA, NA, NA, NA, NA), | ||
511 | PINGROUP(77, NA, NA, NA, NA, NA, NA, NA), | ||
512 | PINGROUP(78, NA, NA, NA, NA, NA, NA, NA), | ||
513 | PINGROUP(79, NA, NA, NA, NA, NA, NA, NA), | ||
514 | PINGROUP(80, NA, NA, NA, NA, NA, NA, NA), | ||
515 | PINGROUP(81, NA, NA, NA, NA, NA, NA, NA), | ||
516 | PINGROUP(82, NA, NA, NA, NA, NA, NA, NA), | ||
517 | PINGROUP(83, NA, NA, blsp_i2c11, NA, NA, NA, NA), | ||
518 | PINGROUP(84, NA, NA, blsp_i2c11, NA, NA, NA, NA), | ||
519 | PINGROUP(85, NA, NA, NA, NA, NA, NA, NA), | ||
520 | PINGROUP(86, NA, NA, NA, NA, NA, NA, NA), | ||
521 | PINGROUP(87, NA, NA, NA, NA, NA, NA, NA), | ||
522 | PINGROUP(88, NA, NA, NA, NA, NA, NA, NA), | ||
523 | PINGROUP(89, NA, NA, NA, NA, NA, NA, NA), | ||
524 | PINGROUP(90, NA, NA, NA, NA, NA, NA, NA), | ||
525 | PINGROUP(91, NA, NA, NA, NA, NA, NA, NA), | ||
526 | PINGROUP(92, NA, NA, NA, NA, NA, NA, NA), | ||
527 | PINGROUP(93, NA, NA, NA, NA, NA, NA, NA), | ||
528 | PINGROUP(94, NA, NA, NA, NA, NA, NA, NA), | ||
529 | PINGROUP(95, NA, NA, NA, NA, NA, NA, NA), | ||
530 | PINGROUP(96, NA, NA, NA, NA, NA, NA, NA), | ||
531 | PINGROUP(97, NA, NA, NA, NA, NA, NA, NA), | ||
532 | PINGROUP(98, NA, NA, NA, NA, NA, NA, NA), | ||
533 | PINGROUP(99, NA, NA, NA, NA, NA, NA, NA), | ||
534 | PINGROUP(100, NA, NA, NA, NA, NA, NA, NA), | ||
535 | PINGROUP(101, NA, NA, NA, NA, NA, NA, NA), | ||
536 | PINGROUP(102, NA, NA, NA, NA, NA, NA, NA), | ||
537 | PINGROUP(103, NA, NA, NA, NA, NA, NA, NA), | ||
538 | PINGROUP(104, NA, NA, NA, NA, NA, NA, NA), | ||
539 | PINGROUP(105, NA, NA, NA, NA, NA, NA, NA), | ||
540 | PINGROUP(106, NA, NA, NA, NA, NA, NA, NA), | ||
541 | PINGROUP(107, NA, NA, NA, NA, NA, NA, NA), | ||
542 | PINGROUP(108, NA, NA, NA, NA, NA, NA, NA), | ||
543 | PINGROUP(109, NA, NA, NA, NA, NA, NA, NA), | ||
544 | PINGROUP(110, NA, NA, NA, NA, NA, NA, NA), | ||
545 | PINGROUP(111, NA, NA, NA, NA, NA, NA, NA), | ||
546 | PINGROUP(112, NA, NA, NA, NA, NA, NA, NA), | ||
547 | PINGROUP(113, NA, NA, NA, NA, NA, NA, NA), | ||
548 | PINGROUP(114, NA, NA, NA, NA, NA, NA, NA), | ||
549 | PINGROUP(115, NA, NA, NA, NA, NA, NA, NA), | ||
550 | PINGROUP(116, NA, NA, NA, NA, NA, NA, NA), | ||
551 | PINGROUP(117, NA, NA, NA, NA, NA, NA, NA), | ||
552 | PINGROUP(118, NA, NA, NA, NA, NA, NA, NA), | ||
553 | PINGROUP(119, NA, NA, NA, NA, NA, NA, NA), | ||
554 | PINGROUP(120, NA, NA, NA, NA, NA, NA, NA), | ||
555 | PINGROUP(121, NA, NA, NA, NA, NA, NA, NA), | ||
556 | PINGROUP(122, NA, NA, NA, NA, NA, NA, NA), | ||
557 | PINGROUP(123, NA, NA, NA, NA, NA, NA, NA), | ||
558 | PINGROUP(124, NA, NA, NA, NA, NA, NA, NA), | ||
559 | PINGROUP(125, NA, NA, NA, NA, NA, NA, NA), | ||
560 | PINGROUP(126, NA, NA, NA, NA, NA, NA, NA), | ||
561 | PINGROUP(127, NA, NA, NA, NA, NA, NA, NA), | ||
562 | PINGROUP(128, NA, NA, NA, NA, NA, NA, NA), | ||
563 | PINGROUP(129, NA, NA, NA, NA, NA, NA, NA), | ||
564 | PINGROUP(130, NA, NA, NA, NA, NA, NA, NA), | ||
565 | PINGROUP(131, NA, NA, NA, NA, NA, NA, NA), | ||
566 | PINGROUP(132, NA, NA, NA, NA, NA, NA, NA), | ||
567 | PINGROUP(133, NA, NA, NA, NA, NA, NA, NA), | ||
568 | PINGROUP(134, NA, NA, NA, NA, NA, NA, NA), | ||
569 | PINGROUP(135, NA, NA, NA, NA, NA, NA, NA), | ||
570 | PINGROUP(136, NA, NA, NA, NA, NA, NA, NA), | ||
571 | PINGROUP(137, NA, NA, NA, NA, NA, NA, NA), | ||
572 | PINGROUP(138, NA, NA, NA, NA, NA, NA, NA), | ||
573 | PINGROUP(139, NA, NA, NA, NA, NA, NA, NA), | ||
574 | PINGROUP(140, NA, NA, NA, NA, NA, NA, NA), | ||
575 | PINGROUP(141, NA, NA, NA, NA, NA, NA, NA), | ||
576 | PINGROUP(143, NA, NA, NA, NA, NA, NA, NA), | ||
577 | PINGROUP(143, NA, NA, NA, NA, NA, NA, NA), | ||
578 | PINGROUP(144, NA, NA, NA, NA, NA, NA, NA), | ||
579 | PINGROUP(145, NA, NA, NA, NA, NA, NA, NA), | ||
580 | SDC_PINGROUP(sdc1_clk, 0x2044, 13, 6), | ||
581 | SDC_PINGROUP(sdc1_cmd, 0x2044, 11, 3), | ||
582 | SDC_PINGROUP(sdc1_data, 0x2044, 9, 0), | ||
583 | SDC_PINGROUP(sdc2_clk, 0x2048, 14, 6), | ||
584 | SDC_PINGROUP(sdc2_cmd, 0x2048, 11, 3), | ||
585 | SDC_PINGROUP(sdc2_data, 0x2048, 9, 0), | ||
586 | }; | ||
587 | |||
588 | #define NUM_GPIO_PINGROUPS 146 | ||
589 | |||
590 | static const struct msm_pinctrl_soc_data msm8x74_pinctrl = { | ||
591 | .pins = msm8x74_pins, | ||
592 | .npins = ARRAY_SIZE(msm8x74_pins), | ||
593 | .functions = msm8x74_functions, | ||
594 | .nfunctions = ARRAY_SIZE(msm8x74_functions), | ||
595 | .groups = msm8x74_groups, | ||
596 | .ngroups = ARRAY_SIZE(msm8x74_groups), | ||
597 | .ngpios = NUM_GPIO_PINGROUPS, | ||
598 | }; | ||
599 | |||
600 | static int msm8x74_pinctrl_probe(struct platform_device *pdev) | ||
601 | { | ||
602 | return msm_pinctrl_probe(pdev, &msm8x74_pinctrl); | ||
603 | } | ||
604 | |||
605 | static struct of_device_id msm8x74_pinctrl_of_match[] = { | ||
606 | { .compatible = "qcom,msm8x74-pinctrl", }, | ||
607 | { }, | ||
608 | }; | ||
609 | |||
610 | static struct platform_driver msm8x74_pinctrl_driver = { | ||
611 | .driver = { | ||
612 | .name = "msm8x74-pinctrl", | ||
613 | .owner = THIS_MODULE, | ||
614 | .of_match_table = msm8x74_pinctrl_of_match, | ||
615 | }, | ||
616 | .probe = msm8x74_pinctrl_probe, | ||
617 | .remove = msm_pinctrl_remove, | ||
618 | }; | ||
619 | |||
620 | static int __init msm8x74_pinctrl_init(void) | ||
621 | { | ||
622 | return platform_driver_register(&msm8x74_pinctrl_driver); | ||
623 | } | ||
624 | arch_initcall(msm8x74_pinctrl_init); | ||
625 | |||
626 | static void __exit msm8x74_pinctrl_exit(void) | ||
627 | { | ||
628 | platform_driver_unregister(&msm8x74_pinctrl_driver); | ||
629 | } | ||
630 | module_exit(msm8x74_pinctrl_exit); | ||
631 | |||
632 | MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson@sonymobile.com>"); | ||
633 | MODULE_DESCRIPTION("Qualcomm MSM8x74 pinctrl driver"); | ||
634 | MODULE_LICENSE("GPL v2"); | ||
635 | MODULE_DEVICE_TABLE(of, msm8x74_pinctrl_of_match); | ||
636 | |||