Skip to contentSkip to conversation

MMC/SD Controller driver for OMAP2430

PATCH In review Madhusudhan Chikkature Rajashekar 1 participant 1 message Dec 7, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/4 MMC/SD Controller driver for OMAP2430

Hi All,

I am continuing with the MMC/SD omap supporting patches on linux omap mailing list.

Thanks,
Madhu
-------------------------------------------------------------------------------------------

This patch adds OMAP2430/3430 MMC board specific file.

---
 arch/arm/mach-omap2/Makefile          |    6 
 arch/arm/mach-omap2/board-2430sdp.c   |   11 +
 arch/arm/mach-omap2/board-3430sdp.c   |   11 +
 arch/arm/mach-omap2/board-sdp-hsmmc.c |  277 ++++++++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/mmc.h       |    4 
 5 files changed, 307 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/Makefile +4 -2
Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===================================================================
@@ -24,9 +24,11 @@
 obj-$(CONFIG_MACH_OMAP_H4)		+= board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)		+= board-2430sdp.o \
 					   board-2430sdp-flash.o \
-					   board-2430sdp-usb.o
+					   board-2430sdp-usb.o \
+					   board-sdp-hsmmc.o
 obj-$(CONFIG_MACH_OMAP_2430OSK)		+= board-2430osk.o
-obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
+obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o \
+					   board-sdp-hsmmc.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)		+= board-apollon.o \
 					   board-apollon-mmc.o	\
 					   board-apollon-keys.o
arch/arm/mach-omap2/board-2430sdp.c +11 -0
Index: linux-omap-2.6/arch/arm/mach-omap2/board-2430sdp.c
===================================================================
@@ -54,6 +54,8 @@
 #define TWL4030_MSECURE_GPIO	118
 #define SECONDARY_LCD_GPIO	147
 
+extern void __init sdp_mmc_init(void);
+
 static struct mtd_partition sdp2430_partitions[] = {
 	/* bootloader (U-Boot, etc) in first sector */
 	{
@@ -355,10 +357,18 @@
 	.console_speed = 115200,
 };
 
+static struct omap_mmc_config sdp2430_mmc_config __initdata = {
+	.mmc [0] = {
+		.enabled	= 1,
+		.wire4		= 1,
+	},
+};
+
 static struct omap_board_config_kernel sdp2430_config[] __initdata = {
 	{OMAP_TAG_UART, &sdp2430_uart_config},
 	{OMAP_TAG_LCD, &sdp2430_lcd_config},
 	{OMAP_TAG_SERIAL_CONSOLE, &sdp2430_serial_console_config},
+	{OMAP_TAG_MMC, &sdp2430_mmc_config },
 };
 
 static int __init omap2430_i2c_init(void)
@@ -384,6 +394,7 @@
 	spi_register_board_info(sdp2430_spi_board_info,
 				ARRAY_SIZE(sdp2430_spi_board_info));
 	ads7846_dev_init();
+	sdp_mmc_init();
 
 	/* turn off secondary LCD backlight */
 	omap_set_gpio_direction(SECONDARY_LCD_GPIO, 0);
arch/arm/mach-omap2/board-3430sdp.c +11 -0
Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===================================================================
@@ -50,6 +50,8 @@
 #define ENABLE_VAUX3_DEDICATED	0x03
 #define ENABLE_VAUX3_DEV_GRP	0x20
 
+extern void __init sdp_mmc_init(void);
+
 static struct mtd_partition sdp3430_partitions[] = {
 	/* bootloader (U-Boot, etc) in first sector */
 	{
@@ -296,8 +298,16 @@
 	.enabled_uarts	= ((1 << 0) | (1 << 1) | (1 << 2)),
 };
 
+static struct omap_mmc_config sdp3430_mmc_config __initdata = {
+	.mmc [0] = {
+		.enabled	= 1,
+		.wire4		= 1,
+	},
+};
+
 static struct omap_board_config_kernel sdp3430_config[] = {
 	{ OMAP_TAG_UART,	&sdp3430_uart_config },
+	{ OMAP_TAG_MMC,		&sdp3430_mmc_config },
 };
 static int __init omap3430_i2c_init(void)
 {
@@ -316,6 +326,7 @@
 				ARRAY_SIZE(sdp3430_spi_board_info));
 	ads7846_dev_init();
 	omap_serial_init();
+	sdp_mmc_init();
 }
 
 static void __init omap_3430sdp_map_io(void)
arch/arm/mach-omap2/board-sdp-hsmmc.c new file +277 -0

277 lines not on this page · raw message

include/asm-arm/arch-omap/mmc.h +4 -0
Index: linux-omap-2.6/include/asm-arm/arch-omap/mmc.h
===================================================================
@@ -36,6 +36,10 @@
 	int (* init)(struct device *dev);
 	void (* cleanup)(struct device *dev);
 
+	/* To handle board related suspend/resume functionality for MMC */
+	int (*suspend)(struct device *dev, int slot);
+	int (*resume)(struct device *dev, int slot);
+
 	struct omap_mmc_slot_data {
 		int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
 		int (* set_power)(struct device *dev, int slot, int power_on, int vdd);