aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/board-u5500-pins.c
blob: 4635f240815838b020a8a8c9685da14d178420ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/*
 * Copyright (C) ST-Ericsson SA 2011
 *
 * License terms: GNU General Public License (GPL) version 2
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/gpio/nomadik.h>
#include <plat/pincfg.h>

#include "pins-db5500.h"
#include "pins.h"

static pin_cfg_t u5500_pins_default[] = {
	/* MSP */
	GPIO32_MSP0_TCK		| PIN_INPUT_PULLDOWN,
	GPIO33_MSP0_TFS		| PIN_INPUT_PULLDOWN,
	GPIO34_MSP0_TXD		| PIN_INPUT_PULLDOWN,
	GPIO35_MSP0_RXD		| PIN_INPUT_PULLDOWN,
	GPIO96_MSP1_TCK		| PIN_INPUT_PULLDOWN,
	GPIO97_MSP1_TFS		| PIN_INPUT_PULLDOWN,
	GPIO98_MSP1_TXD		| PIN_INPUT_PULLDOWN,
	GPIO99_MSP1_RXD		| PIN_INPUT_PULLDOWN,
	GPIO220_MSP2_TCK	| PIN_OUTPUT_LOW,
	GPIO221_MSP2_TFS	| PIN_OUTPUT_LOW,
	GPIO222_MSP2_TXD	| PIN_OUTPUT_LOW,

	/* DISPLAY_ENABLE */
	GPIO226_GPIO        | PIN_OUTPUT_LOW,

	/* Backlight Enable */
	GPIO224_GPIO        | PIN_OUTPUT_HIGH,

	/* UART0 */
	GPIO28_U0_TXD           | PIN_OUTPUT_HIGH,
	GPIO29_U0_RXD           | PIN_INPUT_PULLUP,

	/* UART3 */
	GPIO165_U3_RXD		| PIN_INPUT_PULLUP,
	GPIO166_U3_TXD		| PIN_OUTPUT_HIGH,
	GPIO167_U3_RTSn		| PIN_OUTPUT_HIGH,
	GPIO168_U3_CTSn		| PIN_INPUT_PULLUP,

	/* AB5500 */
	GPIO78_IRQn             | PIN_SLPM_NOCHANGE,
	GPIO100_I2C0_SCL        | PIN_INPUT_PULLUP | PIN_SLPM_NOCHANGE,
	GPIO101_I2C0_SDA        | PIN_SLPM_NOCHANGE,

	/* TOUCH_IRQ */
	GPIO179_GPIO	| PIN_INPUT_PULLUP,

	/* SD-CARD detect/levelshifter pins */
	GPIO180_GPIO		| PIN_INPUT_PULLUP,
	GPIO227_GPIO,
	GPIO185_GPIO,

	/* Display & HDMI HW sync */
	GPIO204_LCD_VSI1	| PIN_INPUT_PULLUP,

	/* Camera & MMIO XshutDown*/
	GPIO1_GPIO		| PIN_OUTPUT_LOW,
	GPIO2_GPIO		| PIN_OUTPUT_LOW,

	/* USB chip select */
	GPIO76_GPIO		| PIN_OUTPUT_LOW,

	GPIO202_ACCU0_RXD	| PIN_INPUT_PULLUP | PIN_SLPM_NOCHANGE,
	GPIO203_ACCU0_TXD	| PIN_OUTPUT_HIGH | PIN_SLPM_NOCHANGE,

	/* Board Id Identification B5500 or S5500 */
	GPIO0_GPIO		| PIN_INPUT_PULLUP,

};

static UX500_PINS(db5500_kp_pins,
	/* Keypad */
	GPIO128_KP_I0	| PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
	GPIO130_KP_I1	| PIN_INPUT_PULLUP | PIN_SLPM_INPUT_PULLUP,
	GPIO132_KP_I2	| PIN_INPUT_PULLUP | PIN_SLPM_INPUT_PULLUP,
	GPIO134_KP_I3	| PIN_INPUT_PULLUP | PIN_SLPM_INPUT_PULLUP,
	GPIO137_KP_O4	| PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
	GPIO139_KP_O5	| PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
);

static UX500_PINS(db5500_pins_sdi0,
	/* SDI0 (eMMC) */
	GPIO5_MC0_DAT0		| PIN_INPUT_PULLUP,
	GPIO6_MC0_DAT1		| PIN_INPUT_PULLUP,
	GPIO7_MC0_DAT2		| PIN_INPUT_PULLUP,
	GPIO8_MC0_DAT3		| PIN_INPUT_PULLUP,
	GPIO9_MC0_DAT4		| PIN_INPUT_PULLUP,
	GPIO10_MC0_DAT5		| PIN_INPUT_PULLUP,
	GPIO11_MC0_DAT6		| PIN_INPUT_PULLUP,
	GPIO12_MC0_DAT7		| PIN_INPUT_PULLUP,
	GPIO13_MC0_CMD		| PIN_INPUT_PULLUP,
	GPIO14_MC0_CLK		| PIN_OUTPUT_LOW,
);

static UX500_PINS(db5500_pins_sdi1,
	/* SDI1 (SD-CARD) */
	GPIO191_MC1_DAT0	| PIN_INPUT_PULLUP,
	GPIO192_MC1_DAT1	| PIN_INPUT_PULLUP,
	GPIO193_MC1_DAT2	| PIN_INPUT_PULLUP,
	GPIO194_MC1_DAT3	| PIN_INPUT_PULLUP,
	GPIO195_MC1_CLK		| PIN_OUTPUT_LOW,
	GPIO196_MC1_CMD		| PIN_INPUT_PULLUP,
	GPIO197_MC1_CMDDIR	| PIN_OUTPUT_HIGH,
	GPIO198_MC1_FBCLK	| PIN_INPUT_NOPULL,
	GPIO199_MC1_DAT0DIR	| PIN_OUTPUT_HIGH,
);

static UX500_PINS(db5500_pins_sdi2,
	/* SDI2 (eMMC) */
	GPIO16_MC2_CMD		| PIN_INPUT_PULLUP,
	GPIO17_MC2_CLK		| PIN_OUTPUT_LOW,
	GPIO23_MC2_DAT0		| PIN_INPUT_PULLUP,
	GPIO19_MC2_DAT1		| PIN_INPUT_PULLUP,
	GPIO24_MC2_DAT2		| PIN_INPUT_PULLUP,
	GPIO20_MC2_DAT3		| PIN_INPUT_PULLUP,
	GPIO25_MC2_DAT4		| PIN_INPUT_PULLUP,
	GPIO21_MC2_DAT5		| PIN_INPUT_PULLUP,
	GPIO26_MC2_DAT6		| PIN_INPUT_PULLUP,
	GPIO22_MC2_DAT7		| PIN_INPUT_PULLUP
);

static UX500_PINS(db5500_pins_sdi3,
	/* SDI3 (SDIO) */
	GPIO171_MC3_DAT0	| PIN_INPUT_PULLUP | PIN_LOWEMI_ENABLED,
	GPIO172_MC3_DAT1	| PIN_INPUT_PULLUP | PIN_LOWEMI_ENABLED,
	GPIO173_MC3_DAT2	| PIN_INPUT_PULLUP | PIN_LOWEMI_ENABLED,
	GPIO174_MC3_DAT3	| PIN_INPUT_PULLUP | PIN_LOWEMI_ENABLED,
	GPIO175_MC3_CMD		| PIN_INPUT_PULLUP | PIN_LOWEMI_ENABLED,
	GPIO176_MC3_CLK		| PIN_OUTPUT_LOW,
);

static UX500_PINS(u5500_pins_i2c1,
	GPIO3_I2C1_SCL,
	GPIO4_I2C1_SDA,
);

static UX500_PINS(u5500_pins_i2c2,
	GPIO218_I2C2_SCL,
	GPIO219_I2C2_SDA,
);

static UX500_PINS(u5500_pins_i2c3,
	GPIO177_I2C3_SCL,
	GPIO178_I2C3_SDA,
);

static UX500_PINS(u5500_pins_spi3,
	GPIO186_GPIO		| PIN_OUTPUT_HIGH,
	GPIO188_SPI3_RXD	| PIN_INPUT_PULLDOWN,
	GPIO189_SPI3_TXD	| PIN_OUTPUT_LOW,
	GPIO190_SPI3_CLK	| PIN_OUTPUT_LOW,
);

/* USB */
static UX500_PINS(u5500_pins_usb,
	GPIO74_USB_NXT,
	GPIO72_USB_STP		| PIN_OUTPUT_HIGH,
	GPIO75_USB_XCLK,
	GPIO73_USB_DIR,
	GPIO71_USB_DAT7,
	GPIO70_USB_DAT6,
	GPIO69_USB_DAT5,
	GPIO68_USB_DAT4,
	GPIO67_USB_DAT3,
	GPIO66_USB_DAT2,
	GPIO65_USB_DAT1,
	GPIO64_USB_DAT0,
);

static struct ux500_pin_lookup u5500_pins[] = {
	PIN_LOOKUP("nmk-i2c.1", &u5500_pins_i2c1),
	PIN_LOOKUP("nmk-i2c.2", &u5500_pins_i2c2),
	PIN_LOOKUP("nmk-i2c.3", &u5500_pins_i2c3),
	PIN_LOOKUP("spi3", &u5500_pins_spi3),
	PIN_LOOKUP("db5500_kp", &db5500_kp_pins),
	PIN_LOOKUP("ab5500-usb.0", &u5500_pins_usb),
	PIN_LOOKUP("sdi0", &db5500_pins_sdi0),
	PIN_LOOKUP("sdi1", &db5500_pins_sdi1),
	PIN_LOOKUP("sdi2", &db5500_pins_sdi2),
	PIN_LOOKUP("sdi3", &db5500_pins_sdi3),
};

void __init u5500_pins_init(void)
{
	nmk_config_pins(u5500_pins_default, ARRAY_SIZE(u5500_pins_default));
	ux500_pins_add(u5500_pins, ARRAY_SIZE(u5500_pins));
}