diff options
Diffstat (limited to 'arch/arm/mach-tegra/board-seaboard-pinmux.c')
-rw-r--r-- | arch/arm/mach-tegra/board-seaboard-pinmux.c | 69 |
1 files changed, 64 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c index 74f78b7e3f19..fbce31daa3c9 100644 --- a/arch/arm/mach-tegra/board-seaboard-pinmux.c +++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2010 NVIDIA Corporation | 2 | * Copyright (C) 2010,2011 NVIDIA Corporation |
3 | * Copyright (C) 2011 Google, Inc. | ||
3 | * | 4 | * |
4 | * This software is licensed under the terms of the GNU General Public | 5 | * This software is licensed under the terms of the GNU General Public |
5 | * License version 2, as published by the Free Software Foundation, and | 6 | * License version 2, as published by the Free Software Foundation, and |
@@ -21,6 +22,7 @@ | |||
21 | 22 | ||
22 | #include "gpio-names.h" | 23 | #include "gpio-names.h" |
23 | #include "board-seaboard.h" | 24 | #include "board-seaboard.h" |
25 | #include "devices.h" | ||
24 | 26 | ||
25 | #define DEFAULT_DRIVE(_name) \ | 27 | #define DEFAULT_DRIVE(_name) \ |
26 | { \ | 28 | { \ |
@@ -157,10 +159,33 @@ static __initdata struct tegra_pingroup_config seaboard_pinmux[] = { | |||
157 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 159 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
158 | }; | 160 | }; |
159 | 161 | ||
162 | static __initdata struct tegra_pingroup_config ventana_pinmux[] = { | ||
163 | {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | ||
164 | {TEGRA_PINGROUP_DDC, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | ||
165 | {TEGRA_PINGROUP_DTA, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, | ||
166 | {TEGRA_PINGROUP_DTB, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, | ||
167 | {TEGRA_PINGROUP_DTC, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, | ||
168 | {TEGRA_PINGROUP_DTD, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL}, | ||
169 | {TEGRA_PINGROUP_GMD, TEGRA_MUX_SFLASH, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | ||
170 | {TEGRA_PINGROUP_LPW0, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | ||
171 | {TEGRA_PINGROUP_LPW2, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | ||
172 | {TEGRA_PINGROUP_LSC1, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | ||
173 | {TEGRA_PINGROUP_LSCK, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | ||
174 | {TEGRA_PINGROUP_LSDA, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | ||
175 | {TEGRA_PINGROUP_PTA, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | ||
176 | {TEGRA_PINGROUP_SLXC, TEGRA_MUX_SDIO3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | ||
177 | {TEGRA_PINGROUP_SLXK, TEGRA_MUX_SDIO3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | ||
178 | {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | ||
179 | {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | ||
180 | {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | ||
181 | }; | ||
160 | 182 | ||
183 | static struct platform_device *pinmux_devices[] = { | ||
184 | &tegra_gpio_device, | ||
185 | &tegra_pinmux_device, | ||
186 | }; | ||
161 | 187 | ||
162 | 188 | static struct tegra_gpio_table common_gpio_table[] = { | |
163 | static struct tegra_gpio_table gpio_table[] = { | ||
164 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, | 189 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, |
165 | { .gpio = TEGRA_GPIO_SD2_WP, .enable = true }, | 190 | { .gpio = TEGRA_GPIO_SD2_WP, .enable = true }, |
166 | { .gpio = TEGRA_GPIO_SD2_POWER, .enable = true }, | 191 | { .gpio = TEGRA_GPIO_SD2_POWER, .enable = true }, |
@@ -171,12 +196,46 @@ static struct tegra_gpio_table gpio_table[] = { | |||
171 | { .gpio = TEGRA_GPIO_USB1, .enable = true }, | 196 | { .gpio = TEGRA_GPIO_USB1, .enable = true }, |
172 | }; | 197 | }; |
173 | 198 | ||
174 | void __init seaboard_pinmux_init(void) | 199 | static void __init update_pinmux(struct tegra_pingroup_config *newtbl, int size) |
200 | { | ||
201 | int i, j; | ||
202 | struct tegra_pingroup_config *new_pingroup, *base_pingroup; | ||
203 | |||
204 | /* Update base seaboard pinmux table with secondary board | ||
205 | * specific pinmux table table. | ||
206 | */ | ||
207 | for (i = 0; i < size; i++) { | ||
208 | new_pingroup = &newtbl[i]; | ||
209 | for (j = 0; j < ARRAY_SIZE(seaboard_pinmux); j++) { | ||
210 | base_pingroup = &seaboard_pinmux[j]; | ||
211 | if (new_pingroup->pingroup == base_pingroup->pingroup) { | ||
212 | *base_pingroup = *new_pingroup; | ||
213 | break; | ||
214 | } | ||
215 | } | ||
216 | } | ||
217 | } | ||
218 | |||
219 | void __init seaboard_common_pinmux_init(void) | ||
175 | { | 220 | { |
221 | platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices)); | ||
222 | |||
176 | tegra_pinmux_config_table(seaboard_pinmux, ARRAY_SIZE(seaboard_pinmux)); | 223 | tegra_pinmux_config_table(seaboard_pinmux, ARRAY_SIZE(seaboard_pinmux)); |
177 | 224 | ||
178 | tegra_drive_pinmux_config_table(seaboard_drive_pinmux, | 225 | tegra_drive_pinmux_config_table(seaboard_drive_pinmux, |
179 | ARRAY_SIZE(seaboard_drive_pinmux)); | 226 | ARRAY_SIZE(seaboard_drive_pinmux)); |
180 | 227 | ||
181 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); | 228 | tegra_gpio_config(common_gpio_table, ARRAY_SIZE(common_gpio_table)); |
229 | } | ||
230 | |||
231 | void __init seaboard_pinmux_init(void) | ||
232 | { | ||
233 | seaboard_common_pinmux_init(); | ||
182 | } | 234 | } |
235 | |||
236 | void __init ventana_pinmux_init(void) | ||
237 | { | ||
238 | update_pinmux(ventana_pinmux, ARRAY_SIZE(ventana_pinmux)); | ||
239 | seaboard_common_pinmux_init(); | ||
240 | } | ||
241 | |||