diff options
author | David A. Griego <dgriego@mvista.com> | 2009-09-15 21:10:20 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-11-25 13:21:22 -0500 |
commit | 2eb30c81ce91f646f6f2e6cdfd36b79a492002ce (patch) | |
tree | 2dd822341f501f24c9196f94680308da4c78f686 /arch/arm/mach-davinci/board-da830-evm.c | |
parent | f63dd12da29f47c37bbc093abec098538e04357c (diff) |
davinci: Add MMC/SD support for DA830/OMAP-L137 EVM
Add pinmux settings, etc. to enable the MMC/SC hardware.
Signed-off-by: David A. Griego <dgriego@mvista.com>
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-da830-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-da830-evm.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 39711c123dd6..fe86afa7ea2e 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <mach/irqs.h> | 23 | #include <mach/irqs.h> |
24 | #include <mach/cp_intc.h> | 24 | #include <mach/cp_intc.h> |
25 | #include <mach/mux.h> | 25 | #include <mach/mux.h> |
26 | #include <mach/gpio.h> | ||
26 | #include <mach/da8xx.h> | 27 | #include <mach/da8xx.h> |
27 | #include <mach/asp.h> | 28 | #include <mach/asp.h> |
28 | 29 | ||
@@ -83,6 +84,57 @@ static struct snd_platform_data da830_evm_snd_data = { | |||
83 | .rxnumevt = 1, | 84 | .rxnumevt = 1, |
84 | }; | 85 | }; |
85 | 86 | ||
87 | /* | ||
88 | * GPIO2[1] is used as MMC_SD_WP and GPIO2[2] as MMC_SD_INS. | ||
89 | */ | ||
90 | static const short da830_evm_mmc_sd_pins[] = { | ||
91 | DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2, | ||
92 | DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5, | ||
93 | DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK, | ||
94 | DA830_MMCSD_CMD, DA830_GPIO2_1, DA830_GPIO2_2, | ||
95 | -1 | ||
96 | }; | ||
97 | |||
98 | #define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1) | ||
99 | |||
100 | static int da830_evm_mmc_get_ro(int index) | ||
101 | { | ||
102 | return gpio_get_value(DA830_MMCSD_WP_PIN); | ||
103 | } | ||
104 | |||
105 | static struct davinci_mmc_config da830_evm_mmc_config = { | ||
106 | .get_ro = da830_evm_mmc_get_ro, | ||
107 | .wires = 4, | ||
108 | .version = MMC_CTLR_VERSION_2, | ||
109 | }; | ||
110 | |||
111 | static inline void da830_evm_init_mmc(void) | ||
112 | { | ||
113 | int ret; | ||
114 | |||
115 | ret = da8xx_pinmux_setup(da830_evm_mmc_sd_pins); | ||
116 | if (ret) { | ||
117 | pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n", | ||
118 | ret); | ||
119 | return; | ||
120 | } | ||
121 | |||
122 | ret = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP"); | ||
123 | if (ret) { | ||
124 | pr_warning("da830_evm_init: can not open GPIO %d\n", | ||
125 | DA830_MMCSD_WP_PIN); | ||
126 | return; | ||
127 | } | ||
128 | gpio_direction_input(DA830_MMCSD_WP_PIN); | ||
129 | |||
130 | ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); | ||
131 | if (ret) { | ||
132 | pr_warning("da830_evm_init: mmc/sd registration failed: %d\n", | ||
133 | ret); | ||
134 | gpio_free(DA830_MMCSD_WP_PIN); | ||
135 | } | ||
136 | } | ||
137 | |||
86 | static __init void da830_evm_init(void) | 138 | static __init void da830_evm_init(void) |
87 | { | 139 | { |
88 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 140 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
@@ -132,6 +184,8 @@ static __init void da830_evm_init(void) | |||
132 | ret); | 184 | ret); |
133 | 185 | ||
134 | da8xx_register_mcasp(1, &da830_evm_snd_data); | 186 | da8xx_register_mcasp(1, &da830_evm_snd_data); |
187 | |||
188 | da830_evm_init_mmc(); | ||
135 | } | 189 | } |
136 | 190 | ||
137 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 191 | #ifdef CONFIG_SERIAL_8250_CONSOLE |