aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2008-04-09 14:24:55 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 06:29:07 -0400
commitbdb0c16acb51b7bf15d626848f287691ef39dbe8 (patch)
tree52e333deb09d45eedd96723e39794c1c81f353e1 /arch/arm/mach-pxa
parentaa7975901b949501d47af8225f23bee1116cd441 (diff)
[ARM] 4950/1: magician: enable MMC support
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/magician.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 159f6dc4543a..a931c384d49d 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -31,6 +31,7 @@
31#include <asm/arch/pxa-regs.h> 31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/pxafb.h> 32#include <asm/arch/pxafb.h>
33#include <asm/arch/i2c.h> 33#include <asm/arch/i2c.h>
34#include <asm/arch/mmc.h>
34#include <asm/arch/irda.h> 35#include <asm/arch/irda.h>
35#include <asm/arch/ohci.h> 36#include <asm/arch/ohci.h>
36 37
@@ -202,6 +203,44 @@ static struct platform_device backlight = {
202 203
203 204
204/* 205/*
206 * MMC/SD
207 */
208
209static int magician_mci_init(struct device *dev,
210 irq_handler_t detect_irq, void *data)
211{
212 return request_irq(IRQ_MAGICIAN_SD, detect_irq,
213 IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
214 "MMC card detect", data);
215}
216
217static void magician_mci_setpower(struct device *dev, unsigned int vdd)
218{
219 struct pxamci_platform_data *pdata = dev->platform_data;
220
221 gpio_set_value(EGPIO_MAGICIAN_SD_POWER, (1 << vdd) & pdata->ocr_mask);
222}
223
224static int magician_mci_get_ro(struct device *dev)
225{
226 return (!gpio_get_value(EGPIO_MAGICIAN_nSD_READONLY));
227}
228
229static void magician_mci_exit(struct device *dev, void *data)
230{
231 free_irq(IRQ_MAGICIAN_SD, data);
232}
233
234static struct pxamci_platform_data magician_mci_info = {
235 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
236 .init = magician_mci_init,
237 .get_ro = magician_mci_get_ro,
238 .setpower = magician_mci_setpower,
239 .exit = magician_mci_exit,
240};
241
242
243/*
205 * USB OHCI 244 * USB OHCI
206 */ 245 */
207 246
@@ -267,6 +306,7 @@ static void __init magician_init(void)
267{ 306{
268 platform_add_devices(devices, ARRAY_SIZE(devices)); 307 platform_add_devices(devices, ARRAY_SIZE(devices));
269 pxa_set_i2c_info(NULL); 308 pxa_set_i2c_info(NULL);
309 pxa_set_mci_info(&magician_mci_info);
270 pxa_set_ohci_info(&magician_ohci_info); 310 pxa_set_ohci_info(&magician_ohci_info);
271 pxa_set_ficp_info(&magician_ficp_info); 311 pxa_set_ficp_info(&magician_ficp_info);
272 set_pxa_fb_info(&toppoly_info); 312 set_pxa_fb_info(&toppoly_info);