summaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa/magician.c
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2008-04-09 19:24:55 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 11:29:07 +0100
commitbdb0c16acb51b7bf15d626848f287691ef39dbe8 (patch)
tree52e333deb09d45eedd96723e39794c1c81f353e1 /arch/arm/mach-pxa/magician.c
parentaa7975901b949501d47af8225f23bee1116cd441 (diff)
downloadlinux-3.10-bdb0c16acb51b7bf15d626848f287691ef39dbe8.tar.gz
linux-3.10-bdb0c16acb51b7bf15d626848f287691ef39dbe8.tar.bz2
linux-3.10-bdb0c16acb51b7bf15d626848f287691ef39dbe8.zip
[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/magician.c')
-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 159f6dc4543..a931c384d49 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -31,6 +31,7 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/i2c.h>
+#include <asm/arch/mmc.h>
#include <asm/arch/irda.h>
#include <asm/arch/ohci.h>
@@ -202,6 +203,44 @@ static struct platform_device backlight = {
/*
+ * MMC/SD
+ */
+
+static int magician_mci_init(struct device *dev,
+ irq_handler_t detect_irq, void *data)
+{
+ return request_irq(IRQ_MAGICIAN_SD, detect_irq,
+ IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
+ "MMC card detect", data);
+}
+
+static void magician_mci_setpower(struct device *dev, unsigned int vdd)
+{
+ struct pxamci_platform_data *pdata = dev->platform_data;
+
+ gpio_set_value(EGPIO_MAGICIAN_SD_POWER, (1 << vdd) & pdata->ocr_mask);
+}
+
+static int magician_mci_get_ro(struct device *dev)
+{
+ return (!gpio_get_value(EGPIO_MAGICIAN_nSD_READONLY));
+}
+
+static void magician_mci_exit(struct device *dev, void *data)
+{
+ free_irq(IRQ_MAGICIAN_SD, data);
+}
+
+static struct pxamci_platform_data magician_mci_info = {
+ .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
+ .init = magician_mci_init,
+ .get_ro = magician_mci_get_ro,
+ .setpower = magician_mci_setpower,
+ .exit = magician_mci_exit,
+};
+
+
+/*
* USB OHCI
*/
@@ -267,6 +306,7 @@ static void __init magician_init(void)
{
platform_add_devices(devices, ARRAY_SIZE(devices));
pxa_set_i2c_info(NULL);
+ pxa_set_mci_info(&magician_mci_info);
pxa_set_ohci_info(&magician_ohci_info);
pxa_set_ficp_info(&magician_ficp_info);
set_pxa_fb_info(&toppoly_info);