[PATCH v2] mmc-omap: Add support for 16-bit and 32-bit registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The omap850 and omap730 use 16-bit registers instead of 32-bit, requiring
a modification of the register addresses in the mmc-omap driver.

Signed-off-by: Marek Belisko <marek.belisko@xxxxxxxxxxxxxxx>
Signed-off-by: Cory Maccarrone <darkstar6262@xxxxxxxxx>
---
 drivers/mmc/host/omap.c |   56 ++++++++++++++++++++++++----------------------
 1 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 5f970e2..892400b 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -2,7 +2,7 @@
  *  linux/drivers/mmc/host/omap.c
  *
  *  Copyright (C) 2004 Nokia Corporation
- *  Written by Tuukka Tikkanen and Juha Yrjölä<juha.yrjola@xxxxxxxxx>
+ *  Written by Tuukka Tikkanen and Juha Yrjᅵlᅵ<juha.yrjola@xxxxxxxxx>
  *  Misc hacks here and there by Tony Lindgren <tony@xxxxxxxxxxx>
  *  Other hacks (DMA, SD, etc) by David Brownell
  *
@@ -37,31 +37,33 @@
 #include <plat/mux.h>
 #include <plat/fpga.h>
 
-#define	OMAP_MMC_REG_CMD	0x00
-#define	OMAP_MMC_REG_ARGL	0x04
-#define	OMAP_MMC_REG_ARGH	0x08
-#define	OMAP_MMC_REG_CON	0x0c
-#define	OMAP_MMC_REG_STAT	0x10
-#define	OMAP_MMC_REG_IE		0x14
-#define	OMAP_MMC_REG_CTO	0x18
-#define	OMAP_MMC_REG_DTO	0x1c
-#define	OMAP_MMC_REG_DATA	0x20
-#define	OMAP_MMC_REG_BLEN	0x24
-#define	OMAP_MMC_REG_NBLK	0x28
-#define	OMAP_MMC_REG_BUF	0x2c
-#define OMAP_MMC_REG_SDIO	0x34
-#define	OMAP_MMC_REG_REV	0x3c
-#define	OMAP_MMC_REG_RSP0	0x40
-#define	OMAP_MMC_REG_RSP1	0x44
-#define	OMAP_MMC_REG_RSP2	0x48
-#define	OMAP_MMC_REG_RSP3	0x4c
-#define	OMAP_MMC_REG_RSP4	0x50
-#define	OMAP_MMC_REG_RSP5	0x54
-#define	OMAP_MMC_REG_RSP6	0x58
-#define	OMAP_MMC_REG_RSP7	0x5c
-#define	OMAP_MMC_REG_IOSR	0x60
-#define	OMAP_MMC_REG_SYSC	0x64
-#define	OMAP_MMC_REG_SYSS	0x68
+#define	OMAP_MMC_REGISTER_SIZE		(cpu_is_omap7xx() ? 2 : 4)
+
+#define	OMAP_MMC_REG_CMD		(0x00*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_ARGL		(0x01*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_ARGH		(0x02*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_CON		(0x03*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_STAT		(0x04*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_IE			(0x05*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_CTO		(0x06*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_DTO		(0x07*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_DATA		(0x08*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_BLEN		(0x09*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_NBLK		(0x0a*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_BUF		(0x0b*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_SDIO		(0x0d*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_REV		(0x0f*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP0		(0x10*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP1		(0x11*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP2		(0x12*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP3		(0x13*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP4		(0x14*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP5		(0x15*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP6		(0x16*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_RSP7		(0x17*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_IOSR		(0x18*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_SYSC		(0x19*OMAP_MMC_REGISTER_SIZE)
+#define	OMAP_MMC_REG_SYSS		(0x1a*OMAP_MMC_REGISTER_SIZE)
 
 #define	OMAP_MMC_STAT_CARD_ERR		(1 << 14)
 #define	OMAP_MMC_STAT_CARD_IRQ		(1 << 13)
@@ -1619,4 +1621,4 @@ module_exit(mmc_omap_exit);
 MODULE_DESCRIPTION("OMAP Multimedia Card driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:" DRIVER_NAME);
-MODULE_AUTHOR("Juha Yrjölä");
+MODULE_AUTHOR("Juha Yrjᅵlᅵ");
-- 
1.6.3.3


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux