aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/board-u5500-pins.c
blob: 05175e4e5b93decc058135aa15189ace1058c635 (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
/*
 * 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 <plat/pincfg.h>
#include <plat/gpio.h>

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

static pin_cfg_t u5500_pins_default[] = {
	/* Keypad */
	GPIO128_KP_I0	| PIN_INPUT_PULLUP,
	GPIO130_KP_I1	| PIN_INPUT_PULLUP,
	GPIO132_KP_I2	| PIN_INPUT_PULLUP,
	GPIO134_KP_I3	| PIN_INPUT_PULLUP,
	GPIO137_KP_O4	| PIN_INPUT_PULLUP,
	GPIO139_KP_O5	| PIN_INPUT_PULLUP,

	/* 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,

	/* MMC0 (POP 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,

	/* SPI */
	GPIO167_SPI1_CS0n	| PIN_OUTPUT_HIGH,
	GPIO168_SPI1_RXD	| PIN_INPUT_PULLDOWN,
	GPIO169_SPI1_TXD	| PIN_OUTPUT_LOW,
	GPIO170_SPI1_CLK	| PIN_OUTPUT_LOW,

	/* AB5500 */
	GPIO78_IRQn,

	/* TOUCH_IRQ */
	GPIO179_GPIO	| PIN_INPUT_PULLUP,

	/* 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,
	/* SD-CARD detect/levelshifter pins */
	GPIO180_GPIO		| PIN_INPUT_PULLUP,
	GPIO227_GPIO,
	GPIO185_GPIO,

	/* SDI3 (SDIO) */
	GPIO171_MC3_DAT0	| PIN_INPUT_PULLUP,
	GPIO172_MC3_DAT1	| PIN_INPUT_PULLUP,
	GPIO173_MC3_DAT2	| PIN_INPUT_PULLUP,
	GPIO174_MC3_DAT3	| PIN_INPUT_PULLUP,
	GPIO175_MC3_CMD		| PIN_INPUT_PULLUP,
	GPIO176_MC3_CLK		| PIN_OUTPUT_LOW,

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

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

	GPIO202_ACCU0_RXD	| PIN_INPUT_PULLUP,
	GPIO203_ACCU0_TXD	| PIN_OUTPUT_HIGH,
};

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_spi3,
	GPIO187_SPI3_CS0n	| PIN_OUTPUT_HIGH,
	GPIO188_SPI3_RXD	| PIN_INPUT_PULLDOWN,
	GPIO189_SPI3_TXD	| PIN_OUTPUT_LOW,
	GPIO190_SPI3_CLK	| PIN_OUTPUT_LOW,
);

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("spi3", &u5500_pins_spi3),
};

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));
}