Staging: Panel: panel: Fixed checkpatch line length warnings
[linux/fpc-iii.git] / arch / arm / mach-ux500 / board-mop500-pins.c
blob947bd9eca079c0d738c5d7e9a0f53841e322a571
1 /*
2 * Copyright (C) ST-Ericsson SA 2010
4 * License terms: GNU General Public License (GPL) version 2
5 */
7 #include <linux/kernel.h>
8 #include <linux/init.h>
9 #include <linux/bug.h>
10 #include <linux/string.h>
11 #include <linux/pinctrl/machine.h>
12 #include <linux/platform_data/pinctrl-nomadik.h>
14 #include <asm/mach-types.h>
16 #include "pins-db8500.h"
17 #include "board-mop500.h"
19 enum custom_pin_cfg_t {
20 PINS_FOR_DEFAULT,
21 PINS_FOR_U9500,
24 static enum custom_pin_cfg_t pinsfor;
26 /* These simply sets bias for pins */
27 #define BIAS(a,b) static unsigned long a[] = { b }
29 BIAS(pd, PIN_PULL_DOWN);
30 BIAS(in_nopull, PIN_INPUT_NOPULL);
31 BIAS(in_nopull_slpm_nowkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_DISABLE);
32 BIAS(in_pu, PIN_INPUT_PULLUP);
33 BIAS(in_pd, PIN_INPUT_PULLDOWN);
34 BIAS(out_hi, PIN_OUTPUT_HIGH);
35 BIAS(out_lo, PIN_OUTPUT_LOW);
36 BIAS(out_lo_slpm_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE);
37 /* These also force them into GPIO mode */
38 BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED);
39 BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED);
40 BIAS(gpio_in_pu_slpm_gpio_nopull, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED|PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL);
41 BIAS(gpio_in_pd_slpm_gpio_nopull, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED|PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL);
42 BIAS(gpio_out_hi, PIN_OUTPUT_HIGH|PIN_GPIOMODE_ENABLED);
43 BIAS(gpio_out_lo, PIN_OUTPUT_LOW|PIN_GPIOMODE_ENABLED);
44 /* Sleep modes */
45 BIAS(slpm_in_nopull_wkup, PIN_SLEEPMODE_ENABLED|
46 PIN_SLPM_DIR_INPUT|PIN_SLPM_PULL_NONE|PIN_SLPM_WAKEUP_ENABLE);
47 BIAS(slpm_in_wkup_pdis, PIN_SLEEPMODE_ENABLED|
48 PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
49 BIAS(slpm_in_wkup_pdis_en, PIN_SLEEPMODE_ENABLED|
50 PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_ENABLED);
51 BIAS(slpm_wkup_pdis, PIN_SLEEPMODE_ENABLED|
52 PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
53 BIAS(slpm_wkup_pdis_en, PIN_SLEEPMODE_ENABLED|
54 PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_ENABLED);
55 BIAS(slpm_out_lo_pdis, PIN_SLEEPMODE_ENABLED|
56 PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE|PIN_SLPM_PDIS_DISABLED);
57 BIAS(slpm_out_lo_wkup, PIN_SLEEPMODE_ENABLED|
58 PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE);
59 BIAS(slpm_out_lo_wkup_pdis, PIN_SLEEPMODE_ENABLED|
60 PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
61 BIAS(slpm_out_hi_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_HIGH|
62 PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
63 BIAS(slpm_in_nopull_wkup_pdis, PIN_SLEEPMODE_ENABLED|
64 PIN_SLPM_INPUT_NOPULL|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
65 BIAS(slpm_in_pu_wkup_pdis_en, PIN_SLEEPMODE_ENABLED|PIN_SLPM_INPUT_PULLUP|
66 PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_ENABLED);
67 BIAS(slpm_out_wkup_pdis, PIN_SLEEPMODE_ENABLED|
68 PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
69 BIAS(out_lo_wkup_pdis, PIN_SLPM_OUTPUT_LOW|
70 PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
71 BIAS(in_wkup_pdis_en, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|
72 PIN_SLPM_PDIS_ENABLED);
73 BIAS(in_wkup_pdis, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|
74 PIN_SLPM_PDIS_DISABLED);
75 BIAS(out_wkup_pdis, PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|
76 PIN_SLPM_PDIS_DISABLED);
78 /* We use these to define hog settings that are always done on boot */
79 #define DB8500_MUX_HOG(group,func) \
80 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-db8500", group, func)
81 #define DB8500_PIN_HOG(pin,conf) \
82 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-db8500", pin, conf)
84 /* These are default states associated with device and changed runtime */
85 #define DB8500_MUX(group,func,dev) \
86 PIN_MAP_MUX_GROUP_DEFAULT(dev, "pinctrl-db8500", group, func)
87 #define DB8500_PIN(pin,conf,dev) \
88 PIN_MAP_CONFIGS_PIN_DEFAULT(dev, "pinctrl-db8500", pin, conf)
89 #define DB8500_PIN_IDLE(pin, conf, dev) \
90 PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_IDLE, "pinctrl-db8500", \
91 pin, conf)
92 #define DB8500_PIN_SLEEP(pin, conf, dev) \
93 PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \
94 pin, conf)
95 #define DB8500_MUX_STATE(group, func, dev, state) \
96 PIN_MAP_MUX_GROUP(dev, state, "pinctrl-db8500", group, func)
97 #define DB8500_PIN_STATE(pin, conf, dev, state) \
98 PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-db8500", pin, conf)
100 /* Pin control settings */
101 static struct pinctrl_map __initdata mop500_family_pinmap[] = {
103 * uMSP0, mux in 4 pins, regular placement of RX/TX
104 * explicitly set the pins to no pull
106 DB8500_MUX_HOG("msp0txrx_a_1", "msp0"),
107 DB8500_MUX_HOG("msp0tfstck_a_1", "msp0"),
108 DB8500_PIN_HOG("GPIO12_AC4", in_nopull), /* TXD */
109 DB8500_PIN_HOG("GPIO15_AC3", in_nopull), /* RXD */
110 DB8500_PIN_HOG("GPIO13_AF3", in_nopull), /* TFS */
111 DB8500_PIN_HOG("GPIO14_AE3", in_nopull), /* TCK */
112 /* MSP2 for HDMI, pull down TXD, TCK, TFS */
113 DB8500_MUX_HOG("msp2_a_1", "msp2"),
114 DB8500_PIN_HOG("GPIO193_AH27", in_pd), /* TXD */
115 DB8500_PIN_HOG("GPIO194_AF27", in_pd), /* TCK */
116 DB8500_PIN_HOG("GPIO195_AG28", in_pd), /* TFS */
117 DB8500_PIN_HOG("GPIO196_AG26", out_lo), /* RXD */
119 * LCD, set TE0 (using LCD VSI0) and D14 (touch screen interrupt) to
120 * pull-up
121 * TODO: is this really correct? Snowball doesn't have a LCD.
123 DB8500_MUX_HOG("lcdvsi0_a_1", "lcd"),
124 DB8500_PIN_HOG("GPIO68_E1", in_pu),
125 DB8500_PIN_HOG("GPIO84_C2", gpio_in_pu),
127 * STMPE1601/tc35893 keypad IRQ GPIO 218
128 * TODO: set for snowball and HREF really??
130 DB8500_PIN_HOG("GPIO218_AH11", gpio_in_pu),
132 * UART0, we do not mux in u0 here.
133 * uart-0 pins gpio configuration should be kept intact to prevent
134 * a glitch in tx line when the tty dev is opened. Later these pins
135 * are configured by uart driver
137 DB8500_PIN_HOG("GPIO0_AJ5", in_pu), /* CTS */
138 DB8500_PIN_HOG("GPIO1_AJ3", out_hi), /* RTS */
139 DB8500_PIN_HOG("GPIO2_AH4", in_pu), /* RXD */
140 DB8500_PIN_HOG("GPIO3_AH3", out_hi), /* TXD */
142 * Mux in UART2 on altfunction C and set pull-ups.
143 * TODO: is this used on U8500 variants and Snowball really?
144 * The setting on GPIO31 conflicts with magnetometer use on hrefv60
146 /* default state for UART2 */
147 DB8500_MUX("u2rxtx_c_1", "u2", "uart2"),
148 DB8500_PIN("GPIO29_W2", in_pu, "uart2"), /* RXD */
149 DB8500_PIN("GPIO30_W3", out_hi, "uart2"), /* TXD */
150 /* Sleep state for UART2 */
151 DB8500_PIN_SLEEP("GPIO29_W2", in_wkup_pdis, "uart2"),
152 DB8500_PIN_SLEEP("GPIO30_W3", out_wkup_pdis, "uart2"),
154 * The following pin sets were known as "runtime pins" before being
155 * converted to the pinctrl model. Here we model them as "default"
156 * states.
158 /* Mux in UART0 after initialization */
159 DB8500_MUX("u0_a_1", "u0", "uart0"),
160 DB8500_PIN("GPIO0_AJ5", in_pu, "uart0"), /* CTS */
161 DB8500_PIN("GPIO1_AJ3", out_hi, "uart0"), /* RTS */
162 DB8500_PIN("GPIO2_AH4", in_pu, "uart0"), /* RXD */
163 DB8500_PIN("GPIO3_AH3", out_hi, "uart0"), /* TXD */
164 /* Sleep state for UART0 */
165 DB8500_PIN_SLEEP("GPIO0_AJ5", slpm_in_wkup_pdis, "uart0"),
166 DB8500_PIN_SLEEP("GPIO1_AJ3", slpm_out_hi_wkup_pdis, "uart0"),
167 DB8500_PIN_SLEEP("GPIO2_AH4", slpm_in_wkup_pdis, "uart0"),
168 DB8500_PIN_SLEEP("GPIO3_AH3", slpm_out_wkup_pdis, "uart0"),
169 /* Mux in UART1 after initialization */
170 DB8500_MUX("u1rxtx_a_1", "u1", "uart1"),
171 DB8500_PIN("GPIO4_AH6", in_pu, "uart1"), /* RXD */
172 DB8500_PIN("GPIO5_AG6", out_hi, "uart1"), /* TXD */
173 /* Sleep state for UART1 */
174 DB8500_PIN_SLEEP("GPIO4_AH6", slpm_in_wkup_pdis, "uart1"),
175 DB8500_PIN_SLEEP("GPIO5_AG6", slpm_out_wkup_pdis, "uart1"),
176 /* MSP1 for ALSA codec */
177 DB8500_MUX("msp1txrx_a_1", "msp1", "ux500-msp-i2s.1"),
178 DB8500_MUX("msp1_a_1", "msp1", "ux500-msp-i2s.1"),
179 DB8500_PIN("GPIO33_AF2", out_lo_slpm_nowkup, "ux500-msp-i2s.1"),
180 DB8500_PIN("GPIO34_AE1", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"),
181 DB8500_PIN("GPIO35_AE2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"),
182 DB8500_PIN("GPIO36_AG2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"),
183 /* MSP1 sleep state */
184 DB8500_PIN_SLEEP("GPIO33_AF2", slpm_out_lo_wkup, "ux500-msp-i2s.1"),
185 DB8500_PIN_SLEEP("GPIO34_AE1", slpm_in_nopull_wkup, "ux500-msp-i2s.1"),
186 DB8500_PIN_SLEEP("GPIO35_AE2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"),
187 DB8500_PIN_SLEEP("GPIO36_AG2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"),
188 /* Mux in LCD data lines 8 thru 11 and LCDA CLK for MCDE TVOUT */
189 DB8500_MUX("lcd_d8_d11_a_1", "lcd", "mcde-tvout"),
190 DB8500_MUX("lcdaclk_b_1", "lcda", "mcde-tvout"),
191 /* Mux in LCD VSI1 and pull it up for MCDE HDMI output */
192 DB8500_MUX("lcdvsi1_a_1", "lcd", "0-0070"),
193 DB8500_PIN("GPIO69_E2", in_pu, "0-0070"),
194 /* LCD VSI1 sleep state */
195 DB8500_PIN_SLEEP("GPIO69_E2", slpm_in_wkup_pdis, "0-0070"),
196 /* Mux in i2c0 block, default state */
197 DB8500_MUX("i2c0_a_1", "i2c0", "nmk-i2c.0"),
198 /* i2c0 sleep state */
199 DB8500_PIN_SLEEP("GPIO147_C15", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SDA */
200 DB8500_PIN_SLEEP("GPIO148_B16", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SCL */
201 /* Mux in i2c1 block, default state */
202 DB8500_MUX("i2c1_b_2", "i2c1", "nmk-i2c.1"),
203 /* i2c1 sleep state */
204 DB8500_PIN_SLEEP("GPIO16_AD3", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SDA */
205 DB8500_PIN_SLEEP("GPIO17_AD4", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SCL */
206 /* Mux in i2c2 block, default state */
207 DB8500_MUX("i2c2_b_2", "i2c2", "nmk-i2c.2"),
208 /* i2c2 sleep state */
209 DB8500_PIN_SLEEP("GPIO10_AF5", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SDA */
210 DB8500_PIN_SLEEP("GPIO11_AG4", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SCL */
211 /* Mux in i2c3 block, default state */
212 DB8500_MUX("i2c3_c_2", "i2c3", "nmk-i2c.3"),
213 /* i2c3 sleep state */
214 DB8500_PIN_SLEEP("GPIO229_AG7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SDA */
215 DB8500_PIN_SLEEP("GPIO230_AF7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SCL */
216 /* Mux in SDI0 (here called MC0) used for removable MMC/SD/SDIO cards */
217 DB8500_MUX("mc0_a_1", "mc0", "sdi0"),
218 DB8500_PIN("GPIO18_AC2", out_hi, "sdi0"), /* CMDDIR */
219 DB8500_PIN("GPIO19_AC1", out_hi, "sdi0"), /* DAT0DIR */
220 DB8500_PIN("GPIO20_AB4", out_hi, "sdi0"), /* DAT2DIR */
221 DB8500_PIN("GPIO22_AA3", in_nopull, "sdi0"), /* FBCLK */
222 DB8500_PIN("GPIO23_AA4", out_lo, "sdi0"), /* CLK */
223 DB8500_PIN("GPIO24_AB2", in_pu, "sdi0"), /* CMD */
224 DB8500_PIN("GPIO25_Y4", in_pu, "sdi0"), /* DAT0 */
225 DB8500_PIN("GPIO26_Y2", in_pu, "sdi0"), /* DAT1 */
226 DB8500_PIN("GPIO27_AA2", in_pu, "sdi0"), /* DAT2 */
227 DB8500_PIN("GPIO28_AA1", in_pu, "sdi0"), /* DAT3 */
228 /* SDI0 sleep state */
229 DB8500_PIN_SLEEP("GPIO18_AC2", slpm_out_hi_wkup_pdis, "sdi0"),
230 DB8500_PIN_SLEEP("GPIO19_AC1", slpm_out_hi_wkup_pdis, "sdi0"),
231 DB8500_PIN_SLEEP("GPIO20_AB4", slpm_out_hi_wkup_pdis, "sdi0"),
232 DB8500_PIN_SLEEP("GPIO22_AA3", slpm_in_wkup_pdis, "sdi0"),
233 DB8500_PIN_SLEEP("GPIO23_AA4", slpm_out_lo_wkup_pdis, "sdi0"),
234 DB8500_PIN_SLEEP("GPIO24_AB2", slpm_in_wkup_pdis, "sdi0"),
235 DB8500_PIN_SLEEP("GPIO25_Y4", slpm_in_wkup_pdis, "sdi0"),
236 DB8500_PIN_SLEEP("GPIO26_Y2", slpm_in_wkup_pdis, "sdi0"),
237 DB8500_PIN_SLEEP("GPIO27_AA2", slpm_in_wkup_pdis, "sdi0"),
238 DB8500_PIN_SLEEP("GPIO28_AA1", slpm_in_wkup_pdis, "sdi0"),
240 /* Mux in SDI1 (here called MC1) used for SDIO for CW1200 WLAN */
241 DB8500_MUX("mc1_a_1", "mc1", "sdi1"),
242 DB8500_PIN("GPIO208_AH16", out_lo, "sdi1"), /* CLK */
243 DB8500_PIN("GPIO209_AG15", in_nopull, "sdi1"), /* FBCLK */
244 DB8500_PIN("GPIO210_AJ15", in_pu, "sdi1"), /* CMD */
245 DB8500_PIN("GPIO211_AG14", in_pu, "sdi1"), /* DAT0 */
246 DB8500_PIN("GPIO212_AF13", in_pu, "sdi1"), /* DAT1 */
247 DB8500_PIN("GPIO213_AG13", in_pu, "sdi1"), /* DAT2 */
248 DB8500_PIN("GPIO214_AH15", in_pu, "sdi1"), /* DAT3 */
249 /* SDI1 sleep state */
250 DB8500_PIN_SLEEP("GPIO208_AH16", slpm_out_lo_wkup_pdis, "sdi1"), /* CLK */
251 DB8500_PIN_SLEEP("GPIO209_AG15", slpm_in_wkup_pdis, "sdi1"), /* FBCLK */
252 DB8500_PIN_SLEEP("GPIO210_AJ15", slpm_in_wkup_pdis, "sdi1"), /* CMD */
253 DB8500_PIN_SLEEP("GPIO211_AG14", slpm_in_wkup_pdis, "sdi1"), /* DAT0 */
254 DB8500_PIN_SLEEP("GPIO212_AF13", slpm_in_wkup_pdis, "sdi1"), /* DAT1 */
255 DB8500_PIN_SLEEP("GPIO213_AG13", slpm_in_wkup_pdis, "sdi1"), /* DAT2 */
256 DB8500_PIN_SLEEP("GPIO214_AH15", slpm_in_wkup_pdis, "sdi1"), /* DAT3 */
258 /* Mux in SDI2 (here called MC2) used for for PoP eMMC */
259 DB8500_MUX("mc2_a_1", "mc2", "sdi2"),
260 DB8500_PIN("GPIO128_A5", out_lo, "sdi2"), /* CLK */
261 DB8500_PIN("GPIO129_B4", in_pu, "sdi2"), /* CMD */
262 DB8500_PIN("GPIO130_C8", in_nopull, "sdi2"), /* FBCLK */
263 DB8500_PIN("GPIO131_A12", in_pu, "sdi2"), /* DAT0 */
264 DB8500_PIN("GPIO132_C10", in_pu, "sdi2"), /* DAT1 */
265 DB8500_PIN("GPIO133_B10", in_pu, "sdi2"), /* DAT2 */
266 DB8500_PIN("GPIO134_B9", in_pu, "sdi2"), /* DAT3 */
267 DB8500_PIN("GPIO135_A9", in_pu, "sdi2"), /* DAT4 */
268 DB8500_PIN("GPIO136_C7", in_pu, "sdi2"), /* DAT5 */
269 DB8500_PIN("GPIO137_A7", in_pu, "sdi2"), /* DAT6 */
270 DB8500_PIN("GPIO138_C5", in_pu, "sdi2"), /* DAT7 */
271 /* SDI2 sleep state */
272 DB8500_PIN_SLEEP("GPIO128_A5", out_lo_wkup_pdis, "sdi2"), /* CLK */
273 DB8500_PIN_SLEEP("GPIO129_B4", in_wkup_pdis_en, "sdi2"), /* CMD */
274 DB8500_PIN_SLEEP("GPIO130_C8", in_wkup_pdis_en, "sdi2"), /* FBCLK */
275 DB8500_PIN_SLEEP("GPIO131_A12", in_wkup_pdis, "sdi2"), /* DAT0 */
276 DB8500_PIN_SLEEP("GPIO132_C10", in_wkup_pdis, "sdi2"), /* DAT1 */
277 DB8500_PIN_SLEEP("GPIO133_B10", in_wkup_pdis, "sdi2"), /* DAT2 */
278 DB8500_PIN_SLEEP("GPIO134_B9", in_wkup_pdis, "sdi2"), /* DAT3 */
279 DB8500_PIN_SLEEP("GPIO135_A9", in_wkup_pdis, "sdi2"), /* DAT4 */
280 DB8500_PIN_SLEEP("GPIO136_C7", in_wkup_pdis, "sdi2"), /* DAT5 */
281 DB8500_PIN_SLEEP("GPIO137_A7", in_wkup_pdis, "sdi2"), /* DAT6 */
282 DB8500_PIN_SLEEP("GPIO138_C5", in_wkup_pdis, "sdi2"), /* DAT7 */
284 /* Mux in SDI4 (here called MC4) used for for PCB-mounted eMMC */
285 DB8500_MUX("mc4_a_1", "mc4", "sdi4"),
286 DB8500_PIN("GPIO197_AH24", in_pu, "sdi4"), /* DAT3 */
287 DB8500_PIN("GPIO198_AG25", in_pu, "sdi4"), /* DAT2 */
288 DB8500_PIN("GPIO199_AH23", in_pu, "sdi4"), /* DAT1 */
289 DB8500_PIN("GPIO200_AH26", in_pu, "sdi4"), /* DAT0 */
290 DB8500_PIN("GPIO201_AF24", in_pu, "sdi4"), /* CMD */
291 DB8500_PIN("GPIO202_AF25", in_nopull, "sdi4"), /* FBCLK */
292 DB8500_PIN("GPIO203_AE23", out_lo, "sdi4"), /* CLK */
293 DB8500_PIN("GPIO204_AF23", in_pu, "sdi4"), /* DAT7 */
294 DB8500_PIN("GPIO205_AG23", in_pu, "sdi4"), /* DAT6 */
295 DB8500_PIN("GPIO206_AG24", in_pu, "sdi4"), /* DAT5 */
296 DB8500_PIN("GPIO207_AJ23", in_pu, "sdi4"), /* DAT4 */
297 /*SDI4 sleep state */
298 DB8500_PIN_SLEEP("GPIO197_AH24", slpm_in_wkup_pdis, "sdi4"), /* DAT3 */
299 DB8500_PIN_SLEEP("GPIO198_AG25", slpm_in_wkup_pdis, "sdi4"), /* DAT2 */
300 DB8500_PIN_SLEEP("GPIO199_AH23", slpm_in_wkup_pdis, "sdi4"), /* DAT1 */
301 DB8500_PIN_SLEEP("GPIO200_AH26", slpm_in_wkup_pdis, "sdi4"), /* DAT0 */
302 DB8500_PIN_SLEEP("GPIO201_AF24", slpm_in_wkup_pdis, "sdi4"), /* CMD */
303 DB8500_PIN_SLEEP("GPIO202_AF25", slpm_in_wkup_pdis, "sdi4"), /* FBCLK */
304 DB8500_PIN_SLEEP("GPIO203_AE23", slpm_out_lo_wkup_pdis, "sdi4"), /* CLK */
305 DB8500_PIN_SLEEP("GPIO204_AF23", slpm_in_wkup_pdis, "sdi4"), /* DAT7 */
306 DB8500_PIN_SLEEP("GPIO205_AG23", slpm_in_wkup_pdis, "sdi4"), /* DAT6 */
307 DB8500_PIN_SLEEP("GPIO206_AG24", slpm_in_wkup_pdis, "sdi4"), /* DAT5 */
308 DB8500_PIN_SLEEP("GPIO207_AJ23", slpm_in_wkup_pdis, "sdi4"), /* DAT4 */
310 /* Mux in USB pins, drive STP high */
311 /* USB default state */
312 DB8500_MUX("usb_a_1", "usb", "ab8500-usb.0"),
313 DB8500_PIN("GPIO257_AE29", out_hi, "ab8500-usb.0"), /* STP */
314 /* USB sleep state */
315 DB8500_PIN_SLEEP("GPIO256_AF28", slpm_wkup_pdis_en, "ab8500-usb.0"), /* NXT */
316 DB8500_PIN_SLEEP("GPIO257_AE29", slpm_out_hi_wkup_pdis, "ab8500-usb.0"), /* STP */
317 DB8500_PIN_SLEEP("GPIO258_AD29", slpm_wkup_pdis_en, "ab8500-usb.0"), /* XCLK */
318 DB8500_PIN_SLEEP("GPIO259_AC29", slpm_wkup_pdis_en, "ab8500-usb.0"), /* DIR */
319 DB8500_PIN_SLEEP("GPIO260_AD28", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT7 */
320 DB8500_PIN_SLEEP("GPIO261_AD26", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT6 */
321 DB8500_PIN_SLEEP("GPIO262_AE26", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT5 */
322 DB8500_PIN_SLEEP("GPIO263_AG29", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT4 */
323 DB8500_PIN_SLEEP("GPIO264_AE27", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT3 */
324 DB8500_PIN_SLEEP("GPIO265_AD27", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT2 */
325 DB8500_PIN_SLEEP("GPIO266_AC28", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT1 */
326 DB8500_PIN_SLEEP("GPIO267_AC27", slpm_in_wkup_pdis_en, "ab8500-usb.0"), /* DAT0 */
328 /* Mux in SPI2 pins on the "other C1" altfunction */
329 DB8500_MUX("spi2_oc1_2", "spi2", "spi2"),
330 DB8500_PIN("GPIO216_AG12", gpio_out_hi, "spi2"), /* FRM */
331 DB8500_PIN("GPIO218_AH11", in_pd, "spi2"), /* RXD */
332 DB8500_PIN("GPIO215_AH13", out_lo, "spi2"), /* TXD */
333 DB8500_PIN("GPIO217_AH12", out_lo, "spi2"), /* CLK */
334 /* SPI2 idle state */
335 DB8500_PIN_IDLE("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */
336 DB8500_PIN_IDLE("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */
337 DB8500_PIN_IDLE("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */
338 /* SPI2 sleep state */
339 DB8500_PIN_SLEEP("GPIO216_AG12", slpm_in_wkup_pdis, "spi2"), /* FRM */
340 DB8500_PIN_SLEEP("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */
341 DB8500_PIN_SLEEP("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */
342 DB8500_PIN_SLEEP("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */
344 /* ske default state */
345 DB8500_MUX("kp_a_2", "kp", "nmk-ske-keypad"),
346 DB8500_PIN("GPIO153_B17", in_pd, "nmk-ske-keypad"), /* I7 */
347 DB8500_PIN("GPIO154_C16", in_pd, "nmk-ske-keypad"), /* I6 */
348 DB8500_PIN("GPIO155_C19", in_pd, "nmk-ske-keypad"), /* I5 */
349 DB8500_PIN("GPIO156_C17", in_pd, "nmk-ske-keypad"), /* I4 */
350 DB8500_PIN("GPIO161_D21", in_pd, "nmk-ske-keypad"), /* I3 */
351 DB8500_PIN("GPIO162_D20", in_pd, "nmk-ske-keypad"), /* I2 */
352 DB8500_PIN("GPIO163_C20", in_pd, "nmk-ske-keypad"), /* I1 */
353 DB8500_PIN("GPIO164_B21", in_pd, "nmk-ske-keypad"), /* I0 */
354 DB8500_PIN("GPIO157_A18", out_lo, "nmk-ske-keypad"), /* O7 */
355 DB8500_PIN("GPIO158_C18", out_lo, "nmk-ske-keypad"), /* O6 */
356 DB8500_PIN("GPIO159_B19", out_lo, "nmk-ske-keypad"), /* O5 */
357 DB8500_PIN("GPIO160_B20", out_lo, "nmk-ske-keypad"), /* O4 */
358 DB8500_PIN("GPIO165_C21", out_lo, "nmk-ske-keypad"), /* O3 */
359 DB8500_PIN("GPIO166_A22", out_lo, "nmk-ske-keypad"), /* O2 */
360 DB8500_PIN("GPIO167_B24", out_lo, "nmk-ske-keypad"), /* O1 */
361 DB8500_PIN("GPIO168_C22", out_lo, "nmk-ske-keypad"), /* O0 */
362 /* ske sleep state */
363 DB8500_PIN_SLEEP("GPIO153_B17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I7 */
364 DB8500_PIN_SLEEP("GPIO154_C16", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I6 */
365 DB8500_PIN_SLEEP("GPIO155_C19", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I5 */
366 DB8500_PIN_SLEEP("GPIO156_C17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I4 */
367 DB8500_PIN_SLEEP("GPIO161_D21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I3 */
368 DB8500_PIN_SLEEP("GPIO162_D20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I2 */
369 DB8500_PIN_SLEEP("GPIO163_C20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I1 */
370 DB8500_PIN_SLEEP("GPIO164_B21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I0 */
371 DB8500_PIN_SLEEP("GPIO157_A18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O7 */
372 DB8500_PIN_SLEEP("GPIO158_C18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O6 */
373 DB8500_PIN_SLEEP("GPIO159_B19", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O5 */
374 DB8500_PIN_SLEEP("GPIO160_B20", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O4 */
375 DB8500_PIN_SLEEP("GPIO165_C21", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O3 */
376 DB8500_PIN_SLEEP("GPIO166_A22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O2 */
377 DB8500_PIN_SLEEP("GPIO167_B24", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O1 */
378 DB8500_PIN_SLEEP("GPIO168_C22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O0 */
380 /* STM APE pins states */
381 DB8500_MUX_STATE("stmape_c_1", "stmape",
382 "stm", "ape_mipi34"),
383 DB8500_PIN_STATE("GPIO70_G5", in_nopull,
384 "stm", "ape_mipi34"), /* clk */
385 DB8500_PIN_STATE("GPIO71_G4", in_nopull,
386 "stm", "ape_mipi34"), /* dat3 */
387 DB8500_PIN_STATE("GPIO72_H4", in_nopull,
388 "stm", "ape_mipi34"), /* dat2 */
389 DB8500_PIN_STATE("GPIO73_H3", in_nopull,
390 "stm", "ape_mipi34"), /* dat1 */
391 DB8500_PIN_STATE("GPIO74_J3", in_nopull,
392 "stm", "ape_mipi34"), /* dat0 */
394 DB8500_PIN_STATE("GPIO70_G5", slpm_out_lo_pdis,
395 "stm", "ape_mipi34_sleep"), /* clk */
396 DB8500_PIN_STATE("GPIO71_G4", slpm_out_lo_pdis,
397 "stm", "ape_mipi34_sleep"), /* dat3 */
398 DB8500_PIN_STATE("GPIO72_H4", slpm_out_lo_pdis,
399 "stm", "ape_mipi34_sleep"), /* dat2 */
400 DB8500_PIN_STATE("GPIO73_H3", slpm_out_lo_pdis,
401 "stm", "ape_mipi34_sleep"), /* dat1 */
402 DB8500_PIN_STATE("GPIO74_J3", slpm_out_lo_pdis,
403 "stm", "ape_mipi34_sleep"), /* dat0 */
405 DB8500_MUX_STATE("stmape_oc1_1", "stmape",
406 "stm", "ape_microsd"),
407 DB8500_PIN_STATE("GPIO23_AA4", in_nopull,
408 "stm", "ape_microsd"), /* clk */
409 DB8500_PIN_STATE("GPIO25_Y4", in_nopull,
410 "stm", "ape_microsd"), /* dat0 */
411 DB8500_PIN_STATE("GPIO26_Y2", in_nopull,
412 "stm", "ape_microsd"), /* dat1 */
413 DB8500_PIN_STATE("GPIO27_AA2", in_nopull,
414 "stm", "ape_microsd"), /* dat2 */
415 DB8500_PIN_STATE("GPIO28_AA1", in_nopull,
416 "stm", "ape_microsd"), /* dat3 */
418 DB8500_PIN_STATE("GPIO23_AA4", slpm_out_lo_wkup_pdis,
419 "stm", "ape_microsd_sleep"), /* clk */
420 DB8500_PIN_STATE("GPIO25_Y4", slpm_in_wkup_pdis,
421 "stm", "ape_microsd_sleep"), /* dat0 */
422 DB8500_PIN_STATE("GPIO26_Y2", slpm_in_wkup_pdis,
423 "stm", "ape_microsd_sleep"), /* dat1 */
424 DB8500_PIN_STATE("GPIO27_AA2", slpm_in_wkup_pdis,
425 "stm", "ape_microsd_sleep"), /* dat2 */
426 DB8500_PIN_STATE("GPIO28_AA1", slpm_in_wkup_pdis,
427 "stm", "ape_microsd_sleep"), /* dat3 */
429 /* STM Modem pins states */
430 DB8500_MUX_STATE("stmmod_oc3_2", "stmmod",
431 "stm", "mod_mipi34"),
432 DB8500_MUX_STATE("uartmodrx_oc3_1", "uartmod",
433 "stm", "mod_mipi34"),
434 DB8500_MUX_STATE("uartmodtx_oc3_1", "uartmod",
435 "stm", "mod_mipi34"),
436 DB8500_PIN_STATE("GPIO70_G5", in_nopull,
437 "stm", "mod_mipi34"), /* clk */
438 DB8500_PIN_STATE("GPIO71_G4", in_nopull,
439 "stm", "mod_mipi34"), /* dat3 */
440 DB8500_PIN_STATE("GPIO72_H4", in_nopull,
441 "stm", "mod_mipi34"), /* dat2 */
442 DB8500_PIN_STATE("GPIO73_H3", in_nopull,
443 "stm", "mod_mipi34"), /* dat1 */
444 DB8500_PIN_STATE("GPIO74_J3", in_nopull,
445 "stm", "mod_mipi34"), /* dat0 */
446 DB8500_PIN_STATE("GPIO75_H2", in_pu,
447 "stm", "mod_mipi34"), /* uartmod rx */
448 DB8500_PIN_STATE("GPIO76_J2", out_lo,
449 "stm", "mod_mipi34"), /* uartmod tx */
451 DB8500_PIN_STATE("GPIO70_G5", slpm_out_lo_pdis,
452 "stm", "mod_mipi34_sleep"), /* clk */
453 DB8500_PIN_STATE("GPIO71_G4", slpm_out_lo_pdis,
454 "stm", "mod_mipi34_sleep"), /* dat3 */
455 DB8500_PIN_STATE("GPIO72_H4", slpm_out_lo_pdis,
456 "stm", "mod_mipi34_sleep"), /* dat2 */
457 DB8500_PIN_STATE("GPIO73_H3", slpm_out_lo_pdis,
458 "stm", "mod_mipi34_sleep"), /* dat1 */
459 DB8500_PIN_STATE("GPIO74_J3", slpm_out_lo_pdis,
460 "stm", "mod_mipi34_sleep"), /* dat0 */
461 DB8500_PIN_STATE("GPIO75_H2", slpm_in_wkup_pdis,
462 "stm", "mod_mipi34_sleep"), /* uartmod rx */
463 DB8500_PIN_STATE("GPIO76_J2", slpm_out_lo_wkup_pdis,
464 "stm", "mod_mipi34_sleep"), /* uartmod tx */
466 DB8500_MUX_STATE("stmmod_b_1", "stmmod",
467 "stm", "mod_microsd"),
468 DB8500_MUX_STATE("uartmodrx_oc3_1", "uartmod",
469 "stm", "mod_microsd"),
470 DB8500_MUX_STATE("uartmodtx_oc3_1", "uartmod",
471 "stm", "mod_microsd"),
472 DB8500_PIN_STATE("GPIO23_AA4", in_nopull,
473 "stm", "mod_microsd"), /* clk */
474 DB8500_PIN_STATE("GPIO25_Y4", in_nopull,
475 "stm", "mod_microsd"), /* dat0 */
476 DB8500_PIN_STATE("GPIO26_Y2", in_nopull,
477 "stm", "mod_microsd"), /* dat1 */
478 DB8500_PIN_STATE("GPIO27_AA2", in_nopull,
479 "stm", "mod_microsd"), /* dat2 */
480 DB8500_PIN_STATE("GPIO28_AA1", in_nopull,
481 "stm", "mod_microsd"), /* dat3 */
482 DB8500_PIN_STATE("GPIO75_H2", in_pu,
483 "stm", "mod_microsd"), /* uartmod rx */
484 DB8500_PIN_STATE("GPIO76_J2", out_lo,
485 "stm", "mod_microsd"), /* uartmod tx */
487 DB8500_PIN_STATE("GPIO23_AA4", slpm_out_lo_wkup_pdis,
488 "stm", "mod_microsd_sleep"), /* clk */
489 DB8500_PIN_STATE("GPIO25_Y4", slpm_in_wkup_pdis,
490 "stm", "mod_microsd_sleep"), /* dat0 */
491 DB8500_PIN_STATE("GPIO26_Y2", slpm_in_wkup_pdis,
492 "stm", "mod_microsd_sleep"), /* dat1 */
493 DB8500_PIN_STATE("GPIO27_AA2", slpm_in_wkup_pdis,
494 "stm", "mod_microsd_sleep"), /* dat2 */
495 DB8500_PIN_STATE("GPIO28_AA1", slpm_in_wkup_pdis,
496 "stm", "mod_microsd_sleep"), /* dat3 */
497 DB8500_PIN_STATE("GPIO75_H2", slpm_in_wkup_pdis,
498 "stm", "mod_microsd_sleep"), /* uartmod rx */
499 DB8500_PIN_STATE("GPIO76_J2", slpm_out_lo_wkup_pdis,
500 "stm", "mod_microsd_sleep"), /* uartmod tx */
502 /* STM dual Modem/APE pins state */
503 DB8500_MUX_STATE("stmmod_oc3_2", "stmmod",
504 "stm", "mod_mipi34_ape_mipi60"),
505 DB8500_MUX_STATE("stmape_c_2", "stmape",
506 "stm", "mod_mipi34_ape_mipi60"),
507 DB8500_MUX_STATE("uartmodrx_oc3_1", "uartmod",
508 "stm", "mod_mipi34_ape_mipi60"),
509 DB8500_MUX_STATE("uartmodtx_oc3_1", "uartmod",
510 "stm", "mod_mipi34_ape_mipi60"),
511 DB8500_PIN_STATE("GPIO70_G5", in_nopull,
512 "stm", "mod_mipi34_ape_mipi60"), /* clk */
513 DB8500_PIN_STATE("GPIO71_G4", in_nopull,
514 "stm", "mod_mipi34_ape_mipi60"), /* dat3 */
515 DB8500_PIN_STATE("GPIO72_H4", in_nopull,
516 "stm", "mod_mipi34_ape_mipi60"), /* dat2 */
517 DB8500_PIN_STATE("GPIO73_H3", in_nopull,
518 "stm", "mod_mipi34_ape_mipi60"), /* dat1 */
519 DB8500_PIN_STATE("GPIO74_J3", in_nopull,
520 "stm", "mod_mipi34_ape_mipi60"), /* dat0 */
521 DB8500_PIN_STATE("GPIO75_H2", in_pu,
522 "stm", "mod_mipi34_ape_mipi60"), /* uartmod rx */
523 DB8500_PIN_STATE("GPIO76_J2", out_lo,
524 "stm", "mod_mipi34_ape_mipi60"), /* uartmod tx */
525 DB8500_PIN_STATE("GPIO155_C19", in_nopull,
526 "stm", "mod_mipi34_ape_mipi60"), /* clk */
527 DB8500_PIN_STATE("GPIO156_C17", in_nopull,
528 "stm", "mod_mipi34_ape_mipi60"), /* dat3 */
529 DB8500_PIN_STATE("GPIO157_A18", in_nopull,
530 "stm", "mod_mipi34_ape_mipi60"), /* dat2 */
531 DB8500_PIN_STATE("GPIO158_C18", in_nopull,
532 "stm", "mod_mipi34_ape_mipi60"), /* dat1 */
533 DB8500_PIN_STATE("GPIO159_B19", in_nopull,
534 "stm", "mod_mipi34_ape_mipi60"), /* dat0 */
536 DB8500_PIN_STATE("GPIO70_G5", slpm_out_lo_pdis,
537 "stm", "mod_mipi34_ape_mipi60_sleep"), /* clk */
538 DB8500_PIN_STATE("GPIO71_G4", slpm_out_lo_pdis,
539 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat3 */
540 DB8500_PIN_STATE("GPIO72_H4", slpm_out_lo_pdis,
541 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat2 */
542 DB8500_PIN_STATE("GPIO73_H3", slpm_out_lo_pdis,
543 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat1 */
544 DB8500_PIN_STATE("GPIO74_J3", slpm_out_lo_pdis,
545 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat0 */
546 DB8500_PIN_STATE("GPIO75_H2", slpm_in_wkup_pdis,
547 "stm", "mod_mipi34_ape_mipi60_sleep"), /* uartmod rx */
548 DB8500_PIN_STATE("GPIO76_J2", slpm_out_lo_wkup_pdis,
549 "stm", "mod_mipi34_ape_mipi60_sleep"), /* uartmod tx */
550 DB8500_PIN_STATE("GPIO155_C19", slpm_in_wkup_pdis,
551 "stm", "mod_mipi34_ape_mipi60_sleep"), /* clk */
552 DB8500_PIN_STATE("GPIO156_C17", slpm_in_wkup_pdis,
553 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat3 */
554 DB8500_PIN_STATE("GPIO157_A18", slpm_in_wkup_pdis,
555 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat2 */
556 DB8500_PIN_STATE("GPIO158_C18", slpm_in_wkup_pdis,
557 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat1 */
558 DB8500_PIN_STATE("GPIO159_B19", slpm_in_wkup_pdis,
559 "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat0 */
563 * These are specifically for the MOP500 and HREFP (pre-v60) version of the
564 * board, which utilized a TC35892 GPIO expander instead of using a lot of
565 * on-chip pins as the HREFv60 and later does.
567 static struct pinctrl_map __initdata mop500_pinmap[] = {
568 /* Mux in SSP0, pull down RXD pin */
569 DB8500_MUX_HOG("ssp0_a_1", "ssp0"),
570 DB8500_PIN_HOG("GPIO145_C13", pd),
572 * XENON Flashgun on image processor GPIO (controlled from image
573 * processor firmware), mux in these image processor GPIO lines 0
574 * (XENON_FLASH_ID) and 1 (XENON_READY) on altfunction C and pull up
575 * the pins.
577 DB8500_MUX_HOG("ipgpio0_c_1", "ipgpio"),
578 DB8500_MUX_HOG("ipgpio1_c_1", "ipgpio"),
579 DB8500_PIN_HOG("GPIO6_AF6", in_pu),
580 DB8500_PIN_HOG("GPIO7_AG5", in_pu),
581 /* TC35892 IRQ, pull up the line, let the driver mux in the pin */
582 DB8500_PIN_HOG("GPIO217_AH12", gpio_in_pu),
583 /* Mux in UART1 and set the pull-ups */
584 DB8500_MUX_HOG("u1rxtx_a_1", "u1"),
585 DB8500_PIN_HOG("GPIO4_AH6", in_pu), /* RXD */
586 DB8500_PIN_HOG("GPIO5_AG6", out_hi), /* TXD */
588 * Runtime stuff: make it possible to mux in the SKE keypad
589 * and bias the pins
591 /* ske default state */
592 DB8500_MUX("kp_a_2", "kp", "nmk-ske-keypad"),
593 DB8500_PIN("GPIO153_B17", in_pu, "nmk-ske-keypad"), /* I7 */
594 DB8500_PIN("GPIO154_C16", in_pu, "nmk-ske-keypad"), /* I6 */
595 DB8500_PIN("GPIO155_C19", in_pu, "nmk-ske-keypad"), /* I5 */
596 DB8500_PIN("GPIO156_C17", in_pu, "nmk-ske-keypad"), /* I4 */
597 DB8500_PIN("GPIO161_D21", in_pu, "nmk-ske-keypad"), /* I3 */
598 DB8500_PIN("GPIO162_D20", in_pu, "nmk-ske-keypad"), /* I2 */
599 DB8500_PIN("GPIO163_C20", in_pu, "nmk-ske-keypad"), /* I1 */
600 DB8500_PIN("GPIO164_B21", in_pu, "nmk-ske-keypad"), /* I0 */
601 DB8500_PIN("GPIO157_A18", out_lo, "nmk-ske-keypad"), /* O7 */
602 DB8500_PIN("GPIO158_C18", out_lo, "nmk-ske-keypad"), /* O6 */
603 DB8500_PIN("GPIO159_B19", out_lo, "nmk-ske-keypad"), /* O5 */
604 DB8500_PIN("GPIO160_B20", out_lo, "nmk-ske-keypad"), /* O4 */
605 DB8500_PIN("GPIO165_C21", out_lo, "nmk-ske-keypad"), /* O3 */
606 DB8500_PIN("GPIO166_A22", out_lo, "nmk-ske-keypad"), /* O2 */
607 DB8500_PIN("GPIO167_B24", out_lo, "nmk-ske-keypad"), /* O1 */
608 DB8500_PIN("GPIO168_C22", out_lo, "nmk-ske-keypad"), /* O0 */
609 /* ske sleep state */
610 DB8500_PIN_SLEEP("GPIO153_B17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I7 */
611 DB8500_PIN_SLEEP("GPIO154_C16", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I6 */
612 DB8500_PIN_SLEEP("GPIO155_C19", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I5 */
613 DB8500_PIN_SLEEP("GPIO156_C17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I4 */
614 DB8500_PIN_SLEEP("GPIO161_D21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I3 */
615 DB8500_PIN_SLEEP("GPIO162_D20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I2 */
616 DB8500_PIN_SLEEP("GPIO163_C20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I1 */
617 DB8500_PIN_SLEEP("GPIO164_B21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I0 */
618 DB8500_PIN_SLEEP("GPIO157_A18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O7 */
619 DB8500_PIN_SLEEP("GPIO158_C18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O6 */
620 DB8500_PIN_SLEEP("GPIO159_B19", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O5 */
621 DB8500_PIN_SLEEP("GPIO160_B20", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O4 */
622 DB8500_PIN_SLEEP("GPIO165_C21", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O3 */
623 DB8500_PIN_SLEEP("GPIO166_A22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O2 */
624 DB8500_PIN_SLEEP("GPIO167_B24", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O1 */
625 DB8500_PIN_SLEEP("GPIO168_C22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O0 */
627 /* Mux in and drive the SDI0 DAT31DIR line high at runtime */
628 DB8500_MUX("mc0dat31dir_a_1", "mc0", "sdi0"),
629 DB8500_PIN("GPIO21_AB3", out_hi, "sdi0"),
633 * The HREFv60 series of platforms is using available pins on the DB8500
634 * insteaf of the Toshiba I2C GPIO expander, reusing some pins like the SSP0
635 * and SSP1 ports (previously connected to the AB8500) as generic GPIO lines.
637 static struct pinctrl_map __initdata hrefv60_pinmap[] = {
638 /* Drive WLAN_ENA low */
639 DB8500_PIN_HOG("GPIO85_D5", gpio_out_lo), /* WLAN_ENA */
641 * XENON Flashgun on image processor GPIO (controlled from image
642 * processor firmware), mux in these image processor GPIO lines 0
643 * (XENON_FLASH_ID), 1 (XENON_READY) and there is an assistant
644 * LED on IP GPIO 4 (XENON_EN2) on altfunction C, that need bias
645 * from GPIO21 so pull up 0, 1 and drive 4 and GPIO21 low as output.
647 DB8500_MUX_HOG("ipgpio0_c_1", "ipgpio"),
648 DB8500_MUX_HOG("ipgpio1_c_1", "ipgpio"),
649 DB8500_MUX_HOG("ipgpio4_c_1", "ipgpio"),
650 DB8500_PIN_HOG("GPIO6_AF6", in_pu), /* XENON_FLASH_ID */
651 DB8500_PIN_HOG("GPIO7_AG5", in_pu), /* XENON_READY */
652 DB8500_PIN_HOG("GPIO21_AB3", gpio_out_lo), /* XENON_EN1 */
653 DB8500_PIN_HOG("GPIO64_F3", out_lo), /* XENON_EN2 */
654 /* Magnetometer uses GPIO 31 and 32, pull these up/down respectively */
655 DB8500_PIN_HOG("GPIO31_V3", gpio_in_pu), /* EN1 */
656 DB8500_PIN_HOG("GPIO32_V2", gpio_in_pd), /* DRDY */
658 * Display Interface 1 uses GPIO 65 for RST (reset).
659 * Display Interface 2 uses GPIO 66 for RST (reset).
660 * Drive DISP1 reset high (not reset), driver DISP2 reset low (reset)
662 DB8500_PIN_HOG("GPIO65_F1", gpio_out_hi), /* DISP1 NO RST */
663 DB8500_PIN_HOG("GPIO66_G3", gpio_out_lo), /* DISP2 RST */
665 * Touch screen uses GPIO 143 for RST1, GPIO 146 for RST2 and
666 * GPIO 67 for interrupts. Pull-up the IRQ line and drive both
667 * reset signals low.
669 DB8500_PIN_HOG("GPIO143_D12", gpio_out_lo), /* TOUCH_RST1 */
670 DB8500_PIN_HOG("GPIO67_G2", gpio_in_pu), /* TOUCH_INT2 */
671 DB8500_PIN_HOG("GPIO146_D13", gpio_out_lo), /* TOUCH_RST2 */
673 * Drive D19-D23 for the ETM PTM trace interface low,
674 * (presumably pins are unconnected therefore grounded here,
675 * the "other alt C1" setting enables these pins)
677 DB8500_PIN_HOG("GPIO70_G5", gpio_out_lo),
678 DB8500_PIN_HOG("GPIO71_G4", gpio_out_lo),
679 DB8500_PIN_HOG("GPIO72_H4", gpio_out_lo),
680 DB8500_PIN_HOG("GPIO73_H3", gpio_out_lo),
681 DB8500_PIN_HOG("GPIO74_J3", gpio_out_lo),
682 /* NAHJ CTRL on GPIO 76 to low, CTRL_INV on GPIO216 to high */
683 DB8500_PIN_HOG("GPIO76_J2", gpio_out_lo), /* CTRL */
684 DB8500_PIN_HOG("GPIO216_AG12", gpio_out_hi), /* CTRL_INV */
685 /* NFC ENA and RESET to low, pulldown IRQ line */
686 DB8500_PIN_HOG("GPIO77_H1", gpio_out_lo), /* NFC_ENA */
687 DB8500_PIN_HOG("GPIO144_B13", gpio_in_pd), /* NFC_IRQ */
688 DB8500_PIN_HOG("GPIO142_C11", gpio_out_lo), /* NFC_RESET */
690 * SKE keyboard partly on alt A and partly on "Other alt C1"
691 * Driver KP_O1,2,3,6,7 low and pull up KP_I 0,2,3 for three
692 * rows of 6 keys, then pull up force sensing interrup and
693 * drive reset and force sensing WU low.
695 DB8500_MUX_HOG("kp_a_1", "kp"),
696 DB8500_MUX_HOG("kp_oc1_1", "kp"),
697 DB8500_PIN_HOG("GPIO90_A3", out_lo), /* KP_O1 */
698 DB8500_PIN_HOG("GPIO87_B3", out_lo), /* KP_O2 */
699 DB8500_PIN_HOG("GPIO86_C6", out_lo), /* KP_O3 */
700 DB8500_PIN_HOG("GPIO96_D8", out_lo), /* KP_O6 */
701 DB8500_PIN_HOG("GPIO94_D7", out_lo), /* KP_O7 */
702 DB8500_PIN_HOG("GPIO93_B7", in_pu), /* KP_I0 */
703 DB8500_PIN_HOG("GPIO89_E6", in_pu), /* KP_I2 */
704 DB8500_PIN_HOG("GPIO88_C4", in_pu), /* KP_I3 */
705 DB8500_PIN_HOG("GPIO91_B6", gpio_in_pu), /* FORCE_SENSING_INT */
706 DB8500_PIN_HOG("GPIO92_D6", gpio_out_lo), /* FORCE_SENSING_RST */
707 DB8500_PIN_HOG("GPIO97_D9", gpio_out_lo), /* FORCE_SENSING_WU */
708 /* DiPro Sensor interrupt */
709 DB8500_PIN_HOG("GPIO139_C9", gpio_in_pu), /* DIPRO_INT */
710 /* Audio Amplifier HF enable */
711 DB8500_PIN_HOG("GPIO149_B14", gpio_out_hi), /* VAUDIO_HF_EN, enable MAX8968 */
712 /* GBF interface, pull low to reset state */
713 DB8500_PIN_HOG("GPIO171_D23", gpio_out_lo), /* GBF_ENA_RESET */
714 /* MSP : HDTV INTERFACE GPIO line */
715 DB8500_PIN_HOG("GPIO192_AJ27", gpio_in_pd),
716 /* Accelerometer interrupt lines */
717 DB8500_PIN_HOG("GPIO82_C1", gpio_in_pu), /* ACC_INT1 */
718 DB8500_PIN_HOG("GPIO83_D3", gpio_in_pu), /* ACC_INT2 */
719 /* SD card detect GPIO pin */
720 DB8500_PIN_HOG("GPIO95_E8", gpio_in_pu),
722 * Runtime stuff
723 * Pull up/down of some sensor GPIO pins, for proximity, HAL sensor
724 * etc.
726 DB8500_PIN("GPIO217_AH12", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"),
727 DB8500_PIN("GPIO145_C13", gpio_in_pd_slpm_gpio_nopull, "gpio-keys.0"),
728 DB8500_PIN("GPIO139_C9", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"),
731 static struct pinctrl_map __initdata u9500_pinmap[] = {
732 /* Mux in UART1 (just RX/TX) and set the pull-ups */
733 DB8500_MUX_HOG("u1rxtx_a_1", "u1"),
734 DB8500_PIN_HOG("GPIO4_AH6", in_pu),
735 DB8500_PIN_HOG("GPIO5_AG6", out_hi),
736 /* WLAN_IRQ line */
737 DB8500_PIN_HOG("GPIO144_B13", gpio_in_pu),
738 /* HSI */
739 DB8500_MUX_HOG("hsir_a_1", "hsi"),
740 DB8500_MUX_HOG("hsit_a_2", "hsi"),
741 DB8500_PIN_HOG("GPIO219_AG10", in_pd), /* RX FLA0 */
742 DB8500_PIN_HOG("GPIO220_AH10", in_pd), /* RX DAT0 */
743 DB8500_PIN_HOG("GPIO221_AJ11", out_lo), /* RX RDY0 */
744 DB8500_PIN_HOG("GPIO222_AJ9", out_lo), /* TX FLA0 */
745 DB8500_PIN_HOG("GPIO223_AH9", out_lo), /* TX DAT0 */
746 DB8500_PIN_HOG("GPIO224_AG9", in_pd), /* TX RDY0 */
747 DB8500_PIN_HOG("GPIO225_AG8", in_pd), /* CAWAKE0 */
748 DB8500_PIN_HOG("GPIO226_AF8", gpio_out_hi), /* ACWAKE0 */
751 static struct pinctrl_map __initdata u8500_pinmap[] = {
752 DB8500_PIN_HOG("GPIO226_AF8", gpio_out_lo), /* WLAN_PMU_EN */
753 DB8500_PIN_HOG("GPIO4_AH6", gpio_in_pu), /* WLAN_IRQ */
756 static struct pinctrl_map __initdata snowball_pinmap[] = {
757 /* Mux in SSP0 connected to AB8500, pull down RXD pin */
758 DB8500_MUX_HOG("ssp0_a_1", "ssp0"),
759 DB8500_PIN_HOG("GPIO145_C13", pd),
760 /* Always drive the MC0 DAT31DIR line high on these boards */
761 DB8500_PIN_HOG("GPIO21_AB3", out_hi),
762 /* Mux in "SM" which is used for the SMSC911x Ethernet adapter */
763 DB8500_MUX_HOG("sm_b_1", "sm"),
764 /* User LED */
765 DB8500_PIN_HOG("GPIO142_C11", gpio_out_hi),
766 /* Drive RSTn_LAN high */
767 DB8500_PIN_HOG("GPIO141_C12", gpio_out_hi),
768 /* Accelerometer/Magnetometer */
769 DB8500_PIN_HOG("GPIO163_C20", gpio_in_pu), /* ACCEL_IRQ1 */
770 DB8500_PIN_HOG("GPIO164_B21", gpio_in_pu), /* ACCEL_IRQ2 */
771 DB8500_PIN_HOG("GPIO165_C21", gpio_in_pu), /* MAG_DRDY */
772 /* WLAN/GBF */
773 DB8500_PIN_HOG("GPIO161_D21", gpio_out_lo), /* WLAN_PMU_EN */
774 DB8500_PIN_HOG("GPIO171_D23", gpio_out_hi), /* GBF_ENA */
775 DB8500_PIN_HOG("GPIO215_AH13", gpio_out_lo), /* WLAN_ENA */
776 DB8500_PIN_HOG("GPIO216_AG12", gpio_in_pu), /* WLAN_IRQ */
780 * passing "pinsfor=" in kernel cmdline allows for custom
781 * configuration of GPIOs on u8500 derived boards.
783 static int __init early_pinsfor(char *p)
785 pinsfor = PINS_FOR_DEFAULT;
787 if (strcmp(p, "u9500-21") == 0)
788 pinsfor = PINS_FOR_U9500;
790 return 0;
792 early_param("pinsfor", early_pinsfor);
794 int pins_for_u9500(void)
796 if (pinsfor == PINS_FOR_U9500)
797 return 1;
799 return 0;
802 static void __init mop500_href_family_pinmaps_init(void)
804 switch (pinsfor) {
805 case PINS_FOR_U9500:
806 pinctrl_register_mappings(u9500_pinmap,
807 ARRAY_SIZE(u9500_pinmap));
808 break;
809 case PINS_FOR_DEFAULT:
810 pinctrl_register_mappings(u8500_pinmap,
811 ARRAY_SIZE(u8500_pinmap));
812 default:
813 break;
817 void __init mop500_pinmaps_init(void)
819 pinctrl_register_mappings(mop500_family_pinmap,
820 ARRAY_SIZE(mop500_family_pinmap));
821 pinctrl_register_mappings(mop500_pinmap,
822 ARRAY_SIZE(mop500_pinmap));
823 mop500_href_family_pinmaps_init();
826 void __init snowball_pinmaps_init(void)
828 pinctrl_register_mappings(mop500_family_pinmap,
829 ARRAY_SIZE(mop500_family_pinmap));
830 pinctrl_register_mappings(snowball_pinmap,
831 ARRAY_SIZE(snowball_pinmap));
832 pinctrl_register_mappings(u8500_pinmap,
833 ARRAY_SIZE(u8500_pinmap));
836 void __init hrefv60_pinmaps_init(void)
838 pinctrl_register_mappings(mop500_family_pinmap,
839 ARRAY_SIZE(mop500_family_pinmap));
840 pinctrl_register_mappings(hrefv60_pinmap,
841 ARRAY_SIZE(hrefv60_pinmap));
842 mop500_href_family_pinmaps_init();