aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2011-03-07 09:29:24 -0500
committerMike Rapoport <mike@compulab.co.il>2011-03-08 02:50:06 -0500
commitf02726a77960194995dac9fd218ec10b4de76cd6 (patch)
tree60f44f2b32f30293557443413f11a28221abe84b
parentd5fdafd38ca0c28c4648909ce0afd0a5420309ca (diff)
ARM: tegra: trimslice: enable MMC/SD slots
TrimSlice has MicroSD and standard MMC/SD slots. Register sdhci devices and enable GPIOs for MMC/SD slot. Signed-off-by: Mike Rapoport <mike@compulab.co.il>
-rw-r--r--arch/arm/mach-tegra/board-trimslice-pinmux.c9
-rw-r--r--arch/arm/mach-tegra/board-trimslice.c19
-rw-r--r--arch/arm/mach-tegra/board-trimslice.h3
3 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-trimslice-pinmux.c b/arch/arm/mach-tegra/board-trimslice-pinmux.c
index 6d4fc9f7f1fb..13534fa08abf 100644
--- a/arch/arm/mach-tegra/board-trimslice-pinmux.c
+++ b/arch/arm/mach-tegra/board-trimslice-pinmux.c
@@ -16,8 +16,11 @@
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19
19#include <mach/pinmux.h> 20#include <mach/pinmux.h>
21#include <mach/gpio.h>
20 22
23#include "gpio-names.h"
21#include "board-trimslice.h" 24#include "board-trimslice.h"
22 25
23static __initdata struct tegra_pingroup_config trimslice_pinmux[] = { 26static __initdata struct tegra_pingroup_config trimslice_pinmux[] = {
@@ -139,7 +142,13 @@ static __initdata struct tegra_pingroup_config trimslice_pinmux[] = {
139 {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, 142 {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
140}; 143};
141 144
145static struct tegra_gpio_table gpio_table[] = {
146 { .gpio = TRIMSLICE_GPIO_SD4_CD, .enable = true }, /* mmc4 cd */
147 { .gpio = TRIMSLICE_GPIO_SD4_WP, .enable = true }, /* mmc4 wp */
148};
149
142void __init trimslice_pinmux_init(void) 150void __init trimslice_pinmux_init(void)
143{ 151{
144 tegra_pinmux_config_table(trimslice_pinmux, ARRAY_SIZE(trimslice_pinmux)); 152 tegra_pinmux_config_table(trimslice_pinmux, ARRAY_SIZE(trimslice_pinmux));
153 tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table));
145} 154}
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index 7be7d4acd02f..cda4cfd78e84 100644
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -29,9 +29,12 @@
29#include <asm/setup.h> 29#include <asm/setup.h>
30 30
31#include <mach/iomap.h> 31#include <mach/iomap.h>
32#include <mach/sdhci.h>
32 33
33#include "board.h" 34#include "board.h"
34#include "clock.h" 35#include "clock.h"
36#include "devices.h"
37#include "gpio-names.h"
35 38
36#include "board-trimslice.h" 39#include "board-trimslice.h"
37 40
@@ -56,9 +59,22 @@ static struct platform_device debug_uart = {
56 .platform_data = debug_uart_platform_data, 59 .platform_data = debug_uart_platform_data,
57 }, 60 },
58}; 61};
62static struct tegra_sdhci_platform_data sdhci_pdata1 = {
63 .cd_gpio = -1,
64 .wp_gpio = -1,
65 .power_gpio = -1,
66};
67
68static struct tegra_sdhci_platform_data sdhci_pdata4 = {
69 .cd_gpio = TRIMSLICE_GPIO_SD4_CD,
70 .wp_gpio = TRIMSLICE_GPIO_SD4_WP,
71 .power_gpio = -1,
72};
59 73
60static struct platform_device *trimslice_devices[] __initdata = { 74static struct platform_device *trimslice_devices[] __initdata = {
61 &debug_uart, 75 &debug_uart,
76 &tegra_sdhci_device1,
77 &tegra_sdhci_device4,
62}; 78};
63 79
64static void __init tegra_trimslice_fixup(struct machine_desc *desc, 80static void __init tegra_trimslice_fixup(struct machine_desc *desc,
@@ -92,6 +108,9 @@ static void __init tegra_trimslice_init(void)
92 108
93 trimslice_pinmux_init(); 109 trimslice_pinmux_init();
94 110
111 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
112 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
113
95 platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); 114 platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices));
96} 115}
97 116
diff --git a/arch/arm/mach-tegra/board-trimslice.h b/arch/arm/mach-tegra/board-trimslice.h
index 16ec0f0d3bb1..e8ef6291c6f1 100644
--- a/arch/arm/mach-tegra/board-trimslice.h
+++ b/arch/arm/mach-tegra/board-trimslice.h
@@ -17,6 +17,9 @@
17#ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H 17#ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H
18#define _MACH_TEGRA_BOARD_TRIMSLICE_H 18#define _MACH_TEGRA_BOARD_TRIMSLICE_H
19 19
20#define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */
21#define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */
22
20void trimslice_pinmux_init(void); 23void trimslice_pinmux_init(void);
21 24
22#endif 25#endif