omap4 hsmmc: Register offset handling
authorkishore kadiyala <kishore.kadiyala@ti.com>
Fri, 1 Oct 2010 23:35:28 +0000 (16:35 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 1 Oct 2010 23:35:28 +0000 (16:35 -0700)
In OMAP4, as per new PM programming model, the legacy registers
which were there in OMAP3 are all shifted by 0x100 while new one's
are added from offset 0 to 0x10.
For OMAP4, the register offset appending of 0x100 done in devices.c
currently, is moved to driver file.This change fits in for current
implementation as well as once the driver undergoes hwmod adaptation.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/hsmmc.c
arch/arm/plat-omap/include/plat/mmc.h
drivers/mmc/host/omap_hsmmc.c

index 9e5d51bee94a2f750680ec6df3351c7e5ad5dadc..9bd4b3452453066fb260e89aef7f066c9d4648e2 100644 (file)
@@ -817,13 +817,13 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
                case 3:
                        if (!cpu_is_omap44xx())
                                return;
-                       base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET;
+                       base = OMAP4_MMC4_BASE;
                        irq = OMAP44XX_IRQ_MMC4;
                        break;
                case 4:
                        if (!cpu_is_omap44xx())
                                return;
-                       base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET;
+                       base = OMAP4_MMC5_BASE;
                        irq = OMAP44XX_IRQ_MMC5;
                        break;
                default:
@@ -834,10 +834,8 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
                        size = OMAP2420_MMC_SIZE;
                        name = "mmci-omap";
                } else if (cpu_is_omap44xx()) {
-                       if (i < 3) {
-                               base += OMAP4_MMC_REG_OFFSET;
+                       if (i < 3)
                                irq += OMAP44XX_IRQ_GIC_START;
-                       }
                        size = OMAP4_HSMMC_SIZE;
                        name = "mmci-omap-hs";
                } else {
index df1311d93eba58e61d9e637405c173ee67d36127..ab78a5a8d9b0f943b8e6358ef30d273a25e4d742 100644 (file)
@@ -266,6 +266,10 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
                mmc->slots[0].caps = c->caps;
                mmc->slots[0].internal_clock = !c->ext_clock;
                mmc->dma_mask = 0xffffffff;
+               if (cpu_is_omap44xx())
+                       mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
+               else
+                       mmc->reg_offset = 0;
 
                mmc->get_context_loss_count = hsmmc_get_context_loss;
 
index 2c4629a8d9f2484640492e43dd189819a8a4bff9..0ce3099b1eb0c3af619500076f947eae234b1d52 100644 (file)
@@ -71,6 +71,9 @@ struct omap_mmc_platform_data {
 
        u64 dma_mask;
 
+       /* Register offset deviation */
+       u16 reg_offset;
+
        struct omap_mmc_slot_data {
 
                /* 4/8 wires and any additional host capabilities
index 69858e75020381325f5a75b3c26ade9e140b2836..dc95756fd95c39e55dfc08d757316b7b315e71d5 100644 (file)
@@ -2014,6 +2014,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
        if (res == NULL || irq < 0)
                return -ENXIO;
 
+       res->start += pdata->reg_offset;
+       res->end += pdata->reg_offset;
        res = request_mem_region(res->start, res->end - res->start + 1,
                                                        pdev->name);
        if (res == NULL)