aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500-pins.c
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2013-05-28 03:29:34 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-31 10:30:38 -0400
commit8258b187c2ba91ba1ff276fd0413f5b655824247 (patch)
treed29eb89544d8fe2107c8cf756db91a57db82c56c /arch/arm/mach-ux500/board-mop500-pins.c
parentaf86e10cdd35dea3d9c63311daf6de2cc41ac6a8 (diff)
ARM: ux500: add ABx500 pinctrl tables
This adds pin control tables for the ABx500 (AB8500 and AB8505) PMIC, which also happens to act as a multimedia pin expander on the ux500 platforms. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-pins.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500-pins.c262
1 files changed, 262 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
index 3f92308eee36..608606231c78 100644
--- a/arch/arm/mach-ux500/board-mop500-pins.c
+++ b/arch/arm/mach-ux500/board-mop500-pins.c
@@ -9,6 +9,7 @@
9#include <linux/bug.h> 9#include <linux/bug.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/pinctrl/machine.h> 11#include <linux/pinctrl/machine.h>
12#include <linux/pinctrl/pinconf-generic.h>
12#include <linux/platform_data/pinctrl-nomadik.h> 13#include <linux/platform_data/pinctrl-nomadik.h>
13 14
14#include <asm/mach-types.h> 15#include <asm/mach-types.h>
@@ -34,6 +35,11 @@ BIAS(in_pd, PIN_INPUT_PULLDOWN);
34BIAS(out_hi, PIN_OUTPUT_HIGH); 35BIAS(out_hi, PIN_OUTPUT_HIGH);
35BIAS(out_lo, PIN_OUTPUT_LOW); 36BIAS(out_lo, PIN_OUTPUT_LOW);
36BIAS(out_lo_slpm_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE); 37BIAS(out_lo_slpm_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE);
38
39BIAS(abx500_out_lo, PIN_CONF_PACKED(PIN_CONFIG_OUTPUT, 0));
40BIAS(abx500_in_pd, PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_DOWN, 1));
41BIAS(abx500_in_nopull, PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_DOWN, 0));
42
37/* These also force them into GPIO mode */ 43/* These also force them into GPIO mode */
38BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED); 44BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED);
39BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED); 45BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED);
@@ -97,6 +103,252 @@ BIAS(out_wkup_pdis, PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|
97#define DB8500_PIN_STATE(pin, conf, dev, state) \ 103#define DB8500_PIN_STATE(pin, conf, dev, state) \
98 PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-db8500", pin, conf) 104 PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-db8500", pin, conf)
99 105
106#define AB8500_MUX_HOG(group, func) \
107 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-ab8500.0", group, func)
108#define AB8500_PIN_HOG(pin, conf) \
109 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-ab8500.0", pin, abx500_##conf)
110
111#define AB8500_MUX_STATE(group, func, dev, state) \
112 PIN_MAP_MUX_GROUP(dev, state, "pinctrl-ab8500.0", group, func)
113#define AB8500_PIN_STATE(pin, conf, dev, state) \
114 PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-ab8500.0", pin, abx500_##conf)
115
116#define AB8505_MUX_HOG(group, func) \
117 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-ab8505.0", group, func)
118#define AB8505_PIN_HOG(pin, conf) \
119 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-ab8505.0", pin, abx500_##conf)
120
121#define AB8505_MUX_STATE(group, func, dev, state) \
122 PIN_MAP_MUX_GROUP(dev, state, "pinctrl-ab8505.0", group, func)
123#define AB8505_PIN_STATE(pin, conf, dev, state) \
124 PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-ab8505.0", pin, abx500_##conf)
125
126static struct pinctrl_map __initdata ab8500_pinmap[] = {
127 /* Sysclkreq2 */
128 AB8500_MUX_STATE("sysclkreq2_d_1", "sysclkreq", "regulator.35", PINCTRL_STATE_DEFAULT),
129 AB8500_PIN_STATE("GPIO1_T10", in_nopull, "regulator.35", PINCTRL_STATE_DEFAULT),
130 /* sysclkreq2 disable, mux in gpio configured in input pulldown */
131 AB8500_MUX_STATE("gpio1_a_1", "gpio", "regulator.35", PINCTRL_STATE_SLEEP),
132 AB8500_PIN_STATE("GPIO1_T10", in_pd, "regulator.35", PINCTRL_STATE_SLEEP),
133
134 /* pins 2 is muxed in GPIO, configured in INPUT PULL DOWN */
135 AB8500_MUX_HOG("gpio2_a_1", "gpio"),
136 AB8500_PIN_HOG("GPIO2_T9", in_pd),
137
138 /* Sysclkreq4 */
139 AB8500_MUX_STATE("sysclkreq4_d_1", "sysclkreq", "regulator.36", PINCTRL_STATE_DEFAULT),
140 AB8500_PIN_STATE("GPIO3_U9", in_nopull, "regulator.36", PINCTRL_STATE_DEFAULT),
141 /* sysclkreq4 disable, mux in gpio configured in input pulldown */
142 AB8500_MUX_STATE("gpio3_a_1", "gpio", "regulator.36", PINCTRL_STATE_SLEEP),
143 AB8500_PIN_STATE("GPIO3_U9", in_pd, "regulator.36", PINCTRL_STATE_SLEEP),
144
145 /* pins 4 is muxed in GPIO, configured in INPUT PULL DOWN */
146 AB8500_MUX_HOG("gpio4_a_1", "gpio"),
147 AB8500_PIN_HOG("GPIO4_W2", in_pd),
148
149 /*
150 * pins 6,7,8 and 9 are muxed in YCBCR0123
151 * configured in INPUT PULL UP
152 */
153 AB8500_MUX_HOG("ycbcr0123_d_1", "ycbcr"),
154 AB8500_PIN_HOG("GPIO6_Y18", in_nopull),
155 AB8500_PIN_HOG("GPIO7_AA20", in_nopull),
156 AB8500_PIN_HOG("GPIO8_W18", in_nopull),
157 AB8500_PIN_HOG("GPIO9_AA19", in_nopull),
158
159 /*
160 * pins 10,11,12 and 13 are muxed in GPIO
161 * configured in INPUT PULL DOWN
162 */
163 AB8500_MUX_HOG("gpio10_d_1", "gpio"),
164 AB8500_PIN_HOG("GPIO10_U17", in_pd),
165
166 AB8500_MUX_HOG("gpio11_d_1", "gpio"),
167 AB8500_PIN_HOG("GPIO11_AA18", in_pd),
168
169 AB8500_MUX_HOG("gpio12_d_1", "gpio"),
170 AB8500_PIN_HOG("GPIO12_U16", in_pd),
171
172 AB8500_MUX_HOG("gpio13_d_1", "gpio"),
173 AB8500_PIN_HOG("GPIO13_W17", in_pd),
174
175 /*
176 * pins 14,15 are muxed in PWM1 and PWM2
177 * configured in INPUT PULL DOWN
178 */
179 AB8500_MUX_HOG("pwmout1_d_1", "pwmout"),
180 AB8500_PIN_HOG("GPIO14_F14", in_pd),
181
182 AB8500_MUX_HOG("pwmout2_d_1", "pwmout"),
183 AB8500_PIN_HOG("GPIO15_B17", in_pd),
184
185 /*
186 * pins 16 is muxed in GPIO
187 * configured in INPUT PULL DOWN
188 */
189 AB8500_MUX_HOG("gpio16_a_1", "gpio"),
190 AB8500_PIN_HOG("GPIO14_F14", in_pd),
191
192 /*
193 * pins 17,18,19 and 20 are muxed in AUDIO interface 1
194 * configured in INPUT PULL DOWN
195 */
196 AB8500_MUX_HOG("adi1_d_1", "adi1"),
197 AB8500_PIN_HOG("GPIO17_P5", in_pd),
198 AB8500_PIN_HOG("GPIO18_R5", in_pd),
199 AB8500_PIN_HOG("GPIO19_U5", in_pd),
200 AB8500_PIN_HOG("GPIO20_T5", in_pd),
201
202 /*
203 * pins 21,22 and 23 are muxed in USB UICC
204 * configured in INPUT PULL DOWN
205 */
206 AB8500_MUX_HOG("usbuicc_d_1", "usbuicc"),
207 AB8500_PIN_HOG("GPIO21_H19", in_pd),
208 AB8500_PIN_HOG("GPIO22_G20", in_pd),
209 AB8500_PIN_HOG("GPIO23_G19", in_pd),
210
211 /*
212 * pins 24,25 are muxed in GPIO
213 * configured in INPUT PULL DOWN
214 */
215 AB8500_MUX_HOG("gpio24_a_1", "gpio"),
216 AB8500_PIN_HOG("GPIO24_T14", in_pd),
217
218 AB8500_MUX_HOG("gpio25_a_1", "gpio"),
219 AB8500_PIN_HOG("GPIO25_R16", in_pd),
220
221 /*
222 * pins 26 is muxed in GPIO
223 * configured in OUTPUT LOW
224 */
225 AB8500_MUX_HOG("gpio26_d_1", "gpio"),
226 AB8500_PIN_HOG("GPIO26_M16", out_lo),
227
228 /*
229 * pins 27,28 are muxed in DMIC12
230 * configured in INPUT PULL DOWN
231 */
232 AB8500_MUX_HOG("dmic12_d_1", "dmic"),
233 AB8500_PIN_HOG("GPIO27_J6", in_pd),
234 AB8500_PIN_HOG("GPIO28_K6", in_pd),
235
236 /*
237 * pins 29,30 are muxed in DMIC34
238 * configured in INPUT PULL DOWN
239 */
240 AB8500_MUX_HOG("dmic34_d_1", "dmic"),
241 AB8500_PIN_HOG("GPIO29_G6", in_pd),
242 AB8500_PIN_HOG("GPIO30_H6", in_pd),
243
244 /*
245 * pins 31,32 are muxed in DMIC56
246 * configured in INPUT PULL DOWN
247 */
248 AB8500_MUX_HOG("dmic56_d_1", "dmic"),
249 AB8500_PIN_HOG("GPIO31_F5", in_pd),
250 AB8500_PIN_HOG("GPIO32_G5", in_pd),
251
252 /*
253 * pins 34 is muxed in EXTCPENA
254 * configured INPUT PULL DOWN
255 */
256 AB8500_MUX_HOG("extcpena_d_1", "extcpena"),
257 AB8500_PIN_HOG("GPIO34_R17", in_pd),
258
259 /*
260 * pins 35 is muxed in GPIO
261 * configured in OUTPUT LOW
262 */
263 AB8500_MUX_HOG("gpio35_d_1", "gpio"),
264 AB8500_PIN_HOG("GPIO35_W15", in_pd),
265
266 /*
267 * pins 36,37,38 and 39 are muxed in GPIO
268 * configured in INPUT PULL DOWN
269 */
270 AB8500_MUX_HOG("gpio36_a_1", "gpio"),
271 AB8500_PIN_HOG("GPIO36_A17", in_pd),
272
273 AB8500_MUX_HOG("gpio37_a_1", "gpio"),
274 AB8500_PIN_HOG("GPIO37_E15", in_pd),
275
276 AB8500_MUX_HOG("gpio38_a_1", "gpio"),
277 AB8500_PIN_HOG("GPIO38_C17", in_pd),
278
279 AB8500_MUX_HOG("gpio39_a_1", "gpio"),
280 AB8500_PIN_HOG("GPIO39_E16", in_pd),
281
282 /*
283 * pins 40 and 41 are muxed in MODCSLSDA
284 * configured INPUT PULL DOWN
285 */
286 AB8500_MUX_HOG("modsclsda_d_1", "modsclsda"),
287 AB8500_PIN_HOG("GPIO40_T19", in_pd),
288 AB8500_PIN_HOG("GPIO41_U19", in_pd),
289
290 /*
291 * pins 42 is muxed in GPIO
292 * configured INPUT PULL DOWN
293 */
294 AB8500_MUX_HOG("gpio42_a_1", "gpio"),
295 AB8500_PIN_HOG("GPIO42_U2", in_pd),
296};
297
298static struct pinctrl_map __initdata ab8505_pinmap[] = {
299 /* Sysclkreq2 */
300 AB8505_MUX_STATE("sysclkreq2_d_1", "sysclkreq", "regulator.36", PINCTRL_STATE_DEFAULT),
301 AB8505_PIN_STATE("GPIO1_N4", in_nopull, "regulator.36", PINCTRL_STATE_DEFAULT),
302 /* sysclkreq2 disable, mux in gpio configured in input pulldown */
303 AB8505_MUX_STATE("gpio1_a_1", "gpio", "regulator.36", PINCTRL_STATE_SLEEP),
304 AB8505_PIN_STATE("GPIO1_N4", in_pd, "regulator.36", PINCTRL_STATE_SLEEP),
305
306 /* pins 2 is muxed in GPIO, configured in INPUT PULL DOWN */
307 AB8505_MUX_HOG("gpio2_a_1", "gpio"),
308 AB8505_PIN_HOG("GPIO2_R5", in_pd),
309
310 /* Sysclkreq4 */
311 AB8505_MUX_STATE("sysclkreq4_d_1", "sysclkreq", "regulator.37", PINCTRL_STATE_DEFAULT),
312 AB8505_PIN_STATE("GPIO3_P5", in_nopull, "regulator.37", PINCTRL_STATE_DEFAULT),
313 /* sysclkreq4 disable, mux in gpio configured in input pulldown */
314 AB8505_MUX_STATE("gpio3_a_1", "gpio", "regulator.37", PINCTRL_STATE_SLEEP),
315 AB8505_PIN_STATE("GPIO3_P5", in_pd, "regulator.37", PINCTRL_STATE_SLEEP),
316
317 AB8505_MUX_HOG("gpio10_d_1", "gpio"),
318 AB8505_PIN_HOG("GPIO10_B16", in_pd),
319
320 AB8505_MUX_HOG("gpio11_d_1", "gpio"),
321 AB8505_PIN_HOG("GPIO11_B17", in_pd),
322
323 AB8505_MUX_HOG("gpio13_d_1", "gpio"),
324 AB8505_PIN_HOG("GPIO13_D17", in_nopull),
325
326 AB8505_MUX_HOG("pwmout1_d_1", "pwmout"),
327 AB8505_PIN_HOG("GPIO14_C16", in_pd),
328
329 AB8505_MUX_HOG("adi2_d_1", "adi2"),
330 AB8505_PIN_HOG("GPIO17_P2", in_pd),
331 AB8505_PIN_HOG("GPIO18_N3", in_pd),
332 AB8505_PIN_HOG("GPIO19_T1", in_pd),
333 AB8505_PIN_HOG("GPIO20_P3", in_pd),
334
335 AB8505_MUX_HOG("gpio34_a_1", "gpio"),
336 AB8505_PIN_HOG("GPIO34_H14", in_pd),
337
338 AB8505_MUX_HOG("modsclsda_d_1", "modsclsda"),
339 AB8505_PIN_HOG("GPIO40_J15", in_pd),
340 AB8505_PIN_HOG("GPIO41_J14", in_pd),
341
342 AB8505_MUX_HOG("gpio50_d_1", "gpio"),
343 AB8505_PIN_HOG("GPIO50_L4", in_nopull),
344
345 AB8505_MUX_HOG("resethw_d_1", "resethw"),
346 AB8505_PIN_HOG("GPIO52_D16", in_pd),
347
348 AB8505_MUX_HOG("service_d_1", "service"),
349 AB8505_PIN_HOG("GPIO53_D15", in_pd),
350};
351
100/* Pin control settings */ 352/* Pin control settings */
101static struct pinctrl_map __initdata mop500_family_pinmap[] = { 353static struct pinctrl_map __initdata mop500_family_pinmap[] = {
102 /* 354 /*
@@ -816,6 +1068,12 @@ void __init mop500_pinmaps_init(void)
816 pinctrl_register_mappings(mop500_pinmap, 1068 pinctrl_register_mappings(mop500_pinmap,
817 ARRAY_SIZE(mop500_pinmap)); 1069 ARRAY_SIZE(mop500_pinmap));
818 mop500_href_family_pinmaps_init(); 1070 mop500_href_family_pinmaps_init();
1071 if (machine_is_u8520())
1072 pinctrl_register_mappings(ab8505_pinmap,
1073 ARRAY_SIZE(ab8505_pinmap));
1074 else
1075 pinctrl_register_mappings(ab8500_pinmap,
1076 ARRAY_SIZE(ab8500_pinmap));
819} 1077}
820 1078
821void __init snowball_pinmaps_init(void) 1079void __init snowball_pinmaps_init(void)
@@ -826,6 +1084,8 @@ void __init snowball_pinmaps_init(void)
826 ARRAY_SIZE(snowball_pinmap)); 1084 ARRAY_SIZE(snowball_pinmap));
827 pinctrl_register_mappings(u8500_pinmap, 1085 pinctrl_register_mappings(u8500_pinmap,
828 ARRAY_SIZE(u8500_pinmap)); 1086 ARRAY_SIZE(u8500_pinmap));
1087 pinctrl_register_mappings(ab8500_pinmap,
1088 ARRAY_SIZE(ab8500_pinmap));
829} 1089}
830 1090
831void __init hrefv60_pinmaps_init(void) 1091void __init hrefv60_pinmaps_init(void)
@@ -835,4 +1095,6 @@ void __init hrefv60_pinmaps_init(void)
835 pinctrl_register_mappings(hrefv60_pinmap, 1095 pinctrl_register_mappings(hrefv60_pinmap,
836 ARRAY_SIZE(hrefv60_pinmap)); 1096 ARRAY_SIZE(hrefv60_pinmap));
837 mop500_href_family_pinmaps_init(); 1097 mop500_href_family_pinmaps_init();
1098 pinctrl_register_mappings(ab8500_pinmap,
1099 ARRAY_SIZE(ab8500_pinmap));
838} 1100}