summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2
diff options
context:
space:
mode:
authorVladimir Barinov <vova.barinov@gmail.com>2009-04-30 15:31:20 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2009-05-07 16:19:30 +0200
commit60c24dc79f01edfaa14290ada39a9074050ffbcc (patch)
tree38974c0664d1ce0dd6eb55a7146c230d258ec15b /arch/arm/mach-mx2
parent9366d8f67c234815e99bc8518a92da7f0fa3e026 (diff)
downloadblackbird-op-linux-60c24dc79f01edfaa14290ada39a9074050ffbcc.tar.gz
blackbird-op-linux-60c24dc79f01edfaa14290ada39a9074050ffbcc.zip
MX27ADS: Add SDHC support
Add SDHC support for MX27ADS board Signed-off-by: Vladimir Barinov <vbarinov@embeddedalley.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2')
-rw-r--r--arch/arm/mach-mx2/mx27ads.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c
index 90268a51f1fa..02daddac6995 100644
--- a/arch/arm/mach-mx2/mx27ads.c
+++ b/arch/arm/mach-mx2/mx27ads.c
@@ -24,6 +24,7 @@
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/i2c.h>
+#include <linux/irq.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@@ -37,6 +38,7 @@
#include <mach/mxc_nand.h>
#include <mach/i2c.h>
#include <mach/imxfb.h>
+#include <mach/mmc.h>
#include "devices.h"
@@ -123,6 +125,20 @@ static unsigned int mx27ads_pins[] = {
PA31_PF_OE_ACD,
/* OWIRE */
PE16_AF_OWIRE,
+ /* SDHC1*/
+ PE18_PF_SD1_D0,
+ PE19_PF_SD1_D1,
+ PE20_PF_SD1_D2,
+ PE21_PF_SD1_D3,
+ PE22_PF_SD1_CMD,
+ PE23_PF_SD1_CLK,
+ /* SDHC2*/
+ PB4_PF_SD2_D0,
+ PB5_PF_SD2_D1,
+ PB6_PF_SD2_D2,
+ PB7_PF_SD2_D3,
+ PB8_PF_SD2_CMD,
+ PB9_PF_SD2_CLK,
};
static struct mxc_nand_platform_data mx27ads_nand_board_info = {
@@ -199,6 +215,40 @@ static struct imx_fb_platform_data mx27ads_fb_data = {
.lcd_power = lcd_power,
};
+static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
+ void *data)
+{
+ return request_irq(IRQ_GPIOE(21), detect_irq, IRQF_TRIGGER_RISING,
+ "sdhc1-card-detect", data);
+}
+
+static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
+ void *data)
+{
+ return request_irq(IRQ_GPIOB(7), detect_irq, IRQF_TRIGGER_RISING,
+ "sdhc2-card-detect", data);
+}
+
+static void mx27ads_sdhc1_exit(struct device *dev, void *data)
+{
+ free_irq(IRQ_GPIOE(21), data);
+}
+
+static void mx27ads_sdhc2_exit(struct device *dev, void *data)
+{
+ free_irq(IRQ_GPIOB(7), data);
+}
+
+static struct imxmmc_platform_data sdhc1_pdata = {
+ .init = mx27ads_sdhc1_init,
+ .exit = mx27ads_sdhc1_exit,
+};
+
+static struct imxmmc_platform_data sdhc2_pdata = {
+ .init = mx27ads_sdhc2_init,
+ .exit = mx27ads_sdhc2_exit,
+};
+
static struct platform_device *platform_devices[] __initdata = {
&mx27ads_nor_mtd_device,
&mxc_fec_device,
@@ -239,6 +289,8 @@ static void __init mx27ads_board_init(void)
ARRAY_SIZE(mx27ads_i2c_devices));
mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data);
mxc_register_device(&mxc_fb_device, &mx27ads_fb_data);
+ mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata);
+ mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata);
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
}
OpenPOWER on IntegriCloud