aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/board-seaboard-pinmux.c
diff options
context:
space:
mode:
authorPeter De Schrijver <pdeschrijver@nvidia.com>2011-10-12 07:53:04 -0400
committerOlof Johansson <olof@lixom.net>2011-10-13 18:04:54 -0400
commit21fb1ccc92655d8eabed9b8fdfa2a65bf6e58a33 (patch)
treeed67e9aaf4c35c03131ab32214f75cc2e79a0e48 /arch/arm/mach-tegra/board-seaboard-pinmux.c
parente146245453986974a294d91d691481da8b61696b (diff)
arm/tegra: add support for ventana pinmuxing
Add support for ventana pinmuxing as a seaboard derivative. This is a cut down version of work done by Jong Kim <jongk@nvidia.com>. Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra/board-seaboard-pinmux.c')
-rw-r--r--arch/arm/mach-tegra/board-seaboard-pinmux.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c
index 841e4672b520..dd3b7405b4d4 100644
--- a/arch/arm/mach-tegra/board-seaboard-pinmux.c
+++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
@@ -159,6 +159,27 @@ static __initdata struct tegra_pingroup_config seaboard_pinmux[] = {
159 {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},
160}; 160};
161 161
162static __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};
182
162static struct platform_device *pinmux_devices[] = { 183static struct platform_device *pinmux_devices[] = {
163 &tegra_gpio_device, 184 &tegra_gpio_device,
164 &tegra_pinmux_device, 185 &tegra_pinmux_device,
@@ -173,6 +194,26 @@ static struct tegra_gpio_table common_gpio_table[] = {
173 { .gpio = TEGRA_GPIO_ISL29018_IRQ, .enable = true }, 194 { .gpio = TEGRA_GPIO_ISL29018_IRQ, .enable = true },
174}; 195};
175 196
197static void __init update_pinmux(struct tegra_pingroup_config *newtbl, int size)
198{
199 int i, j;
200 struct tegra_pingroup_config *new_pingroup, *base_pingroup;
201
202 /* Update base seaboard pinmux table with secondary board
203 * specific pinmux table table.
204 */
205 for (i = 0; i < size; i++) {
206 new_pingroup = &newtbl[i];
207 for (j = 0; j < ARRAY_SIZE(seaboard_pinmux); j++) {
208 base_pingroup = &seaboard_pinmux[j];
209 if (new_pingroup->pingroup == base_pingroup->pingroup) {
210 *base_pingroup = *new_pingroup;
211 break;
212 }
213 }
214 }
215}
216
176void __init seaboard_common_pinmux_init(void) 217void __init seaboard_common_pinmux_init(void)
177{ 218{
178 platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices)); 219 platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices));
@@ -189,3 +230,10 @@ void __init seaboard_pinmux_init(void)
189{ 230{
190 seaboard_common_pinmux_init(); 231 seaboard_common_pinmux_init();
191} 232}
233
234void __init ventana_pinmux_init(void)
235{
236 update_pinmux(ventana_pinmux, ARRAY_SIZE(ventana_pinmux));
237 seaboard_common_pinmux_init();
238}
239