2 * Copyright (C) ST-Ericsson SA 2010
4 * License terms: GNU General Public License (GPL) version 2
7 #include <linux/kernel.h>
8 #include <linux/init.h>
10 #include <asm/mach-types.h>
11 #include <plat/pincfg.h>
12 #include <plat/gpio-nomadik.h>
13 #include <mach/hardware.h>
15 #include "pins-db8500.h"
17 static pin_cfg_t mop500_pins_common
[] = {
38 GPIO196_MSP2_RXD
| PIN_OUTPUT_LOW
,
40 /* Touch screen INTERFACE */
41 GPIO84_GPIO
| PIN_INPUT_PULLUP
, /* TOUCH_INT1 */
43 /* STMPE1601/tc35893 keypad IRQ */
44 GPIO218_GPIO
| PIN_INPUT_PULLUP
,
46 /* MMC0 (MicroSD card) */
47 GPIO18_MC0_CMDDIR
| PIN_OUTPUT_HIGH
,
48 GPIO19_MC0_DAT0DIR
| PIN_OUTPUT_HIGH
,
49 GPIO20_MC0_DAT2DIR
| PIN_OUTPUT_HIGH
,
51 GPIO22_MC0_FBCLK
| PIN_INPUT_NOPULL
,
52 GPIO23_MC0_CLK
| PIN_OUTPUT_LOW
,
53 GPIO24_MC0_CMD
| PIN_INPUT_PULLUP
,
54 GPIO25_MC0_DAT0
| PIN_INPUT_PULLUP
,
55 GPIO26_MC0_DAT1
| PIN_INPUT_PULLUP
,
56 GPIO27_MC0_DAT2
| PIN_INPUT_PULLUP
,
57 GPIO28_MC0_DAT3
| PIN_INPUT_PULLUP
,
60 GPIO208_MC1_CLK
| PIN_OUTPUT_LOW
,
61 GPIO209_MC1_FBCLK
| PIN_INPUT_NOPULL
,
62 GPIO210_MC1_CMD
| PIN_INPUT_PULLUP
,
63 GPIO211_MC1_DAT0
| PIN_INPUT_PULLUP
,
64 GPIO212_MC1_DAT1
| PIN_INPUT_PULLUP
,
65 GPIO213_MC1_DAT2
| PIN_INPUT_PULLUP
,
66 GPIO214_MC1_DAT3
| PIN_INPUT_PULLUP
,
68 /* MMC2 (On-board DATA INTERFACE eMMC) */
69 GPIO128_MC2_CLK
| PIN_OUTPUT_LOW
,
70 GPIO129_MC2_CMD
| PIN_INPUT_PULLUP
,
71 GPIO130_MC2_FBCLK
| PIN_INPUT_NOPULL
,
72 GPIO131_MC2_DAT0
| PIN_INPUT_PULLUP
,
73 GPIO132_MC2_DAT1
| PIN_INPUT_PULLUP
,
74 GPIO133_MC2_DAT2
| PIN_INPUT_PULLUP
,
75 GPIO134_MC2_DAT3
| PIN_INPUT_PULLUP
,
76 GPIO135_MC2_DAT4
| PIN_INPUT_PULLUP
,
77 GPIO136_MC2_DAT5
| PIN_INPUT_PULLUP
,
78 GPIO137_MC2_DAT6
| PIN_INPUT_PULLUP
,
79 GPIO138_MC2_DAT7
| PIN_INPUT_PULLUP
,
81 /* MMC4 (On-board STORAGE INTERFACE eMMC) */
82 GPIO197_MC4_DAT3
| PIN_INPUT_PULLUP
,
83 GPIO198_MC4_DAT2
| PIN_INPUT_PULLUP
,
84 GPIO199_MC4_DAT1
| PIN_INPUT_PULLUP
,
85 GPIO200_MC4_DAT0
| PIN_INPUT_PULLUP
,
86 GPIO201_MC4_CMD
| PIN_INPUT_PULLUP
,
87 GPIO202_MC4_FBCLK
| PIN_INPUT_NOPULL
,
88 GPIO203_MC4_CLK
| PIN_OUTPUT_LOW
,
89 GPIO204_MC4_DAT7
| PIN_INPUT_PULLUP
,
90 GPIO205_MC4_DAT6
| PIN_INPUT_PULLUP
,
91 GPIO206_MC4_DAT5
| PIN_INPUT_PULLUP
,
92 GPIO207_MC4_DAT4
| PIN_INPUT_PULLUP
,
113 /* uart-0 pins gpio configuration should be
114 * kept intact to prevent glitch in tx line
115 * when tty dev is opened. Later these pins
116 * are configured to uart mop500_pins_uart0
118 * It will be replaced with uart configuration
119 * once the issue is solved.
121 GPIO0_GPIO
| PIN_INPUT_PULLUP
,
122 GPIO1_GPIO
| PIN_OUTPUT_HIGH
,
123 GPIO2_GPIO
| PIN_INPUT_PULLUP
,
124 GPIO3_GPIO
| PIN_OUTPUT_HIGH
,
126 GPIO29_U2_RXD
| PIN_INPUT_PULLUP
,
127 GPIO30_U2_TXD
| PIN_OUTPUT_HIGH
,
128 GPIO31_U2_CTSn
| PIN_INPUT_PULLUP
,
129 GPIO32_U2_RTSn
| PIN_OUTPUT_HIGH
,
131 /* Display & HDMI HW sync */
132 GPIO68_LCD_VSI0
| PIN_INPUT_PULLUP
,
133 GPIO69_LCD_VSI1
| PIN_INPUT_PULLUP
,
136 static pin_cfg_t mop500_pins_default
[] = {
140 GPIO145_SSP0_RXD
| PIN_PULL_DOWN
,
144 GPIO217_GPIO
| PIN_INPUT_PULLUP
, /* TC35892 IRQ */
146 /* SDI0 (MicroSD card) */
147 GPIO21_MC0_DAT31DIR
| PIN_OUTPUT_HIGH
,
150 GPIO4_U1_RXD
| PIN_INPUT_PULLUP
,
151 GPIO5_U1_TXD
| PIN_OUTPUT_HIGH
,
152 GPIO6_U1_CTSn
| PIN_INPUT_PULLUP
,
153 GPIO7_U1_RTSn
| PIN_OUTPUT_HIGH
,
156 static pin_cfg_t mop500_pins_hrefv60
[] = {
158 GPIO4_GPIO
| PIN_INPUT_PULLUP
,/* WLAN_IRQ */
159 GPIO85_GPIO
| PIN_OUTPUT_LOW
,/* WLAN_ENA */
161 /* XENON Flashgun INTERFACE */
162 GPIO6_IP_GPIO0
| PIN_INPUT_PULLUP
,/* XENON_FLASH_ID */
163 GPIO7_IP_GPIO1
| PIN_INPUT_PULLUP
,/* XENON_READY */
164 GPIO170_GPIO
| PIN_OUTPUT_LOW
, /* XENON_CHARGE */
166 /* Assistant LED INTERFACE */
167 GPIO21_GPIO
| PIN_OUTPUT_LOW
, /* XENON_EN1 */
168 GPIO64_IP_GPIO4
| PIN_OUTPUT_LOW
, /* XENON_EN2 */
171 GPIO31_GPIO
| PIN_INPUT_PULLUP
, /* magnetometer_INT */
172 GPIO32_GPIO
| PIN_INPUT_PULLDOWN
, /* Magnetometer DRDY */
174 /* Display Interface */
175 GPIO65_GPIO
| PIN_OUTPUT_LOW
, /* DISP1 RST */
176 GPIO66_GPIO
| PIN_OUTPUT_LOW
, /* DISP2 RST */
178 /* Touch screen INTERFACE */
179 GPIO143_GPIO
| PIN_OUTPUT_LOW
,/*TOUCH_RST1 */
181 /* Touch screen INTERFACE 2 */
182 GPIO67_GPIO
| PIN_INPUT_PULLUP
, /* TOUCH_INT2 */
183 GPIO146_GPIO
| PIN_OUTPUT_LOW
,/*TOUCH_RST2 */
185 /* ETM_PTM_TRACE INTERFACE */
186 GPIO70_GPIO
| PIN_OUTPUT_LOW
,/* ETM_PTM_DATA23 */
187 GPIO71_GPIO
| PIN_OUTPUT_LOW
,/* ETM_PTM_DATA22 */
188 GPIO72_GPIO
| PIN_OUTPUT_LOW
,/* ETM_PTM_DATA21 */
189 GPIO73_GPIO
| PIN_OUTPUT_LOW
,/* ETM_PTM_DATA20 */
190 GPIO74_GPIO
| PIN_OUTPUT_LOW
,/* ETM_PTM_DATA19 */
193 GPIO76_GPIO
| PIN_OUTPUT_LOW
,/* NAHJ_CTRL */
194 GPIO216_GPIO
| PIN_OUTPUT_HIGH
,/* NAHJ_CTRL_INV */
197 GPIO77_GPIO
| PIN_OUTPUT_LOW
, /* NFC_ENA */
198 GPIO144_GPIO
| PIN_INPUT_PULLDOWN
, /* NFC_IRQ */
199 GPIO142_GPIO
| PIN_OUTPUT_LOW
, /* NFC_RESET */
201 /* Keyboard MATRIX INTERFACE */
202 GPIO90_MC5_CMD
| PIN_OUTPUT_LOW
, /* KP_O_1 */
203 GPIO87_MC5_DAT1
| PIN_OUTPUT_LOW
, /* KP_O_2 */
204 GPIO86_MC5_DAT0
| PIN_OUTPUT_LOW
, /* KP_O_3 */
205 GPIO96_KP_O6
| PIN_OUTPUT_LOW
, /* KP_O_6 */
206 GPIO94_KP_O7
| PIN_OUTPUT_LOW
, /* KP_O_7 */
207 GPIO93_MC5_DAT4
| PIN_INPUT_PULLUP
, /* KP_I_0 */
208 GPIO89_MC5_DAT3
| PIN_INPUT_PULLUP
, /* KP_I_2 */
209 GPIO88_MC5_DAT2
| PIN_INPUT_PULLUP
, /* KP_I_3 */
210 GPIO91_GPIO
| PIN_INPUT_PULLUP
, /* FORCE_SENSING_INT */
211 GPIO92_GPIO
| PIN_OUTPUT_LOW
, /* FORCE_SENSING_RST */
212 GPIO97_GPIO
| PIN_OUTPUT_LOW
, /* FORCE_SENSING_WU */
214 /* DiPro Sensor Interface */
215 GPIO139_GPIO
| PIN_INPUT_PULLUP
, /* DIPRO_INT */
217 /* HAL SWITCH INTERFACE */
218 GPIO145_GPIO
| PIN_INPUT_PULLDOWN
,/* HAL_SW */
220 /* Audio Amplifier Interface */
221 GPIO149_GPIO
| PIN_OUTPUT_LOW
, /* VAUDIO_HF_EN */
224 GPIO171_GPIO
| PIN_OUTPUT_LOW
, /* GBF_ENA_RESET */
226 /* MSP : HDTV INTERFACE */
227 GPIO192_GPIO
| PIN_INPUT_PULLDOWN
,
229 /* ACCELEROMETER_INTERFACE */
230 GPIO82_GPIO
| PIN_INPUT_PULLUP
, /* ACC_INT1 */
231 GPIO83_GPIO
| PIN_INPUT_PULLUP
, /* ACC_INT2 */
233 /* Proximity Sensor */
234 GPIO217_GPIO
| PIN_INPUT_PULLUP
,
239 static pin_cfg_t snowball_pins
[] = {
240 /* SSP0, to AB8500 */
243 GPIO145_SSP0_RXD
| PIN_PULL_DOWN
,
246 /* MMC0: MicroSD card */
247 GPIO21_MC0_DAT31DIR
| PIN_OUTPUT_HIGH
,
276 GPIO141_GPIO
| PIN_OUTPUT_HIGH
,
279 void __init
mop500_pins_init(void)
281 nmk_config_pins(mop500_pins_common
,
282 ARRAY_SIZE(mop500_pins_common
));
283 if (machine_is_hrefv60())
284 nmk_config_pins(mop500_pins_hrefv60
,
285 ARRAY_SIZE(mop500_pins_hrefv60
));
286 else if (machine_is_snowball())
287 nmk_config_pins(snowball_pins
,
288 ARRAY_SIZE(snowball_pins
));
290 nmk_config_pins(mop500_pins_default
,
291 ARRAY_SIZE(mop500_pins_default
));